Skip to content

Commit

Permalink
improve edge-case coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Aug 29, 2024
1 parent c405d69 commit e9683d1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/signing_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,17 @@ func (s *SigningTestSuite) TestAggregateAndVerify() {

require.Error(t, wrongKeyAggregator.VerifyAggregate(mask, msg, aggSig), "wrong pubkey should error")
}

t.Run("mask out of range", func(t *testing.T) {
_, err = aggregator.Aggregate([]int{0, 3}, [][]byte{sigs[0]})
require.Error(t, err, "mask out of range")
})

t.Run("empty signature is always valid", func(t *testing.T) {
sig, err := aggregator.Aggregate([]int{}, [][]byte{})
require.NoError(t, err)

err = aggregator.VerifyAggregate([]int{}, []byte("anything"), sig)
require.NoError(t, err)
})
}

0 comments on commit e9683d1

Please sign in to comment.