Skip to content

Commit 71824e0

Browse files
committed
format
1 parent 9ede7ed commit 71824e0

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import Foundation
1010

1111
enum BlockchainClientType: String, CaseIterable {
1212
case esplora = "esplora"
13-
case kyoto = "kyoto" // future
14-
case electrum = "electrum" // future
13+
case kyoto = "kyoto" // future
14+
case electrum = "electrum" // future
1515
}
1616

1717
struct BlockchainClient {
@@ -62,7 +62,7 @@ private class BDKService {
6262

6363
let storedClientType = try? keyClient.getClientType()
6464
self.clientType = storedClientType ?? .esplora
65-
65+
6666
self.blockchainURL = (try? keyClient.getEsploraURL()) ?? self.network.url
6767
self.blockchainClient = BlockchainClient.esplora(url: self.blockchainURL)
6868
updateBlockchainClient()
@@ -585,17 +585,17 @@ extension BDKService {
585585
func updateAddressType(_ newAddressType: AddressType) {
586586
try? keyClient.saveAddressType(newAddressType.description)
587587
}
588-
588+
589589
func updateClientType(_ newType: BlockchainClientType) {
590590
self.clientType = newType
591591
try? keyClient.saveClientType(newType)
592592
updateBlockchainClient()
593593
}
594-
594+
595595
var esploraURL: String {
596596
return blockchainURL
597597
}
598-
598+
599599
func updateEsploraURL(_ newURL: String) {
600600
updateBlockchainURL(newURL)
601601
}

BDKSwiftExampleWallet/Service/Key Service/KeyService.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ private struct KeyService {
7070
func saveAddressType(addressType: String) throws {
7171
keychain[string: "SelectedAddressType"] = addressType
7272
}
73-
73+
7474
func getClientType() throws -> String? {
7575
return keychain[string: "SelectedClientType"]
7676
}
77-
77+
7878
func saveClientType(_ clientType: String) throws {
7979
keychain[string: "SelectedClientType"] = clientType
8080
}
@@ -138,7 +138,8 @@ extension KeyClient {
138138
saveBackupInfo: { backupInfo in try KeyService().saveBackupInfo(backupInfo: backupInfo) },
139139
saveEsploraURL: { url in try KeyService().saveEsploraURL(url: url) },
140140
saveNetwork: { network in try KeyService().saveNetwork(network: network) },
141-
saveAddressType: { addressType in try KeyService().saveAddressType(addressType: addressType) },
141+
saveAddressType: { addressType in try KeyService().saveAddressType(addressType: addressType)
142+
},
142143
getClientType: {
143144
let raw = try KeyService().getClientType()
144145
return BlockchainClientType(rawValue: raw ?? "") ?? .esplora

BDKSwiftExampleWalletTests/Service/BDKSwiftExampleWalletBDKServiceTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ final class BDKSwiftExampleWalletBDKServiceTests: XCTestCase {
3232
Transaction.mock?.transactionID
3333
)
3434
}
35-
35+
3636
func testBDKClientGetClientType() {
3737
let clientType = BDKClient.mock.getClientType()
38-
38+
3939
XCTAssertEqual(clientType, .esplora)
4040
}
41-
41+
4242
func testBDKClientUpdateClientType() {
4343
// This test verifies that updateClientType doesn't crash with mock client
4444
// In the real implementation, setting an unimplemented type would fallback to esplora
4545
BDKClient.mock.updateClientType(.kyoto)
46-
46+
4747
// Verify it still returns esplora (since mock doesn't actually change)
4848
let clientType = BDKClient.mock.getClientType()
4949
XCTAssertEqual(clientType, .esplora)
5050
}
51-
51+
5252
func testBlockchainClientTypeEnumValues() {
5353
// Test that all expected client types are available
5454
let allCases = BlockchainClientType.allCases
@@ -57,12 +57,12 @@ final class BDKSwiftExampleWalletBDKServiceTests: XCTestCase {
5757
XCTAssertTrue(allCases.contains(.electrum))
5858
XCTAssertEqual(allCases.count, 3)
5959
}
60-
60+
6161
func testBlockchainClientEsploraFactory() {
6262
// Test that the esplora factory method works correctly
6363
let testURL = "https://blockstream.info/testnet/api"
6464
let client = BlockchainClient.esplora(url: testURL)
65-
65+
6666
XCTAssertEqual(client.getUrl(), testURL)
6767
XCTAssertEqual(client.getType(), .esplora)
6868
XCTAssertTrue(client.supportsFullScan())

0 commit comments

Comments
 (0)