mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
fuzz example
This commit is contained in:
parent
053b99e716
commit
99083578db
@ -13,6 +13,8 @@ import (
|
|||||||
//gotip doc testing.F.Add
|
//gotip doc testing.F.Add
|
||||||
//gotip doc testing.F.Fuzz
|
//gotip doc testing.F.Fuzz
|
||||||
|
|
||||||
|
// gotip test -trimpath -v -fuzz=Fuzz -fuzztime=10s ./txpool
|
||||||
|
|
||||||
func FuzzPromoteStep(f *testing.F) {
|
func FuzzPromoteStep(f *testing.F) {
|
||||||
f.Add([]uint8{0b11111, 0b10001, 0b10101, 0b00001, 0b00000}, []uint8{0b11111, 0b10001, 0b10101, 0b00001, 0b00000}, []uint8{0b11111, 0b10001, 0b10101, 0b00001, 0b00000})
|
f.Add([]uint8{0b11111, 0b10001, 0b10101, 0b00001, 0b00000}, []uint8{0b11111, 0b10001, 0b10101, 0b00001, 0b00000}, []uint8{0b11111, 0b10001, 0b10101, 0b00001, 0b00000})
|
||||||
f.Fuzz(func(t *testing.T, s1, s2, s3 []uint8) {
|
f.Fuzz(func(t *testing.T, s1, s2, s3 []uint8) {
|
||||||
@ -34,8 +36,12 @@ func FuzzPromoteStep(f *testing.F) {
|
|||||||
}
|
}
|
||||||
PromoteStep(pending, baseFee, queue)
|
PromoteStep(pending, baseFee, queue)
|
||||||
|
|
||||||
if pending.Best() != nil && pending.Best().SubPool < 0b11110 {
|
best, worst := pending.Best(), pending.Worst()
|
||||||
t.Fatalf("Pending best too small %b", pending.Best().SubPool)
|
if best != nil && best.SubPool < 0b11110 {
|
||||||
|
t.Fatalf("Pending best too small %b", best.SubPool)
|
||||||
|
}
|
||||||
|
if worst != nil && worst.SubPool < 0b11000 {
|
||||||
|
t.Fatalf("Pending worst too big %b", worst.SubPool)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user