Skip to content

Commit 0e8a980

Browse files
authored
Merge pull request #136 from arik-so/battery-autoformat
Expand auto-formatting to battery files.
2 parents 26115bc + 5389f06 commit 0e8a980

38 files changed

+6050
-4937
lines changed

ci/LDKSwift/Sources/LDKSwift/batteries/ChannelManagerConstructor.swift

+475-398
Large diffs are not rendered by default.

ci/LDKSwift/Tests/LDKSwiftTests/HumanObjectPeerTestInstance.swift

+1,026-965
Large diffs are not rendered by default.

ci/LDKSwift/Tests/LDKSwiftTests/LDKSwiftTests.swift

+497-426
Large diffs are not rendered by default.

ci/LDKSwift/Tests/LDKSwiftTests/LDKTestFixtures.swift

+621-16
Large diffs are not rendered by default.

ci/LDKSwift/Tests/LDKSwiftTests/TestBroadcasterInterface.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
//
77

88
#if SWIFT_PACKAGE
9-
import LDKSwift
10-
import LDKHeaders
9+
import LDKSwift
10+
import LDKHeaders
1111
#endif
1212

1313
class TestBroadcasterInterface: BroadcasterInterface {
14-
15-
override func broadcastTransactions(txs: [[UInt8]]) {
16-
// insert code to broadcast transaction
17-
}
18-
14+
15+
override func broadcastTransactions(txs: [[UInt8]]) {
16+
// insert code to broadcast transaction
17+
}
18+
1919
}

ci/LDKSwift/Tests/LDKSwiftTests/TestChannelManagerPersister.swift

+20-20
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@
66
//
77

88
#if SWIFT_PACKAGE
9-
import LDKSwift
10-
import LDKHeaders
9+
import LDKSwift
10+
import LDKHeaders
1111
#endif
1212

13-
class TestChannelManagerPersister : Persister, ExtendedChannelManagerPersister {
13+
class TestChannelManagerPersister: Persister, ExtendedChannelManagerPersister {
1414

1515
private let channelManager: ChannelManager?
1616

1717
init(channelManager: ChannelManager? = nil) {
1818
self.channelManager = channelManager
1919
super.init()
2020
}
21-
22-
func handleEvent(event: Event) -> Result_NoneReplayEventZ {
23-
.initWithOk()
24-
}
25-
26-
override func persistScorer(scorer: Bindings.WriteableScore) -> Bindings.Result_NoneIOErrorZ {
27-
.initWithOk()
28-
}
29-
30-
override func persistGraph(networkGraph: Bindings.NetworkGraph) -> Bindings.Result_NoneIOErrorZ {
31-
.initWithOk()
32-
}
33-
34-
override func persistManager(channelManager: Bindings.ChannelManager) -> Bindings.Result_NoneIOErrorZ {
35-
.initWithOk()
36-
}
21+
22+
func handleEvent(event: Event) -> Result_NoneReplayEventZ {
23+
.initWithOk()
24+
}
25+
26+
override func persistScorer(scorer: Bindings.WriteableScore) -> Bindings.Result_NoneIOErrorZ {
27+
.initWithOk()
28+
}
29+
30+
override func persistGraph(networkGraph: Bindings.NetworkGraph) -> Bindings.Result_NoneIOErrorZ {
31+
.initWithOk()
32+
}
33+
34+
override func persistManager(channelManager: Bindings.ChannelManager) -> Bindings.Result_NoneIOErrorZ {
35+
.initWithOk()
36+
}
3737
}
3838

39-
class FloatingChannelManagerPersister : Persister{
39+
class FloatingChannelManagerPersister: Persister {
4040

4141
private let channelManager: ChannelManager?
4242

ci/LDKSwift/Tests/LDKSwiftTests/TestFeeEstimator.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
//
77

88
#if SWIFT_PACKAGE
9-
import LDKSwift
10-
import LDKHeaders
9+
import LDKSwift
10+
import LDKHeaders
1111
#endif
1212

1313
class TestFeeEstimator: FeeEstimator {
1414

15-
override func getEstSatPer1000Weight(confirmationTarget: Bindings.ConfirmationTarget) -> UInt32 {
16-
return 253
17-
}
15+
override func getEstSatPer1000Weight(confirmationTarget: Bindings.ConfirmationTarget) -> UInt32 {
16+
return 253
17+
}
1818

1919
}

ci/LDKSwift/Tests/LDKSwiftTests/TestFilter.swift

+18-18
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
//
77

88
#if SWIFT_PACKAGE
9-
import LDKSwift
10-
import LDKHeaders
9+
import LDKSwift
10+
import LDKHeaders
1111
#endif
1212

1313
class TestFilter: Filter {
14-
15-
override func registerTx(txid: [UInt8]?, scriptPubkey: [UInt8]) {
16-
// watch this transaction on-chain
17-
}
18-
19-
override func registerOutput(output: Bindings.WatchedOutput) {
20-
let scriptPubkeyBytes = output.getScriptPubkey()
21-
let outpoint = output.getOutpoint()
22-
let txid = outpoint.getTxid()
23-
let outputIndex = outpoint.getIndex()
24-
25-
// watch for any transactions that spend this output on-chain
26-
27-
let blockHashBytes = output.getBlockHash()
28-
// if block hash bytes are not null, return any transaction spending the output that is found in the corresponding block along with its index
29-
}
14+
15+
override func registerTx(txid: [UInt8]?, scriptPubkey: [UInt8]) {
16+
// watch this transaction on-chain
17+
}
18+
19+
override func registerOutput(output: Bindings.WatchedOutput) {
20+
let scriptPubkeyBytes = output.getScriptPubkey()
21+
let outpoint = output.getOutpoint()
22+
let txid = outpoint.getTxid()
23+
let outputIndex = outpoint.getIndex()
24+
25+
// watch for any transactions that spend this output on-chain
26+
27+
let blockHashBytes = output.getBlockHash()
28+
// if block hash bytes are not null, return any transaction spending the output that is found in the corresponding block along with its index
29+
}
3030
}

ci/LDKSwift/Tests/LDKSwiftTests/TestLogger.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@
66
//
77

88
#if SWIFT_PACKAGE
9-
import LDKSwift
10-
import LDKHeaders
9+
import LDKSwift
10+
import LDKHeaders
1111
#endif
1212

1313
class TestLogger: Logger {
1414

15-
override func log(record: Record) {
16-
print("\nRLTestLogger (\(record.getLevel())): \(record.getFile()):\(record.getLine()):\n> \(record.getArgs())\n")
15+
override func log(record: Record) {
16+
print(
17+
"\nRLTestLogger (\(record.getLevel())): \(record.getFile()):\(record.getLine()):\n> \(record.getArgs())\n")
1718
}
1819

1920
}
2021

2122
class MuteLogger: Logger {
2223

23-
override func log(record: Record) {
24+
override func log(record: Record) {
2425
// do nothing
2526
}
2627

ci/LDKSwift/Tests/LDKSwiftTests/TestPersister.swift

+15-10
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,23 @@
66
//
77

88
#if SWIFT_PACKAGE
9-
import LDKSwift
10-
import LDKHeaders
9+
import LDKSwift
10+
import LDKHeaders
1111
#endif
1212

1313
class TestPersister: Persist {
14-
15-
override func persistNewChannel(channelFundingOutpoint: Bindings.OutPoint, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
16-
.Completed
17-
}
18-
19-
override func updatePersistedChannel(channelFundingOutpoint: Bindings.OutPoint, monitorUpdate: Bindings.ChannelMonitorUpdate, monitor: Bindings.ChannelMonitor) -> Bindings.ChannelMonitorUpdateStatus {
20-
.Completed
21-
}
14+
15+
override func persistNewChannel(channelFundingOutpoint: Bindings.OutPoint, monitor: Bindings.ChannelMonitor)
16+
-> Bindings.ChannelMonitorUpdateStatus
17+
{
18+
.Completed
19+
}
20+
21+
override func updatePersistedChannel(
22+
channelFundingOutpoint: Bindings.OutPoint, monitorUpdate: Bindings.ChannelMonitorUpdate,
23+
monitor: Bindings.ChannelMonitor
24+
) -> Bindings.ChannelMonitorUpdateStatus {
25+
.Completed
26+
}
2227

2328
}

0 commit comments

Comments
 (0)