Skip to content

Commit

Permalink
Run formatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Sep 11, 2024
1 parent 591c586 commit 5389f06
Show file tree
Hide file tree
Showing 35 changed files with 6,024 additions and 4,931 deletions.
873 changes: 475 additions & 398 deletions ci/LDKSwift/Sources/LDKSwift/batteries/ChannelManagerConstructor.swift

Large diffs are not rendered by default.

1,991 changes: 1,026 additions & 965 deletions ci/LDKSwift/Tests/LDKSwiftTests/HumanObjectPeerTestInstance.swift

Large diffs are not rendered by default.

923 changes: 497 additions & 426 deletions ci/LDKSwift/Tests/LDKSwiftTests/LDKSwiftTests.swift

Large diffs are not rendered by default.

637 changes: 621 additions & 16 deletions ci/LDKSwift/Tests/LDKSwiftTests/LDKTestFixtures.swift

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions ci/LDKSwift/Tests/LDKSwiftTests/TestBroadcasterInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
//

#if SWIFT_PACKAGE
import LDKSwift
import LDKHeaders
import LDKSwift
import LDKHeaders
#endif

class TestBroadcasterInterface: BroadcasterInterface {
override func broadcastTransactions(txs: [[UInt8]]) {
// insert code to broadcast transaction
}

override func broadcastTransactions(txs: [[UInt8]]) {
// insert code to broadcast transaction
}

}
40 changes: 20 additions & 20 deletions ci/LDKSwift/Tests/LDKSwiftTests/TestChannelManagerPersister.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
//

#if SWIFT_PACKAGE
import LDKSwift
import LDKHeaders
import LDKSwift
import LDKHeaders
#endif

class TestChannelManagerPersister : Persister, ExtendedChannelManagerPersister {
class TestChannelManagerPersister: Persister, ExtendedChannelManagerPersister {

private let channelManager: ChannelManager?

init(channelManager: ChannelManager? = nil) {
self.channelManager = channelManager
super.init()
}
func handleEvent(event: Event) -> Result_NoneReplayEventZ {
.initWithOk()
}
override func persistScorer(scorer: Bindings.WriteableScore) -> Bindings.Result_NoneIOErrorZ {
.initWithOk()
}
override func persistGraph(networkGraph: Bindings.NetworkGraph) -> Bindings.Result_NoneIOErrorZ {
.initWithOk()
}
override func persistManager(channelManager: Bindings.ChannelManager) -> Bindings.Result_NoneIOErrorZ {
.initWithOk()
}

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

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

override func persistGraph(networkGraph: Bindings.NetworkGraph) -> Bindings.Result_NoneIOErrorZ {
.initWithOk()
}

override func persistManager(channelManager: Bindings.ChannelManager) -> Bindings.Result_NoneIOErrorZ {
.initWithOk()
}
}

class FloatingChannelManagerPersister : Persister{
class FloatingChannelManagerPersister: Persister {

private let channelManager: ChannelManager?

Expand Down
10 changes: 5 additions & 5 deletions ci/LDKSwift/Tests/LDKSwiftTests/TestFeeEstimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
//

#if SWIFT_PACKAGE
import LDKSwift
import LDKHeaders
import LDKSwift
import LDKHeaders
#endif

class TestFeeEstimator: FeeEstimator {

override func getEstSatPer1000Weight(confirmationTarget: Bindings.ConfirmationTarget) -> UInt32 {
return 253
}
override func getEstSatPer1000Weight(confirmationTarget: Bindings.ConfirmationTarget) -> UInt32 {
return 253
}

}
36 changes: 18 additions & 18 deletions ci/LDKSwift/Tests/LDKSwiftTests/TestFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
//

#if SWIFT_PACKAGE
import LDKSwift
import LDKHeaders
import LDKSwift
import LDKHeaders
#endif

class TestFilter: Filter {
override func registerTx(txid: [UInt8]?, scriptPubkey: [UInt8]) {
// watch this transaction on-chain
}
override func registerOutput(output: Bindings.WatchedOutput) {
let scriptPubkeyBytes = output.getScriptPubkey()
let outpoint = output.getOutpoint()
let txid = outpoint.getTxid()
let outputIndex = outpoint.getIndex()
// watch for any transactions that spend this output on-chain
let blockHashBytes = output.getBlockHash()
// if block hash bytes are not null, return any transaction spending the output that is found in the corresponding block along with its index
}

override func registerTx(txid: [UInt8]?, scriptPubkey: [UInt8]) {
// watch this transaction on-chain
}

override func registerOutput(output: Bindings.WatchedOutput) {
let scriptPubkeyBytes = output.getScriptPubkey()
let outpoint = output.getOutpoint()
let txid = outpoint.getTxid()
let outputIndex = outpoint.getIndex()

// watch for any transactions that spend this output on-chain

let blockHashBytes = output.getBlockHash()
// if block hash bytes are not null, return any transaction spending the output that is found in the corresponding block along with its index
}
}
11 changes: 6 additions & 5 deletions ci/LDKSwift/Tests/LDKSwiftTests/TestLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
//

#if SWIFT_PACKAGE
import LDKSwift
import LDKHeaders
import LDKSwift
import LDKHeaders
#endif

class TestLogger: Logger {

override func log(record: Record) {
print("\nRLTestLogger (\(record.getLevel())): \(record.getFile()):\(record.getLine()):\n> \(record.getArgs())\n")
override func log(record: Record) {
print(
"\nRLTestLogger (\(record.getLevel())): \(record.getFile()):\(record.getLine()):\n> \(record.getArgs())\n")
}

}

class MuteLogger: Logger {

override func log(record: Record) {
override func log(record: Record) {
// do nothing
}

Expand Down
25 changes: 15 additions & 10 deletions ci/LDKSwift/Tests/LDKSwiftTests/TestPersister.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
//

#if SWIFT_PACKAGE
import LDKSwift
import LDKHeaders
import LDKSwift
import LDKHeaders
#endif

class TestPersister: Persist {

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

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

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

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

}
Loading

0 comments on commit 5389f06

Please sign in to comment.