mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-13 12:33:04 +02:00
multi: add fuzzer to make
This commit is contained in:
parent
986d889b74
commit
1c9de5652e
3 changed files with 28 additions and 0 deletions
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue