Uh oh!
There was an error while loading. Please reload this page.
Invoice features - #876
Conversation
bb13620 to
a4a44fdCompareCodecov Report
@@ Coverage Diff @@## main #876 +/- ##
==========================================
+ Coverage 90.26% 90.77% +0.51%
==========================================
Files 57 57 Lines 29226 30371 +1145 ==========================================
+ Hits 26380 27570 +1190 + Misses 2846 2801 -45
Continue to review full report at Codecov.
|
a4a44fd to
8333b33CompareUh oh!
There was an error while loading. Please reload this page.
| } | ||
| /// Calculates the base32 encoded size of a byte slice | ||
| fn bytes_size_to_base32_size(byte_size: usize) -> usize { |
There was a problem hiding this comment.
Can we use the provided implementation for [u8] instead of copying this function https://docs.rs/bech32/0.8.0/bech32/trait.Base32Len.html#impl-Base32Len
There was a problem hiding this comment.
That didn't work sadly... Neither did the original copied&pasted function. I did something super inefficient 😬 still need to think through a better way
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
923fce5 to
001c996CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
001c996 to
a9a1442CompareUh oh!
There was an error while loading. Please reload this page.
| } | ||
| impl ToBase32 for InvoiceFeatures { | ||
| fn write_base32<W: WriteBase32>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> { |
There was a problem hiding this comment.
Could you add some tests for these conversions?
There was a problem hiding this comment.
There is test_payment_secret_and_features_de_and_ser which uses those methods, and invoice fuzzing. Added more unit tests though.
1fb1cd6 to
e1e5918CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
e1e5918 to
0eeaedfCompareUseful for constructing features objects from raw feature bytes.
0eeaedf to
f281dddCompare
TheBlueMatt
left a comment
There was a problem hiding this comment.
Looks good, trivial comments and one doc comment.
| #[cfg(test)] | ||
| /// Create a Features given a set of flags, in LE. | ||
| /// Create a Features given a set of flags, in little-endian. This is in reverse bit order from |
There was a problem hiding this comment.
byte order, not bit order. We don't reverse the bits :).
There was a problem hiding this comment.
Maybe dumb q, but the bits are literally in reverse order from what they were, right? Rephrased tho :)
There was a problem hiding this comment.
I don't believe so? The highest bit in the last position is ultimately the highest bit - not the lowest bit in the last position (which would be true if we swapped the bits as well).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f281ddd to
9e82f39CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
9e82f39 to
b24d02cCompareTheBlueMatt
commented
Apr 26, 2021
Test locally, CI is just hella broken right now. See #895. |
Tested w/ sample