Open optout21 opened 1 month ago
Attention: Patch coverage is 93.87755%
with 27 lines
in your changes missing coverage. Please review.
Project coverage is 89.64%. Comparing base (
66fb520
) to head (7da1b51
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
CI: A few misses in iterative-mutants on the Bolt11InvoiceFeatures
serialization method (unchanged). To see if checks can be added, or the method can be rewritten in a simpler form.
CI: All builds OK. Iterative mutants is satisfied now, but the build was interrupted (?) after the tests (verified the logs + locally).
Added a minor cleanup: hash_from_parts
is called from a single place (from signable_hash()
; in the other place in the SignedRawBolt11Invoice
parser, it's called through signable_hash()
), this way one version is sufficient.
A note regarding bech32->bytes conversion with padding:
This is needed currently when computing hash of an invoice (hash_from_parts
), and, if we want to switch for Features using bech32 library (as mentioned in a review comments above), also in the Features decoding.
I've raised an issue to rust-bech32
, to possible offer an option for bech32->bytes conversion where last bits are not dropped but padded, that would be the nice solution.
I also realized padding can be done in an iterator adapter (counts the elements and and the end optionally outputs padding), so this padding can be applied nicely in the chained iterators approach (as discusses above).
Awaiting (re)review, @TheBlueMatt . Thx.
Commits squashed
We should get a second reviewer on this.
Continuation of #3244 . Fixes #3176 .
Changes summary:
bech32
dependency to0.11.0
(from0.9
)bech32::u5
can be replaced bybech32::Fe32
, mostly as a drop-in replacement.u5::try_from_u8
is nowFe32::try_from
bech32::Error
is mostly replaced bybech32::primitives::decode::CheckedHrpstringError
ToBase32
(andBase32Len
) traits are discontinued inbech32
, they have been reimplemented in iterative style asBase32Iterable
. The implementations (Bolt11InvoiceFeatures/Payment*/...) have been moved tolightning-invoice
crate (as the trait is defined there)FromBase32
trait is discontinued inbech32
, it has been taken over tolighning-invoice
crate. The implementations have been moved tolightning-invoice
crate (as the trait is defined there)Here are some minor issues identified
Fe32
does not haveOrd
, so it had to be explicitly implemented forRawTaggedField
Fe32
does not haveDefault
, for which some workaround was needed. This will be added in nextbech32 0.12
release (see https://github.com/rust-bitcoin/rust-bech32/pull/186)bech32
error types are not always optimalbech32
crate)TODO:
fuzz
target