Skip to content

Commit e9d69eb

Browse files
committed
Update test Swift files for 0.1.0
1 parent 3f1589c commit e9d69eb

File tree

2 files changed

+18
-23
lines changed

2 files changed

+18
-23
lines changed

ci/LDKSwift/Tests/LDKSwiftTests/HumanObjectPeerTestInstance.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,8 @@ public class HumanObjectPeerTestInstance {
688688
XCTAssertEqual(usableChannelsA[0].getChannelId().write(), fundingChannelId.write())
689689
XCTAssertEqual(usableChannelsB[0].getChannelId().write(), fundingChannelId.write())
690690

691-
let originalChannelBalanceAToB = channelAToB.getBalanceMsat()
692-
let originalChannelBalanceBToA = channelBToA.getBalanceMsat()
691+
let originalChannelBalanceAToB = channelAToB.getOutboundCapacityMsat()
692+
let originalChannelBalanceBToA = channelBToA.getOutboundCapacityMsat()
693693
print("original balance A->B mSats: \(originalChannelBalanceAToB)")
694694
print("original balance B->A mSats: \(originalChannelBalanceBToA)")
695695

@@ -739,21 +739,20 @@ public class HumanObjectPeerTestInstance {
739739

740740
// confirmedChannelBlock = await HumanObjectPeerTestInstance.openChannel(peerA: peer2, peerB: peer3, fundingAmount: FUNDING_SATOSHI_AMOUNT, latestBlock: confirmedChannelBlock, otherPeers: [peer1])
741741

742-
let originalChannelBalanceAToB = channelAToB.getBalanceMsat()
743-
let originalChannelBalanceBToA = channelBToA.getBalanceMsat()
742+
let originalChannelBalanceAToB = channelAToB.getOutboundCapacityMsat()
743+
let originalChannelBalanceBToA = channelBToA.getOutboundCapacityMsat()
744744

745-
let secondChannelBalanceAToB = channelAToB.getBalanceMsat()
746-
let secondChannelBalanceBToA = channelBToA.getBalanceMsat()
745+
let secondChannelBalanceAToB = channelAToB.getOutboundCapacityMsat()
746+
let secondChannelBalanceBToA = channelBToA.getOutboundCapacityMsat()
747747

748748
let logger = TestLogger()
749749

750750
do {
751751
// create invoice for 10k satoshis to pay to peer2
752752

753753
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)
757756
if let invoiceError = invoiceResult.getError() {
758757
let creationError = invoiceError.getValueAsCreationError()
759758
print("creation error: \(creationError)")
@@ -899,8 +898,8 @@ public class HumanObjectPeerTestInstance {
899898
while true {
900899
let channelA = peer1.channelManager.listUsableChannels()[0]
901900
let channelB = peer2.channelManager.listUsableChannels()[0]
902-
currentChannelABalance = channelA.getBalanceMsat()
903-
currentChannelBBalance = channelB.getBalanceMsat()
901+
currentChannelABalance = channelA.getOutboundCapacityMsat()
902+
currentChannelBBalance = channelB.getOutboundCapacityMsat()
904903
if currentChannelABalance != secondChannelBalanceAToB
905904
&& currentChannelBBalance != secondChannelBalanceBToA
906905
{
@@ -920,14 +919,13 @@ public class HumanObjectPeerTestInstance {
920919
do {
921920
// send some money back
922921
// 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()
925924
print("pre-payment balance A->B mSats: \(prePaymentBalanceAToB)")
926925
print("pre-payment balance B->A mSats: \(prePaymentBalanceBToA)")
927926

928927
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",
931929
invoiceExpiryDeltaSecs: 60, minFinalCltvExpiryDelta: 24)
932930
let invoice = invoiceResult.getValue()!
933931
print("Implicit amount invoice: \(invoice.toStr())")
@@ -938,7 +936,9 @@ public class HumanObjectPeerTestInstance {
938936

939937

940938
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+
)
942942
.getValue()!
943943
let paymentId = invoice.paymentHash()!
944944
let invoicePaymentResult = peer2.channelManager.sendPayment(
@@ -1011,8 +1011,8 @@ public class HumanObjectPeerTestInstance {
10111011
while true {
10121012
let channelA = peer1.channelManager.listUsableChannels()[0]
10131013
let channelB = peer2.channelManager.listUsableChannels()[0]
1014-
currentChannelABalance = channelA.getBalanceMsat()
1015-
currentChannelBBalance = channelB.getBalanceMsat()
1014+
currentChannelABalance = channelA.getOutboundCapacityMsat()
1015+
currentChannelBBalance = channelB.getOutboundCapacityMsat()
10161016
if currentChannelABalance != prePaymentBalanceAToB && currentChannelBBalance != prePaymentBalanceBToA {
10171017
break
10181018
}

ci/LDKSwift/Tests/LDKSwiftTests/WrappedSignerProviderTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ class WrappedSignerProviderTests: XCTestCase {
108108
return nodeId
109109
}
110110

111-
override func getInboundPaymentKeyMaterial() -> [UInt8] {
112-
print("entering wrapper: getInboundPaymentKeyMaterial()")
113-
return myKeysManager!.keysManager.asNodeSigner().getInboundPaymentKeyMaterial()
114-
}
115-
116111
override func signGossipMessage(msg: Bindings.UnsignedGossipMessage) -> Bindings.Result_ECDSASignatureNoneZ {
117112
print("entering wrapper: signGossipMessage()")
118113
return myKeysManager!.keysManager.asNodeSigner().signGossipMessage(msg: msg)

0 commit comments

Comments
 (0)