Skip to content

Commit a705b8a

Browse files
committed
Adjust tests for 0.0.124.
1 parent 09403f0 commit a705b8a

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

ci/LDKSwift/Tests/LDKSwiftTests/HumanObjectPeerTestInstance.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ public class HumanObjectPeerTestInstance {
211211
self.interface = underlyingInterface
212212
super.init()
213213
}
214-
215-
override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.WriteableEcdsaChannelSigner {
214+
215+
override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.EcdsaChannelSigner {
216216
let ck = self.interface.deriveChannelSigner(channelValueSatoshis: channelValueSatoshis, channelKeysId: channelKeysId)
217217
return ck
218218
}
@@ -226,14 +226,14 @@ public class HumanObjectPeerTestInstance {
226226
self.master = master
227227
super.init()
228228
}
229-
230-
func handleEvent(event: Event) {
231-
// let eventClone = event.clone()
229+
230+
func handleEvent(event: Event) -> Result_NoneReplayEventZ {
232231
print("peer \(self.master.seed) received event: \(event.getValueType())")
233232
Task {
234233
// clone to avoid deallocation-related issues
235234
await master.pendingEventTracker.addEvent(event: event)
236235
}
236+
return .initWithOk()
237237
}
238238

239239
override func persistScorer(scorer: Bindings.WriteableScore) -> Bindings.Result_NoneIOErrorZ {
@@ -252,10 +252,12 @@ public class HumanObjectPeerTestInstance {
252252
}
253253

254254
fileprivate class TestPersister: Persist {
255-
override func persistNewChannel(channelFundingOutpoint channelId: Bindings.OutPoint, data: Bindings.ChannelMonitor, updateId: Bindings.MonitorUpdateId) -> Bindings.ChannelMonitorUpdateStatus {
255+
256+
override func persistNewChannel(channelFundingOutpoint: Bindings.OutPoint, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
256257
.Completed
257258
}
258-
override func updatePersistedChannel(channelFundingOutpoint channelId: Bindings.OutPoint, update: Bindings.ChannelMonitorUpdate, data: Bindings.ChannelMonitor, updateId: Bindings.MonitorUpdateId) -> Bindings.ChannelMonitorUpdateStatus {
259+
260+
override func updatePersistedChannel(channelFundingOutpoint: Bindings.OutPoint, monitorUpdate: Bindings.ChannelMonitorUpdate, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
259261
.Completed
260262
}
261263
}

ci/LDKSwift/Tests/LDKSwiftTests/TestChannelManagerPersister.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class TestChannelManagerPersister : Persister, ExtendedChannelManagerPersister {
1818
self.channelManager = channelManager
1919
super.init()
2020
}
21-
22-
func handleEvent(event: Event) {
23-
// privateHandleEvent(event: event)
21+
22+
func handleEvent(event: Event) -> Result_NoneReplayEventZ {
23+
.initWithOk()
2424
}
2525

2626
override func persistScorer(scorer: Bindings.WriteableScore) -> Bindings.Result_NoneIOErrorZ {

ci/LDKSwift/Tests/LDKSwiftTests/TestPersister.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import LDKHeaders
1111
#endif
1212

1313
class TestPersister: Persist {
14-
15-
override func persistNewChannel(channelFundingOutpoint channelId: Bindings.OutPoint, data: Bindings.ChannelMonitor, updateId: Bindings.MonitorUpdateId) -> Bindings.ChannelMonitorUpdateStatus {
14+
15+
override func persistNewChannel(channelFundingOutpoint: Bindings.OutPoint, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
1616
.Completed
1717
}
1818

19-
override func updatePersistedChannel(channelFundingOutpoint channelId: Bindings.OutPoint, update: Bindings.ChannelMonitorUpdate, data: Bindings.ChannelMonitor, updateId: Bindings.MonitorUpdateId) -> Bindings.ChannelMonitorUpdateStatus {
19+
override func updatePersistedChannel(channelFundingOutpoint: Bindings.OutPoint, monitorUpdate: Bindings.ChannelMonitorUpdate, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
2020
.Completed
2121
}
2222

ci/LDKSwift/Tests/LDKSwiftTests/WrappedSignerProviderTests.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WrappedSignerProviderTests: XCTestCase {
3737

3838
let handshakeConfig = ChannelHandshakeConfig.initWithDefault()
3939
handshakeConfig.setMinimumDepth(val: 1)
40-
handshakeConfig.setAnnouncedChannel(val: false)
40+
// handshakeConfig.setAnnouncedChannel(val: false)
4141

4242
let handshakeLimits = ChannelHandshakeLimits.initWithDefault()
4343
handshakeLimits.setForceAnnouncedChannelPreference(val: false)
@@ -105,10 +105,10 @@ class WrappedSignerProviderTests: XCTestCase {
105105
print("entering wrapper: signGossipMessage()")
106106
return myKeysManager!.keysManager.asNodeSigner().signGossipMessage(msg: msg)
107107
}
108-
109-
override func signInvoice(hrpBytes: [UInt8], invoiceData: [UInt8], recipient: Bindings.Recipient) -> Bindings.Result_RecoverableSignatureNoneZ {
108+
109+
override func signInvoice(invoice: Bindings.RawBolt11Invoice, recipient: Bindings.Recipient) -> Bindings.Result_RecoverableSignatureNoneZ {
110110
print("entering wrapper: signInvoice()")
111-
return myKeysManager!.keysManager.asNodeSigner().signInvoice(hrpBytes: hrpBytes, invoiceData: invoiceData, recipient: recipient)
111+
return myKeysManager!.keysManager.asNodeSigner().signInvoice(invoice: invoice, recipient: recipient)
112112
}
113113
}
114114

@@ -122,17 +122,18 @@ class WrappedSignerProviderTests: XCTestCase {
122122

123123
class MySignerProvider: SignerProvider {
124124
weak var myKeysManager: MyKeysManager?
125-
override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.WriteableEcdsaChannelSigner {
125+
126+
override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.EcdsaChannelSigner {
126127
print("entering wrapper: deriveChannelSigner()")
127-
return myKeysManager!.keysManager.asSignerProvider().deriveChannelSigner(channelValueSatoshis: channelValueSatoshis, channelKeysId: channelKeysId)
128+
return myKeysManager!.keysManager.deriveChannelKeys(channelValueSatoshis: channelValueSatoshis, params: channelKeysId).asEcdsaChannelSigner()
128129
}
129130

130131
override func generateChannelKeysId(inbound: Bool, channelValueSatoshis: UInt64, userChannelId: [UInt8]) -> [UInt8] {
131132
print("entering wrapper: generateChannelKeysId()")
132133
return myKeysManager!.keysManager.asSignerProvider().generateChannelKeysId(inbound: inbound, channelValueSatoshis: channelValueSatoshis, userChannelId: userChannelId)
133134
}
134-
135-
override func readChanSigner(reader: [UInt8]) -> Bindings.Result_WriteableEcdsaChannelSignerDecodeErrorZ {
135+
136+
override func readChanSigner(reader: [UInt8]) -> Bindings.Result_EcdsaChannelSignerDecodeErrorZ {
136137
print("entering wrapper: readChanSigner()")
137138
return myKeysManager!.keysManager.asSignerProvider().readChanSigner(reader: reader)
138139
}

0 commit comments

Comments
 (0)