2022-03-23 19:48:41 +00:00
|
|
|
/*
|
2022-04-20 18:30:09 +00:00
|
|
|
Package neotest contains a framework for automated contract testing.
|
2022-03-23 19:48:41 +00:00
|
|
|
It can be used to implement unit-tests for contracts in Go using regular Go
|
|
|
|
conventions.
|
|
|
|
|
|
|
|
Usually it's used like this:
|
2022-08-08 10:23:21 +00:00
|
|
|
|
|
|
|
- an instance of the blockchain is created using chain subpackage
|
|
|
|
- the target contract is compiled using one of Compile* functions
|
|
|
|
- and Executor is created for the blockchain
|
|
|
|
- it's used to deploy a contract with DeployContract
|
|
|
|
- CommitteeInvoker and/or ValidatorInvoker are then created to perform test invocations
|
|
|
|
- if needed, NewAccount is used to create an appropriate number of accounts for the test
|
2022-03-23 19:48:41 +00:00
|
|
|
|
|
|
|
Higher-order methods provided in Executor and ContractInvoker hide the details
|
|
|
|
of transaction creation for the most part, but there are lower-level methods as
|
|
|
|
well that can be used for specific tasks.
|
2023-09-05 12:19:13 +00:00
|
|
|
|
|
|
|
It's recommended to have a separate folder/package for tests, because having
|
|
|
|
them in the same package with the smart contract iself can lead to unxpected
|
|
|
|
results if smart contract has any init() functions. If that's the case they
|
|
|
|
will be compiled into the testing binary even when using package_test and their
|
|
|
|
execution can affect tests. See https://github.com/nspcc-dev/neo-go/issues/3120 for details.
|
2022-03-23 19:48:41 +00:00
|
|
|
*/
|
|
|
|
package neotest
|