Documentation
¶
Index ¶
- Variables
- func AddBlock(t *testing.T, bc *core.Blockchain, txs ...*transaction.Transaction) *block.Block
- func AddBlockCheckHalt(t *testing.T, bc *core.Blockchain, txs ...*transaction.Transaction) *block.Block
- func CheckFault(t *testing.T, bc *core.Blockchain, h util.Uint256, s string)
- func CheckHalt(t *testing.T, bc *core.Blockchain, h util.Uint256, stack ...stackitem.Item) *state.AppExecResult
- func CheckTestInvoke(t *testing.T, bc *core.Blockchain, tx *transaction.Transaction, ...)
- func DeployContract(t *testing.T, bc *core.Blockchain, path string, data interface{}) util.Uint160
- func NewAccount(t *testing.T, bc *core.Blockchain) *wallet.Account
- func NewChain(t *testing.T) *core.Blockchain
- func PrepareInvoke(t *testing.T, bc *core.Blockchain, signer interface{}, hash util.Uint160, ...) *transaction.Transaction
- func TestInvoke(bc *core.Blockchain, tx *transaction.Transaction) (*vm.VM, error)
- type Contract
Constants ¶
This section is empty.
Variables ¶
var CommitteeAcc *wallet.Account
CommitteeAcc is an account used to sign tx as a committee.
Functions ¶
func AddBlock ¶
func AddBlock(t *testing.T, bc *core.Blockchain, txs ...*transaction.Transaction) *block.Block
AddBlock creates a new block from provided transactions and adds it on bc.
func AddBlockCheckHalt ¶
func AddBlockCheckHalt(t *testing.T, bc *core.Blockchain, txs ...*transaction.Transaction) *block.Block
AddBlockCheckHalt is a convenient wrapper over AddBlock and CheckHalt.
func CheckFault ¶
CheckFault checks that transaction persisted with FAULT state. Raised exception is also checked to contain s as a substring.
func CheckHalt ¶
func CheckHalt(t *testing.T, bc *core.Blockchain, h util.Uint256, stack ...stackitem.Item) *state.AppExecResult
CheckHalt checks that transaction persisted with HALT state.
func CheckTestInvoke ¶
func CheckTestInvoke(t *testing.T, bc *core.Blockchain, tx *transaction.Transaction, expected interface{})
CheckTestInvoke executes transaction without persisting it's state and compares the result with the expected.
func DeployContract ¶
DeployContract compiles and deploys contract to bc. path should contain Go source files. data is an optional argument to `_deploy`.
func NewAccount ¶
NewAccount creates new account and transfers 100.0 GAS to it.
func NewChain ¶
func NewChain(t *testing.T) *core.Blockchain
NewChain creates new blockchain instance with a single validator and setups cleanup functions.
func PrepareInvoke ¶
func PrepareInvoke(t *testing.T, bc *core.Blockchain, signer interface{}, hash util.Uint160, method string, args ...interface{}) *transaction.Transaction
PrepareInvoke creates new invocation transaction. Signer can be either bool or *wallet.Account. In the first case `true` means sign by committee, `false` means sign by validators.
func TestInvoke ¶
func TestInvoke(bc *core.Blockchain, tx *transaction.Transaction) (*vm.VM, error)
TestInvoke creates a test VM with dummy block and executes transaction in it.