Commit Graph

8 Commits

Author SHA1 Message Date
Matt Morehouse
9200abf96e
zpay32: allow fuzzer to choose invoice net
We add a parameter to select which network will be used for the fuzz
tests, rather than hardcoding the network.
2023-07-19 09:04:26 -05:00
Matt Morehouse
bd7ec84497
zpay32: help fuzzer generate valid encodings
It is very difficult for the fuzzer to create a valid checksum for each
serialized invoice, and we were therefore unable to fuzz deeper than
invoice decoding. We can help the fuzzer generate valid serialized
invoices by calculating and appending the checksum ourselves.

We also switch to using mainnet invoices to make it easier to find valid
invoices for seeding the fuzzer. We prepend the required "lnbc" prefix
ourselves to further help the fuzzer generate valid invoices.
2023-07-19 09:04:18 -05:00
Matt Morehouse
82753f091b
zpay32: use message signer from unit tests
The message signer from invoice_test.go is identical to the one created
in the fuzz test. We're already using the private key from
invoice_test.go, so we may as well use the complete message signer for
simplicity.
2023-07-19 09:04:13 -05:00
Matt Morehouse
4207be6e50
zpay32: remove unused method calls
The fuzz tests call inv.MinFinalCLTVExpiry() and inv.Expiry() supposedly
to ensure the invoice is well-formed. However, those methods can never
panic or return errors and therefore provide no benefit for this
purpose.
2023-07-19 09:04:03 -05:00
yyforyongyu
84fd911b47
multi: fix make lint
Fixes new lint errors caught by the latest version.
2022-11-18 20:48:23 +08:00
Matt Morehouse
e15d3e898e
brontide,lnwire,wtwire,zpay32: appease linter
Address all linter complaints for the newly migrated fuzz tests.
2022-11-11 08:44:30 -06:00
Matt Morehouse
5a48568806
brontide,lnwire,wtwire,zpay32: use CamelCase
Rename fuzz test functions to use CamelCase.
2022-11-11 08:44:24 -06:00
Conner
782f973298
zpay32: migrate fuzz tests 2022-11-11 08:44:12 -06:00