From c43c51dac185a78f057eee68ec9c473cc03d1f72 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Thu, 18 Nov 2021 12:23:22 +0300 Subject: [PATCH] neotest: extend Executor with DeployContractCheckFAULT --- pkg/neotest/basic.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/neotest/basic.go b/pkg/neotest/basic.go index d1ed1c6e1..72d8f9cd0 100644 --- a/pkg/neotest/basic.go +++ b/pkg/neotest/basic.go @@ -135,6 +135,14 @@ func (e *Executor) DeployContract(t *testing.T, c *Contract, data interface{}) u return tx.Hash() } +// DeployContractCheckFAULT compiles and deploys contract to bc. It checks that deploy +// transaction FAULTed with the specified error. +func (e *Executor) DeployContractCheckFAULT(t *testing.T, c *Contract, data interface{}, errMessage string) { + tx := e.NewDeployTx(t, e.Chain, c, data) + e.AddNewBlock(t, tx) + e.CheckFault(t, tx.Hash(), errMessage) +} + // InvokeScript adds transaction with the specified script to the chain and // returns its hash. It does no faults check. func (e *Executor) InvokeScript(t *testing.T, script []byte, signers []Signer) util.Uint256 {