mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-26 03:01:42 +00:00
rpc: fix tests to count mempool; copy responses to avoid data races
This commit is contained in:
@ -134,10 +134,11 @@ func TestHTTPBroadcastTx(t *testing.T) {
|
||||
}
|
||||
pool := node.MempoolReactor().Mempool
|
||||
txs := pool.GetProposalTxs()
|
||||
if len(txs) != 1 {
|
||||
t.Fatal("The mem pool has %d txs. Expected 1", len(txs))
|
||||
if len(txs) != mempoolCount+1 {
|
||||
t.Fatalf("The mem pool has %d txs. Expected %d", len(txs), mempoolCount+1)
|
||||
}
|
||||
tx2 := txs[0].(*types.SendTx)
|
||||
tx2 := txs[mempoolCount].(*types.SendTx)
|
||||
mempoolCount += 1
|
||||
if bytes.Compare(merkle.HashFromBinary(tx), merkle.HashFromBinary(tx2)) != 0 {
|
||||
t.Fatal("inconsistent hashes for mempool tx and sent tx")
|
||||
}
|
||||
|
Reference in New Issue
Block a user