-
Notifications
You must be signed in to change notification settings - Fork 400
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
Add BOLT12 support to bLIP-51 / LSPS1 #3649
Add BOLT12 support to bLIP-51 / LSPS1 #3649
Conversation
👋 Thanks for assigning @arik-so as a reviewer! |
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
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 imagine there's a part 2 to this where the messages get used somehow?
7674b73
to
8505474
Compare
Yes, we'll just add support for it when we finally add LSPS1 service side. On the client side we simply expose I now realized I missed adding the actual > git diff-tree -U2 7674b739d 3274dbf5a
diff --git a/lightning-liquidity/src/lsps1/msgs.rs b/lightning-liquidity/src/lsps1/msgs.rs
index 7a4366ff7..0d9a6cec2 100644
--- a/lightning-liquidity/src/lsps1/msgs.rs
+++ b/lightning-liquidity/src/lsps1/msgs.rs
@@ -153,4 +153,6 @@ pub struct LSPS1PaymentInfo {
/// A Lightning payment using BOLT 11.
pub bolt11: Option<LSPS1Bolt11PaymentInfo>,
+ /// A Lightning payment using BOLT 12.
+ pub bolt12: Option<LSPS1Bolt12PaymentInfo>,
/// An onchain payment.
pub onchain: Option<LSPS1OnchainPaymentInfo>,
@@ -452,5 +454,8 @@ mod tests {
}
}"#;
- let _payment: LSPS1PaymentInfo = serde_json::from_str(json_str).unwrap();
+ let payment: LSPS1PaymentInfo = serde_json::from_str(json_str).unwrap();
+ assert!(payment.bolt11.is_some());
+ assert!(payment.bolt12.is_some());
+ assert!(payment.onchain.is_some());
let json_str = r#"{
@@ -493,6 +498,9 @@ mod tests {
"channel": null
}"#;
- let _create_order_response: LSPS1CreateOrderResponse =
+ let create_order_response: LSPS1CreateOrderResponse =
serde_json::from_str(json_str).unwrap();
+ assert!(create_order_response.payment.bolt11.is_some());
+ assert!(create_order_response.payment.bolt12.is_some());
+ assert!(create_order_response.payment.onchain.is_some());
let json_str = r#"{
|
Previously, bLIP-51 / LSPS1 only supported BOLT11 and onchain payment options. Here we add the necessary fields to allow to pay the LSP via BOLT12 offers.
8505474
to
3274dbf
Compare
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.
thanks for the bolt12 field check addition!
Sure! Going to land this, as ~trivial and the diff to previously-ACKed version is minimal. |
Previously, bLIP-51 / LSPS1 only supported BOLT11 and onchain payment options. Here we add the necessary fields to allow to pay the LSP via BOLT12 offers.