rpcsrv: generate randome nonce for RPC server test transactions

Avoid mempool conflicts in tests.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-03-18 18:03:58 +03:00
parent bfc3aa6b67
commit 335550fb1e

View file

@ -3380,7 +3380,7 @@ func newTxWithParams(t *testing.T, chain *core.Blockchain, code opcode.Opcode, v
height := chain.BlockHeight() height := chain.BlockHeight()
tx := transaction.New([]byte{byte(code)}, 0) tx := transaction.New([]byte{byte(code)}, 0)
tx.Nonce = height + 1 tx.Nonce = uint32(random.Int(0, math.MaxUint32))
tx.ValidUntilBlock = height + validUntilIncr tx.ValidUntilBlock = height + validUntilIncr
tx.Signers = []transaction.Signer{{Account: acc0.PrivateKey().GetScriptHash()}} tx.Signers = []transaction.Signer{{Account: acc0.PrivateKey().GetScriptHash()}}
tx.SystemFee = systemFee tx.SystemFee = systemFee