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 {
1184
1184
pub preimage : PaymentPreimage ,
1185
1185
}
1186
1186
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
-
1194
1187
#[ cfg( test) ]
1195
1188
mod tests {
1196
1189
use std:: {
Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ type Bolt11InvoiceDescription = LdkBolt11InvoiceDescription;
50
50
type Bolt11InvoiceDescription = crate :: ffi:: Bolt11InvoiceDescription ;
51
51
52
52
#[ cfg( not( feature = "uniffi" ) ) ]
53
- type JitChannelManualClaim = ( Bolt11Invoice , PaymentPreimage ) ;
53
+ pub struct JitChannelManualClaim {
54
+ pub invoice : Bolt11Invoice ,
55
+ pub preimage : PaymentPreimage ,
56
+ }
54
57
#[ cfg( feature = "uniffi" ) ]
55
58
type JitChannelManualClaim = crate :: ffi:: JitChannelManualClaim ;
56
59
@@ -619,7 +622,8 @@ impl Bolt11Payment {
619
622
false ,
620
623
) ?;
621
624
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 } )
623
627
}
624
628
625
629
/// 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() {
1780
1780
let jit_amount_msat = 100_000_000 ;
1781
1781
1782
1782
println ! ( "Generating JIT invoice!" ) ;
1783
- let ( jit_invoice , preimage ) = client_node
1783
+ let res = client_node
1784
1784
. bolt11_payment ( )
1785
1785
. receive_via_jit_channel_manual_claim (
1786
1786
jit_amount_msat,
@@ -1789,6 +1789,8 @@ fn lsps2_client_trusts_lsp() {
1789
1789
None ,
1790
1790
)
1791
1791
. unwrap ( ) ;
1792
+ let jit_invoice = res. invoice ;
1793
+ let preimage = res. preimage ;
1792
1794
1793
1795
// Have the payer_node pay the invoice, therby triggering channel open service_node -> client_node.
1794
1796
println ! ( "Paying JIT invoice!" ) ;
@@ -1921,7 +1923,7 @@ fn lsps2_lsp_trusts_client_but_client_does_not_claim() {
1921
1923
let jit_amount_msat = 100_000_000 ;
1922
1924
1923
1925
println ! ( "Generating JIT invoice!" ) ;
1924
- let ( jit_invoice , _ ) = client_node
1926
+ let res = client_node
1925
1927
. bolt11_payment ( )
1926
1928
. receive_via_jit_channel_manual_claim (
1927
1929
jit_amount_msat,
@@ -1930,6 +1932,7 @@ fn lsps2_lsp_trusts_client_but_client_does_not_claim() {
1930
1932
None ,
1931
1933
)
1932
1934
. unwrap ( ) ;
1935
+ let jit_invoice = res. invoice ;
1933
1936
1934
1937
// Have the payer_node pay the invoice, therby triggering channel open service_node -> client_node.
1935
1938
println ! ( "Paying JIT invoice!" ) ;
You can’t perform that action at this time.
0 commit comments