mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 19:41:19 +00:00
packet test
This commit is contained in:
parent
d177a32930
commit
20040b6d18
@ -175,7 +175,13 @@ func FuzzOnNewBlocks3(f *testing.F) {
|
|||||||
}
|
}
|
||||||
byHash := map[string]*MetaTx{}
|
byHash := map[string]*MetaTx{}
|
||||||
pending, baseFee, queued := NewSubPool(), NewSubPool(), NewSubPool()
|
pending, baseFee, queued := NewSubPool(), NewSubPool(), NewSubPool()
|
||||||
onNewBlock(senders, txs, nil, protocolBaseFee, blockBaseFee, pending, baseFee, queued, byHash)
|
unwindTxs := txs
|
||||||
|
var minedTxs []*TxSlot
|
||||||
|
if len(txs) > 3 {
|
||||||
|
unwindTxs = txs[:len(txs)-3]
|
||||||
|
minedTxs = txs[len(txs)-3:]
|
||||||
|
}
|
||||||
|
onNewBlock(senders, unwindTxs, minedTxs, protocolBaseFee, blockBaseFee, pending, baseFee, queued, byHash)
|
||||||
|
|
||||||
best, worst := pending.Best(), pending.Worst()
|
best, worst := pending.Best(), pending.Worst()
|
||||||
assert.LessOrEqual(pending.Len(), PendingSubPoolLimit)
|
assert.LessOrEqual(pending.Len(), PendingSubPoolLimit)
|
||||||
@ -276,6 +282,11 @@ func FuzzOnNewBlocks3(f *testing.F) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mined txs must be removed
|
||||||
|
for i := range minedTxs {
|
||||||
|
_, ok = byHash[string(minedTxs[i].idHash[:])]
|
||||||
|
assert.False(ok)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user