fix queues

This commit is contained in:
alex.sharov 2021-07-30 16:31:45 +07:00
parent 62b69505fa
commit 7947721ce4
2 changed files with 22 additions and 0 deletions

View File

@ -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)})

View File

@ -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 {