From 335550fb1ef5d81f5a0f21308886fbf240814ce5 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 18 Mar 2024 18:03:58 +0300 Subject: [PATCH] rpcsrv: generate randome nonce for RPC server test transactions Avoid mempool conflicts in tests. Signed-off-by: Anna Shaleva --- pkg/services/rpcsrv/server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/rpcsrv/server_test.go b/pkg/services/rpcsrv/server_test.go index c0b0fe151..81625cab3 100644 --- a/pkg/services/rpcsrv/server_test.go +++ b/pkg/services/rpcsrv/server_test.go @@ -3380,7 +3380,7 @@ func newTxWithParams(t *testing.T, chain *core.Blockchain, code opcode.Opcode, v height := chain.BlockHeight() tx := transaction.New([]byte{byte(code)}, 0) - tx.Nonce = height + 1 + tx.Nonce = uint32(random.Int(0, math.MaxUint32)) tx.ValidUntilBlock = height + validUntilIncr tx.Signers = []transaction.Signer{{Account: acc0.PrivateKey().GetScriptHash()}} tx.SystemFee = systemFee