-
Notifications
You must be signed in to change notification settings - Fork 403
Move BlindedPayInfo
into BlindedPaymentPath
#3245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move BlindedPayInfo
into BlindedPaymentPath
#3245
Conversation
143e794
to
402682e
Compare
402682e
to
f9bc326
Compare
@@ -772,7 +775,7 @@ impl Writeable for PaymentParameters { | |||
(5, self.max_channel_saturation_power_of_half, required), | |||
(6, self.expiry_time, option), | |||
(7, self.previously_failed_channels, required_vec), | |||
(8, *blinded_hints, optional_vec), | |||
(8, blinded_hints, option), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think previously we were writing a length prefix for this, actually... Giving this a second look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, used to be just a count and then elements, now its a yes/no flag followed by a length and the elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, the current code is passing a round trip ser test actually. I don't think there's a yes/no flag written for option
s, and optional_vec
writes as WithoutLength
, IIUC, so it might be fine? Will expand the test to include multiple hints..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, I was confusing myself on the option
, but had missed its an IterableOnwed
which doesnt have a length unlike a vec.
f9bc326
to
305f03b
Compare
Rebased. |
305f03b
to
a052589
Compare
Sorry, one more rustfmt + fuzz fix to push. |
Also removes the implementation of Writeable for BlindedPaymentPath, to ensure callsites are explicit about what they're writing.
a052589
to
6522d60
Compare
6522d60
to
4ef83a0
Compare
And one more doc test :( diff --git a/lightning/src/offers/invoice.rs b/lightning/src/offers/invoice.rs
index d361c7ce4..40ee40090 100644
--- a/lightning/src/offers/invoice.rs
+++ b/lightning/src/offers/invoice.rs
@@ -29,8 +29,8 @@
//! use lightning::util::ser::Writeable;
//!
//! # use lightning::ln::types::PaymentHash;
-//! # use lightning::offers::invoice::{BlindedPayInfo, ExplicitSigningPubkey, InvoiceBuilder};
-//! # use lightning::blinded_path::payment::BlindedPaymentPath;
+//! # use lightning::offers::invoice::{ExplicitSigningPubkey, InvoiceBuilder};
+//! # use lightning::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath};
//! #
//! # fn create_payment_paths() -> Vec<BlindedPaymentPath> { unimplemented!() }
//! # fn create_payment_hash() -> PaymentHash { unimplemented!() } |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3245 +/- ##
==========================================
- Coverage 89.69% 89.69% -0.01%
==========================================
Files 125 125
Lines 102794 102801 +7
Branches 102794 102801 +7
==========================================
+ Hits 92206 92210 +4
- Misses 7869 7874 +5
+ Partials 2719 2717 -2 ☔ View full report in Codecov by Sentry. |
Rather than a BOLT 12 invoice's paths containing tuples of
(BlindedPayInfo, BlindedPaymentPath)
, move the payinfo into the path itself.