Skip to content

Commit

Permalink
Adjust tests for 0.0.124
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Sep 5, 2024
1 parent f16df10 commit 885dc5c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ public class HumanObjectPeerTestInstance {
self.interface = underlyingInterface
super.init()
}

override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.WriteableEcdsaChannelSigner {
override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.EcdsaChannelSigner {
let ck = self.interface.deriveChannelSigner(channelValueSatoshis: channelValueSatoshis, channelKeysId: channelKeysId)
return ck
}
Expand All @@ -226,14 +226,14 @@ public class HumanObjectPeerTestInstance {
self.master = master
super.init()
}

func handleEvent(event: Event) {
// let eventClone = event.clone()

func handleEvent(event: Event) -> Result_NoneReplayEventZ {
print("peer \(self.master.seed) received event: \(event.getValueType())")
Task {
// clone to avoid deallocation-related issues
await master.pendingEventTracker.addEvent(event: event)
}
return .initWithOk()
}

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

fileprivate class TestPersister: Persist {
override func persistNewChannel(channelFundingOutpoint channelId: Bindings.OutPoint, data: Bindings.ChannelMonitor, updateId: Bindings.MonitorUpdateId) -> Bindings.ChannelMonitorUpdateStatus {

override func persistNewChannel(channelFundingOutpoint: Bindings.OutPoint, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
.Completed
}
override func updatePersistedChannel(channelFundingOutpoint channelId: Bindings.OutPoint, update: Bindings.ChannelMonitorUpdate, data: Bindings.ChannelMonitor, updateId: Bindings.MonitorUpdateId) -> Bindings.ChannelMonitorUpdateStatus {

override func updatePersistedChannel(channelFundingOutpoint: Bindings.OutPoint, monitorUpdate: Bindings.ChannelMonitorUpdate, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
.Completed
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class TestChannelManagerPersister : Persister, ExtendedChannelManagerPersister {
self.channelManager = channelManager
super.init()
}

func handleEvent(event: Event) {
// privateHandleEvent(event: event)
func handleEvent(event: Event) -> Result_NoneReplayEventZ {
.initWithOk()
}

override func persistScorer(scorer: Bindings.WriteableScore) -> Bindings.Result_NoneIOErrorZ {
Expand Down
6 changes: 3 additions & 3 deletions ci/LDKSwift/Tests/LDKSwiftTests/TestPersister.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import LDKHeaders
#endif

class TestPersister: Persist {

override func persistNewChannel(channelFundingOutpoint channelId: Bindings.OutPoint, data: Bindings.ChannelMonitor, updateId: Bindings.MonitorUpdateId) -> Bindings.ChannelMonitorUpdateStatus {
override func persistNewChannel(channelFundingOutpoint: Bindings.OutPoint, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
.Completed
}

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

Expand Down
17 changes: 9 additions & 8 deletions ci/LDKSwift/Tests/LDKSwiftTests/WrappedSignerProviderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class WrappedSignerProviderTests: XCTestCase {

let handshakeConfig = ChannelHandshakeConfig.initWithDefault()
handshakeConfig.setMinimumDepth(val: 1)
handshakeConfig.setAnnouncedChannel(val: false)
// handshakeConfig.setAnnouncedChannel(val: false)

let handshakeLimits = ChannelHandshakeLimits.initWithDefault()
handshakeLimits.setForceAnnouncedChannelPreference(val: false)
Expand Down Expand Up @@ -105,10 +105,10 @@ class WrappedSignerProviderTests: XCTestCase {
print("entering wrapper: signGossipMessage()")
return myKeysManager!.keysManager.asNodeSigner().signGossipMessage(msg: msg)
}

override func signInvoice(hrpBytes: [UInt8], invoiceData: [UInt8], recipient: Bindings.Recipient) -> Bindings.Result_RecoverableSignatureNoneZ {
override func signInvoice(invoice: Bindings.RawBolt11Invoice, recipient: Bindings.Recipient) -> Bindings.Result_RecoverableSignatureNoneZ {
print("entering wrapper: signInvoice()")
return myKeysManager!.keysManager.asNodeSigner().signInvoice(hrpBytes: hrpBytes, invoiceData: invoiceData, recipient: recipient)
return myKeysManager!.keysManager.asNodeSigner().signInvoice(invoice: invoice, recipient: recipient)
}
}

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

class MySignerProvider: SignerProvider {
weak var myKeysManager: MyKeysManager?
override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.WriteableEcdsaChannelSigner {

override func deriveChannelSigner(channelValueSatoshis: UInt64, channelKeysId: [UInt8]) -> Bindings.EcdsaChannelSigner {
print("entering wrapper: deriveChannelSigner()")
return myKeysManager!.keysManager.asSignerProvider().deriveChannelSigner(channelValueSatoshis: channelValueSatoshis, channelKeysId: channelKeysId)
return myKeysManager!.keysManager.deriveChannelKeys(channelValueSatoshis: channelValueSatoshis, params: channelKeysId).asEcdsaChannelSigner()
}

override func generateChannelKeysId(inbound: Bool, channelValueSatoshis: UInt64, userChannelId: [UInt8]) -> [UInt8] {
print("entering wrapper: generateChannelKeysId()")
return myKeysManager!.keysManager.asSignerProvider().generateChannelKeysId(inbound: inbound, channelValueSatoshis: channelValueSatoshis, userChannelId: userChannelId)
}

override func readChanSigner(reader: [UInt8]) -> Bindings.Result_WriteableEcdsaChannelSignerDecodeErrorZ {
override func readChanSigner(reader: [UInt8]) -> Bindings.Result_EcdsaChannelSignerDecodeErrorZ {
print("entering wrapper: readChanSigner()")
return myKeysManager!.keysManager.asSignerProvider().readChanSigner(reader: reader)
}
Expand Down

0 comments on commit 885dc5c

Please sign in to comment.