multi: add fuzzer to make

This commit is contained in:
Oliver Gugger 2022-08-03 19:56:43 +02:00
parent 986d889b74
commit 1c9de5652e
No known key found for this signature in database
GPG key ID: 8E4256593F177720
3 changed files with 28 additions and 0 deletions

View file

@ -89,3 +89,25 @@ func TestIncrementBatchKey(t *testing.T) {
require.Equal(t, startBatchKey, currentKey)
}
// FuzzWitnessSpendDetection fuzz tests the witness spend detection functions.
func FuzzWitnessSpendDetection(f *testing.F) {
f.Fuzz(func(t *testing.T, a, b, c, d []byte, num uint8) {
witness := make([][]byte, num)
if num > 0 {
witness[0] = a
}
if num > 1 {
witness[1] = b
}
if num > 2 {
witness[2] = c
}
if num > 3 {
witness[3] = d
}
_ = IsMultiSigSpend(witness)
_ = IsExpirySpend(witness)
})
}