@@ -523,7 +523,7 @@ public class HumanObjectPeerTestInstance {
523
523
let config = UserConfig . initWithDefault ( )
524
524
let theirNodeId = peerB. channelManager. getOurNodeId ( )
525
525
let userChannelId : [ UInt8 ] = [ UInt8] ( repeating: 42 , count: 16 ) ;
526
- let channelOpenResult = peerA. channelManager. createChannel ( theirNetworkKey: theirNodeId, channelValueSatoshis: fundingAmount, pushMsat: 1000 , userChannelId: userChannelId, overrideConfig: config)
526
+ let channelOpenResult = peerA. channelManager. createChannel ( theirNetworkKey: theirNodeId, channelValueSatoshis: fundingAmount, pushMsat: 1000 , userChannelId: userChannelId, temporaryChannelId : nil , overrideConfig: config)
527
527
528
528
XCTAssertTrue ( channelOpenResult. isOk ( ) )
529
529
let channels = peerA. channelManager. listChannels ( )
@@ -757,7 +757,13 @@ public class HumanObjectPeerTestInstance {
757
757
}
758
758
759
759
let channelManagerConstructor = peer1. constructor!
760
- let invoicePaymentResult = Bindings . payInvoice ( invoice: invoice, retryStrategy: Bindings . Retry. initWithAttempts ( a: 3 ) , channelmanager: channelManagerConstructor. channelManager)
760
+
761
+ let ( paymentHash, recipientOnion, routeParameters) = Bindings . paymentParametersFromInvoice ( invoice: invoice) . getValue ( ) !
762
+ let paymentId = invoice. paymentHash ( ) !
763
+
764
+
765
+ let invoicePaymentResult = channelManagerConstructor. channelManager. sendPayment ( paymentHash: paymentHash, recipientOnion: recipientOnion, paymentId: paymentId, routeParams: routeParameters, retryStrategy: Bindings . Retry. initWithAttempts ( a: 3 ) )
766
+ // let invoicePaymentResult = Bindings.payInvoice(invoice: invoice, retryStrategy: Bindings.Retry.initWithAttempts(a: 3), channelmanager: channelManagerConstructor.channelManager)
761
767
XCTAssertTrue ( invoicePaymentResult. isOk ( ) )
762
768
763
769
do {
@@ -853,7 +859,9 @@ public class HumanObjectPeerTestInstance {
853
859
try ! await Task . sleep ( nanoseconds: 0_100_000_000 )
854
860
}
855
861
856
- let invoicePayment = invoicePaymentResult. getValue ( ) !
862
+
863
+ // let invoicePayment = invoicePaymentResult.getValue()!
864
+ XCTAssert ( invoicePaymentResult. isOk ( ) )
857
865
XCTAssertEqual ( currentChannelABalance, secondChannelBalanceAToB - SEND_MSAT_AMOUNT_A_TO_B)
858
866
XCTAssertEqual ( currentChannelBBalance, secondChannelBalanceBToA + SEND_MSAT_AMOUNT_A_TO_B)
859
867
}
@@ -874,12 +882,12 @@ public class HumanObjectPeerTestInstance {
874
882
let recreatedInvoice = Bolt11Invoice . fromStr ( s: invoiceString)
875
883
XCTAssertTrue ( recreatedInvoice. isOk ( ) )
876
884
877
- let invoicePaymentResult = Bindings . payZeroValueInvoice ( invoice: invoice, amountMsats: SEND_MSAT_AMOUNT_B_TO_A, retryStrategy: Retry . initWithAttempts ( a: 3 ) , channelmanager: peer2. channelManager)
885
+
886
+ let ( paymentHash, recipientOnion, routeParameters) = Bindings . paymentParametersFromZeroAmountInvoice ( invoice: invoice, amountMsat: SEND_MSAT_AMOUNT_B_TO_A) . getValue ( ) !
887
+ let paymentId = invoice. paymentHash ( ) !
888
+ let invoicePaymentResult = peer2. channelManager. sendPayment ( paymentHash: paymentHash, recipientOnion: recipientOnion, paymentId: paymentId, routeParams: routeParameters, retryStrategy: Retry . initWithAttempts ( a: 3 ) )
878
889
if let error = invoicePaymentResult. getError ( ) {
879
- print ( " value type: \( error. getValueType ( ) ) " )
880
- if let routingError = error. getValueAsSending ( ) {
881
- print ( " sending error: \( routingError) " )
882
- }
890
+ print ( " sending error: \( error) " )
883
891
}
884
892
XCTAssertTrue ( invoicePaymentResult. isOk ( ) )
885
893
@@ -951,7 +959,8 @@ public class HumanObjectPeerTestInstance {
951
959
try ! await Task . sleep ( nanoseconds: 0_100_000_000 )
952
960
}
953
961
954
- let invoicePayment = invoicePaymentResult. getValue ( ) !
962
+ // let invoicePayment = invoicePaymentResult.getValue()!
963
+ XCTAssert ( invoicePaymentResult. isOk ( ) )
955
964
XCTAssertEqual ( currentChannelABalance, prePaymentBalanceAToB + SEND_MSAT_AMOUNT_B_TO_A)
956
965
XCTAssertEqual ( currentChannelBBalance, prePaymentBalanceBToA - SEND_MSAT_AMOUNT_B_TO_A)
957
966
XCTAssertEqual ( currentChannelABalance, secondChannelBalanceAToB - SEND_MSAT_AMOUNT_A_TO_B + SEND_MSAT_AMOUNT_B_TO_A)
0 commit comments