From 7947721ce4b3016969ceb1f20934a99989be74e1 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Fri, 30 Jul 2021 16:31:45 +0700 Subject: [PATCH] fix queues --- txpool/pool_fuzz_test.go | 21 +++++++++++++++++++++ txpool/pool_test.go | 1 + 2 files changed, 22 insertions(+) diff --git a/txpool/pool_fuzz_test.go b/txpool/pool_fuzz_test.go index 4d28d489d..f06df101a 100644 --- a/txpool/pool_fuzz_test.go +++ b/txpool/pool_fuzz_test.go @@ -23,6 +23,11 @@ func FuzzTwoQueue(f *testing.F) { f.Add([]uint8{0b10101, 0b11110, 0b11101, 0b10001}) f.Fuzz(func(t *testing.T, in []uint8) { t.Parallel() + for i := range in { + if in[i] > 0b11111 { + t.Skip() + } + } assert := assert.New(t) { sub := NewSubPool() @@ -80,6 +85,22 @@ func FuzzPromoteStep(f *testing.F) { f.Add([]uint8{0b11000, 0b00101, 0b000111}, []uint8{0b11000, 0b00101, 0b000111}, []uint8{0b11000, 0b00101, 0b000111}) f.Fuzz(func(t *testing.T, s1, s2, s3 []uint8) { t.Parallel() + for i := range s1 { + if s1[i] > 0b11111 { + t.Skip() + } + } + for i := range s2 { + if s2[i] > 0b11111 { + t.Skip() + } + } + for i := range s3 { + if s3[i] > 0b11111 { + t.Skip() + } + } + pending, baseFee, queued := NewSubPool(), NewSubPool(), NewSubPool() for _, i := range s1 { pending.Add(&MetaTx{SubPool: SubPoolMarker(i & 0b11111)}) diff --git a/txpool/pool_test.go b/txpool/pool_test.go index a50c1a5b1..c3fadca8b 100644 --- a/txpool/pool_test.go +++ b/txpool/pool_test.go @@ -103,6 +103,7 @@ func TestSubPoolsPromote(t *testing.T) { // if limit reached, worst must be greater than X } +//nolint func hexToSubPool(s string) []uint8 { a, err := hex.DecodeString(s) if err != nil {