diff --git a/pkg/neotest/account.go b/pkg/neotest/account.go index 00c95a7a0..d03db8d33 100644 --- a/pkg/neotest/account.go +++ b/pkg/neotest/account.go @@ -2,7 +2,8 @@ package neotest var _nonce uint32 -func nonce() uint32 { +// Nonce returns unique number that can be used as nonce for new transactions. +func Nonce() uint32 { _nonce++ return _nonce } diff --git a/pkg/neotest/basic.go b/pkg/neotest/basic.go index 67c0ac87b..a572fab53 100644 --- a/pkg/neotest/basic.go +++ b/pkg/neotest/basic.go @@ -69,7 +69,7 @@ func (e *Executor) NewUnsignedTx(t *testing.T, hash util.Uint160, method string, script := w.Bytes() tx := transaction.New(script, 0) - tx.Nonce = nonce() + tx.Nonce = Nonce() tx.ValidUntilBlock = e.Chain.BlockHeight() + 1 return tx } @@ -157,7 +157,7 @@ func (e *Executor) NewDeployTx(t *testing.T, bc blockchainer.Blockchainer, c *Co require.NoError(t, buf.Err) tx := transaction.New(buf.Bytes(), 100*native.GASFactor) - tx.Nonce = nonce() + tx.Nonce = Nonce() tx.ValidUntilBlock = bc.BlockHeight() + 1 tx.Signers = []transaction.Signer{{ Account: e.Committee.ScriptHash(),