@@ -688,8 +688,8 @@ public class HumanObjectPeerTestInstance {
688
688
XCTAssertEqual ( usableChannelsA [ 0 ] . getChannelId ( ) . write ( ) , fundingChannelId. write ( ) )
689
689
XCTAssertEqual ( usableChannelsB [ 0 ] . getChannelId ( ) . write ( ) , fundingChannelId. write ( ) )
690
690
691
- let originalChannelBalanceAToB = channelAToB. getBalanceMsat ( )
692
- let originalChannelBalanceBToA = channelBToA. getBalanceMsat ( )
691
+ let originalChannelBalanceAToB = channelAToB. getOutboundCapacityMsat ( )
692
+ let originalChannelBalanceBToA = channelBToA. getOutboundCapacityMsat ( )
693
693
print ( " original balance A->B mSats: \( originalChannelBalanceAToB) " )
694
694
print ( " original balance B->A mSats: \( originalChannelBalanceBToA) " )
695
695
@@ -739,21 +739,20 @@ public class HumanObjectPeerTestInstance {
739
739
740
740
// confirmedChannelBlock = await HumanObjectPeerTestInstance.openChannel(peerA: peer2, peerB: peer3, fundingAmount: FUNDING_SATOSHI_AMOUNT, latestBlock: confirmedChannelBlock, otherPeers: [peer1])
741
741
742
- let originalChannelBalanceAToB = channelAToB. getBalanceMsat ( )
743
- let originalChannelBalanceBToA = channelBToA. getBalanceMsat ( )
742
+ let originalChannelBalanceAToB = channelAToB. getOutboundCapacityMsat ( )
743
+ let originalChannelBalanceBToA = channelBToA. getOutboundCapacityMsat ( )
744
744
745
- let secondChannelBalanceAToB = channelAToB. getBalanceMsat ( )
746
- let secondChannelBalanceBToA = channelBToA. getBalanceMsat ( )
745
+ let secondChannelBalanceAToB = channelAToB. getOutboundCapacityMsat ( )
746
+ let secondChannelBalanceBToA = channelBToA. getOutboundCapacityMsat ( )
747
747
748
748
let logger = TestLogger ( )
749
749
750
750
do {
751
751
// create invoice for 10k satoshis to pay to peer2
752
752
753
753
let invoiceResult = Bindings . createInvoiceFromChannelmanager (
754
- channelmanager: peer2. channelManager, nodeSigner: peer2. explicitKeysManager. asNodeSigner ( ) ,
755
- logger: logger, network: . Bitcoin, amtMsat: SEND_MSAT_AMOUNT_A_TO_B, description: " Invoice description " ,
756
- invoiceExpiryDeltaSecs: 60 , minFinalCltvExpiryDelta: 24 )
754
+ channelmanager: peer2. channelManager, amtMsat: SEND_MSAT_AMOUNT_A_TO_B,
755
+ description: " Invoice description " , invoiceExpiryDeltaSecs: 60 , minFinalCltvExpiryDelta: 24 )
757
756
if let invoiceError = invoiceResult. getError ( ) {
758
757
let creationError = invoiceError. getValueAsCreationError ( )
759
758
print ( " creation error: \( creationError) " )
@@ -899,8 +898,8 @@ public class HumanObjectPeerTestInstance {
899
898
while true {
900
899
let channelA = peer1. channelManager. listUsableChannels ( ) [ 0 ]
901
900
let channelB = peer2. channelManager. listUsableChannels ( ) [ 0 ]
902
- currentChannelABalance = channelA. getBalanceMsat ( )
903
- currentChannelBBalance = channelB. getBalanceMsat ( )
901
+ currentChannelABalance = channelA. getOutboundCapacityMsat ( )
902
+ currentChannelBBalance = channelB. getOutboundCapacityMsat ( )
904
903
if currentChannelABalance != secondChannelBalanceAToB
905
904
&& currentChannelBBalance != secondChannelBalanceBToA
906
905
{
@@ -920,14 +919,13 @@ public class HumanObjectPeerTestInstance {
920
919
do {
921
920
// send some money back
922
921
// create invoice for 10k satoshis to pay to peer2
923
- let prePaymentBalanceAToB = peer1. channelManager. listUsableChannels ( ) [ 0 ] . getBalanceMsat ( )
924
- let prePaymentBalanceBToA = peer2. channelManager. listUsableChannels ( ) [ 0 ] . getBalanceMsat ( )
922
+ let prePaymentBalanceAToB = peer1. channelManager. listUsableChannels ( ) [ 0 ] . getOutboundCapacityMsat ( )
923
+ let prePaymentBalanceBToA = peer2. channelManager. listUsableChannels ( ) [ 0 ] . getOutboundCapacityMsat ( )
925
924
print ( " pre-payment balance A->B mSats: \( prePaymentBalanceAToB) " )
926
925
print ( " pre-payment balance B->A mSats: \( prePaymentBalanceBToA) " )
927
926
928
927
let invoiceResult = Bindings . createInvoiceFromChannelmanager (
929
- channelmanager: peer1. channelManager, nodeSigner: peer1. explicitKeysManager. asNodeSigner ( ) ,
930
- logger: logger, network: . Bitcoin, amtMsat: nil , description: " Second invoice description " ,
928
+ channelmanager: peer1. channelManager, amtMsat: nil , description: " Second invoice description " ,
931
929
invoiceExpiryDeltaSecs: 60 , minFinalCltvExpiryDelta: 24 )
932
930
let invoice = invoiceResult. getValue ( ) !
933
931
print ( " Implicit amount invoice: \( invoice. toStr ( ) ) " )
@@ -938,7 +936,9 @@ public class HumanObjectPeerTestInstance {
938
936
939
937
940
938
let ( paymentHash, recipientOnion, routeParameters) =
941
- Bindings . paymentParametersFromZeroAmountInvoice ( invoice: invoice, amountMsat: SEND_MSAT_AMOUNT_B_TO_A)
939
+ Bindings . paymentParametersFromVariableAmountInvoice (
940
+ invoice: invoice, amountMsat: SEND_MSAT_AMOUNT_B_TO_A
941
+ )
942
942
. getValue ( ) !
943
943
let paymentId = invoice. paymentHash ( ) !
944
944
let invoicePaymentResult = peer2. channelManager. sendPayment (
@@ -1011,8 +1011,8 @@ public class HumanObjectPeerTestInstance {
1011
1011
while true {
1012
1012
let channelA = peer1. channelManager. listUsableChannels ( ) [ 0 ]
1013
1013
let channelB = peer2. channelManager. listUsableChannels ( ) [ 0 ]
1014
- currentChannelABalance = channelA. getBalanceMsat ( )
1015
- currentChannelBBalance = channelB. getBalanceMsat ( )
1014
+ currentChannelABalance = channelA. getOutboundCapacityMsat ( )
1015
+ currentChannelBBalance = channelB. getOutboundCapacityMsat ( )
1016
1016
if currentChannelABalance != prePaymentBalanceAToB && currentChannelBBalance != prePaymentBalanceBToA {
1017
1017
break
1018
1018
}
0 commit comments