File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -1184,13 +1184,6 @@ pub struct JitChannelManualClaim {
11841184 pub preimage : PaymentPreimage ,
11851185}
11861186
1187- impl From < ( Arc < Bolt11Invoice > , PaymentPreimage ) > for JitChannelManualClaim {
1188- fn from ( value : ( Arc < Bolt11Invoice > , PaymentPreimage ) ) -> Self {
1189- let ( invoice, preimage) = value;
1190- JitChannelManualClaim { invoice, preimage }
1191- }
1192- }
1193-
11941187#[ cfg( test) ]
11951188mod tests {
11961189 use std:: {
Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ type Bolt11InvoiceDescription = LdkBolt11InvoiceDescription;
5050type Bolt11InvoiceDescription = crate :: ffi:: Bolt11InvoiceDescription ;
5151
5252#[ cfg( not( feature = "uniffi" ) ) ]
53- type JitChannelManualClaim = ( Bolt11Invoice , PaymentPreimage ) ;
53+ pub struct JitChannelManualClaim {
54+ pub invoice : Bolt11Invoice ,
55+ pub preimage : PaymentPreimage ,
56+ }
5457#[ cfg( feature = "uniffi" ) ]
5558type JitChannelManualClaim = crate :: ffi:: JitChannelManualClaim ;
5659
@@ -619,7 +622,8 @@ impl Bolt11Payment {
619622 false ,
620623 ) ?;
621624 let preimage = preimage. ok_or ( Error :: InvoiceCreationFailed ) ?;
622- Ok ( ( maybe_wrap ( invoice) , preimage) . into ( ) )
625+ let invoice = maybe_wrap ( invoice) ;
626+ Ok ( JitChannelManualClaim { invoice, preimage } )
623627 }
624628
625629 /// Returns a payable invoice that can be used to request a variable amount payment (also known
Original file line number Diff line number Diff line change @@ -1780,7 +1780,7 @@ fn lsps2_client_trusts_lsp() {
17801780 let jit_amount_msat = 100_000_000 ;
17811781
17821782 println ! ( "Generating JIT invoice!" ) ;
1783- let ( jit_invoice , preimage ) = client_node
1783+ let res = client_node
17841784 . bolt11_payment ( )
17851785 . receive_via_jit_channel_manual_claim (
17861786 jit_amount_msat,
@@ -1789,6 +1789,8 @@ fn lsps2_client_trusts_lsp() {
17891789 None ,
17901790 )
17911791 . unwrap ( ) ;
1792+ let jit_invoice = res. invoice ;
1793+ let preimage = res. preimage ;
17921794
17931795 // Have the payer_node pay the invoice, therby triggering channel open service_node -> client_node.
17941796 println ! ( "Paying JIT invoice!" ) ;
@@ -1921,7 +1923,7 @@ fn lsps2_lsp_trusts_client_but_client_does_not_claim() {
19211923 let jit_amount_msat = 100_000_000 ;
19221924
19231925 println ! ( "Generating JIT invoice!" ) ;
1924- let ( jit_invoice , _ ) = client_node
1926+ let res = client_node
19251927 . bolt11_payment ( )
19261928 . receive_via_jit_channel_manual_claim (
19271929 jit_amount_msat,
@@ -1930,6 +1932,7 @@ fn lsps2_lsp_trusts_client_but_client_does_not_claim() {
19301932 None ,
19311933 )
19321934 . unwrap ( ) ;
1935+ let jit_invoice = res. invoice ;
19331936
19341937 // Have the payer_node pay the invoice, therby triggering channel open service_node -> client_node.
19351938 println ! ( "Paying JIT invoice!" ) ;
You can’t perform that action at this time.
0 commit comments