mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
With go 1.17 a change to the build flags was implemented: https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md The formatter now automatically adds the forward-compatible build tag format and the linter checks for them, so we need to include them in our code.
23 lines
465 B
Go
23 lines
465 B
Go
//go:build gofuzz
|
|
// +build gofuzz
|
|
|
|
package zpay32fuzz
|
|
|
|
import (
|
|
"github.com/btcsuite/btcd/chaincfg"
|
|
"github.com/lightningnetwork/lnd/zpay32"
|
|
)
|
|
|
|
// Fuzz_decode is used by go-fuzz.
|
|
func Fuzz_decode(data []byte) int {
|
|
inv, err := zpay32.Decode(string(data), &chaincfg.TestNet3Params)
|
|
if err != nil {
|
|
return 1
|
|
}
|
|
|
|
// Call these functions as a sanity check to make sure the invoice
|
|
// is well-formed.
|
|
_ = inv.MinFinalCLTVExpiry()
|
|
_ = inv.Expiry()
|
|
return 1
|
|
}
|