Upgrade bech32 dependency#3181
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3181 +/- ##
==========================================
+ Coverage 89.80% 91.01% +1.20%
==========================================
Files 121 121
Lines 100045 110610 +10565
Branches 100045 110610 +10565
==========================================
+ Hits 89845 100668 +10823
+ Misses 7533 7422 -111
+ Partials 2667 2520 -147 ☔ View full report in Codecov by Sentry. |
|
Awesome, thanks for working on this. Will let @arik-so work with you here since he was also looking into this. |
be6be6e to
ce671f6
Compare
|
Ready for review. |
|
|
||
| assert_eq!( | ||
| PrivateRoute::from_base32(&[u5::try_from_u8(0).unwrap(); 40][..]), | ||
| PrivateRoute::from_base32(&[Fe32::try_from(0).unwrap(); 40][..]), |
There was a problem hiding this comment.
now that we have this InvoiceData wrapper around a [Fe32], do you figure it's worth also creating one for an individual value? Using finite field value constructors seems like it might have separation of concerns potential, but it's not that much different from what we'd been doing prior, just more explicit.
There was a problem hiding this comment.
Yeah, it's possible to have an own type (I would keep the u5 name), and only reuse the char conversion logic from the external bech32 crate. But event that is rather small logic, could be completely taken over.
|
I concluded at least for the |
|
Sounds good! |
|
This PR is now replaced by #3201, where there is some own implementation (for |
Update: Obsoleted by #3244 ( #3201 ) .
Fixes #3176 .
Changes summary:
bech32dependency to0.11.0lightningandlightning-invoicebech32::u5has been discontinued, butbech32::Fe32can be mostly used as a replacement (except eg.Ord).bech32::Erroris mostly replaced bybech32::primitives::decode::CheckedHrpstringErrorHere are some minor issues identified
Fe32does not haveDefaultandOrd, for which some workaround is needed (see Add Default trait to Fe32 rust-bitcoin/rust-bech32#187 Add Ord trait to Fe32 (derived) rust-bitcoin/rust-bech32#186)Fe32is used in many places (e.g. as parameter), which is not very optimal, as it is an external type. TheInvoiceDatawrapper type was created to mitigate this to some extent.bech32error types are not always optimalbech32crate)TODO:
0.10to0.11(should be smoother)fuzztarget