From a2a7db3bd8807079a1784cef32e0e2abcd0bd8c2 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Sat, 31 Jul 2021 12:43:29 +0700 Subject: [PATCH] basic forward/unwind funcs --- txpool/pool_fuzz_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/txpool/pool_fuzz_test.go b/txpool/pool_fuzz_test.go index 8e406208f..bd9951b7d 100644 --- a/txpool/pool_fuzz_test.go +++ b/txpool/pool_fuzz_test.go @@ -112,19 +112,22 @@ func FuzzPromoteStep2(f *testing.F) { var ss [20]byte for _, s := range s1 { copy(ss[:], sender[(iSenders*20)%len(sender):]) - pending.Add(&MetaTx{SubPool: SubPoolMarker(s & 0b11111), Tx: &TxSlot{nonce: binary.BigEndian.Uint64(nonce[(iNonce*8)%len(nonce):]), sender: ss}}) + mt := &MetaTx{SubPool: SubPoolMarker(s & 0b11111), Tx: &TxSlot{nonce: binary.BigEndian.Uint64(nonce[(iNonce*8)%len(nonce):]), sender: ss}} + pending.Add(mt, PendingSubPool) iNonce++ iSenders++ } for _, s := range s2 { copy(ss[:], sender[(iSenders*20)%len(sender):]) - baseFee.Add(&MetaTx{SubPool: SubPoolMarker(s & 0b11111), Tx: &TxSlot{nonce: binary.BigEndian.Uint64(nonce[(iNonce*8)%len(nonce):]), sender: ss}}) + mt := &MetaTx{SubPool: SubPoolMarker(s & 0b11111), Tx: &TxSlot{nonce: binary.BigEndian.Uint64(nonce[(iNonce*8)%len(nonce):]), sender: ss}} + baseFee.Add(mt, BaseFeeSubPool) iNonce++ iSenders++ } - for _, i := range s3 { + for _, s := range s3 { copy(ss[:], sender[(iSenders*20)%len(sender):]) - queued.Add(&MetaTx{SubPool: SubPoolMarker(i & 0b11111), Tx: &TxSlot{nonce: binary.BigEndian.Uint64(nonce[(iNonce*8)%len(nonce):]), sender: ss}}) + mt := &MetaTx{SubPool: SubPoolMarker(s & 0b11111), Tx: &TxSlot{nonce: binary.BigEndian.Uint64(nonce[(iNonce*8)%len(nonce):]), sender: ss}} + queued.Add(mt, QueuedSubPool) iNonce++ iSenders++ }