Skip to content

What's the intended behavior of filterContained ? #12727

Answered by potuz
mitmotw asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for spotting this, this code from early 2020 seems wrong to me as well, here's a test that fails with your parameters

func TestFilterContained(t *testing.T) {
        sign := bls.NewAggregateSignature().Marshal()
        al := attList{
                {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00111100, 0b1}, Signature: sign},
                {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000011, 0b1}, Signature: sign},
                {AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign},
        }
        filtered, err := al.filterContained()
        require.NoError(t, err)…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mitmotw
Comment options

Answer selected by mitmotw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants