diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index b22571ec..979a1fdb 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -9,13 +9,13 @@ on: jobs: build: name: Build and Test default scheme using any available iPhone simulator - runs-on: macos-14 + runs-on: macos-15 steps: - name: Checkout uses: actions/checkout@v3 - name: Select Xcode Version - run: sudo xcode-select -switch /Applications/Xcode_15.4.app + run: sudo xcode-select -switch /Applications/Xcode_16.3.app - name: Set Default Scheme run: | scheme_list=$(xcodebuild -list -json | tr -d "\n") @@ -25,6 +25,6 @@ jobs: - name: List Devices run: xcrun xctrace list devices 2>&1 - name: Build - run: xcodebuild build-for-testing -scheme BDKSwiftExampleWallet -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' + run: xcodebuild build-for-testing -scheme BDKSwiftExampleWallet -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.4' - name: Run tests - run: xcodebuild test-without-building -scheme BDKSwiftExampleWallet -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' + run: xcodebuild test-without-building -scheme BDKSwiftExampleWallet -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.4' diff --git a/.gitignore b/.gitignore index 82540a74..9d23279b 100644 --- a/.gitignore +++ b/.gitignore @@ -90,4 +90,10 @@ fastlane/test_output iOSInjectionProject/ # Other -.DS_Store \ No newline at end of file +.DS_Store + +# Xcode Source Packages (SPM) +SourcePackages/ + +# VS Code specific +.vscode/ \ No newline at end of file diff --git a/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Amount+Extensions.swift b/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Amount+Extensions.swift index 21e030d1..f6748480 100644 --- a/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Amount+Extensions.swift +++ b/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Amount+Extensions.swift @@ -8,7 +8,7 @@ import BitcoinDevKit import Foundation -extension Amount: Equatable { +extension Amount: @retroactive Equatable { public static func == (lhs: Amount, rhs: Amount) -> Bool { return lhs.toSat() == rhs.toSat() } diff --git a/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Balance+Extensions.swift b/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Balance+Extensions.swift index d42a90cc..763ad40c 100644 --- a/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Balance+Extensions.swift +++ b/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Balance+Extensions.swift @@ -8,7 +8,7 @@ import BitcoinDevKit import Foundation -extension Balance: Equatable { +extension Balance: @retroactive Equatable { public static func == (lhs: Balance, rhs: Balance) -> Bool { return lhs.immature == rhs.immature && lhs.trustedPending == rhs.trustedPending && lhs.untrustedPending == rhs.untrustedPending && lhs.confirmed == rhs.confirmed diff --git a/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Connection+Extensions.swift b/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Connection+Extensions.swift index ee5a78ef..3f09b059 100644 --- a/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Connection+Extensions.swift +++ b/BDKSwiftExampleWallet/Extensions/BDK+Extensions/Connection+Extensions.swift @@ -9,7 +9,7 @@ extension Connection { if FileManager.default.fileExists(atPath: walletDataDirectoryURL.path) { try FileManager.default.removeItem(at: walletDataDirectoryURL) } - + try FileManager.default.ensureDirectoryExists(at: walletDataDirectoryURL) try FileManager.default.removeOldFlatFileIfNeeded(at: documentsDirectoryURL) let persistenceBackendPath = walletDataDirectoryURL.appendingPathComponent("wallet.sqlite") diff --git a/BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift b/BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift index bbf0fe29..1d4ac2e5 100644 --- a/BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift +++ b/BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift @@ -92,13 +92,13 @@ private class BDKService { let localOutputs = wallet.listUnspent() return localOutputs } - + func createWallet(words: String?) throws { self.connection = try Connection.createConnection() guard let connection = connection else { throw WalletError.dbNotFound } - + let savedURL = try? keyClient.getEsploraURL() let baseUrl = savedURL ?? network.url @@ -138,7 +138,7 @@ private class BDKService { try keyClient.saveEsploraURL(baseUrl) self.esploraURL = baseUrl updateEsploraClient() - + let wallet = try Wallet( descriptor: descriptor, changeDescriptor: changeDescriptor, @@ -153,7 +153,7 @@ private class BDKService { guard let connection = connection else { throw WalletError.dbNotFound } - + let savedURL = try? keyClient.getEsploraURL() let baseUrl = savedURL ?? network.url @@ -208,7 +208,7 @@ private class BDKService { guard let connection = connection else { throw WalletError.dbNotFound } - + let savedURL = try? keyClient.getEsploraURL() let baseUrl = savedURL ?? network.url @@ -243,7 +243,7 @@ private class BDKService { try keyClient.saveEsploraURL(baseUrl) self.esploraURL = baseUrl updateEsploraClient() - + let wallet = try Wallet( descriptor: descriptor, changeDescriptor: changeDescriptor, diff --git a/BDKSwiftExampleWallet/Utilities/Constants.swift b/BDKSwiftExampleWallet/Utilities/Constants.swift index b3acefcb..173014c7 100644 --- a/BDKSwiftExampleWallet/Utilities/Constants.swift +++ b/BDKSwiftExampleWallet/Utilities/Constants.swift @@ -5,9 +5,9 @@ // Created by Matthew Ramsden on 6/4/23. // +import BitcoinDevKit import Foundation import SwiftUI -import BitcoinDevKit struct Constants { struct Config { diff --git a/BDKSwiftExampleWallet/View Model/Receive/ReceiveViewModel.swift b/BDKSwiftExampleWallet/View Model/Receive/ReceiveViewModel.swift index 46669a36..fd3ee8cc 100644 --- a/BDKSwiftExampleWallet/View Model/Receive/ReceiveViewModel.swift +++ b/BDKSwiftExampleWallet/View Model/Receive/ReceiveViewModel.swift @@ -110,7 +110,7 @@ extension ReceiveViewModel { func readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) { if let message = messages.first, let record = message.records.first, - let payload = String(data: record.payload, encoding: .utf8) + let _ = String(data: record.payload, encoding: .utf8) { // Handle response } diff --git a/BDKSwiftExampleWallet/View Model/Settings/SettingsViewModel.swift b/BDKSwiftExampleWallet/View Model/Settings/SettingsViewModel.swift index 341fff1e..d09157bc 100644 --- a/BDKSwiftExampleWallet/View Model/Settings/SettingsViewModel.swift +++ b/BDKSwiftExampleWallet/View Model/Settings/SettingsViewModel.swift @@ -9,6 +9,7 @@ import BitcoinDevKit import Foundation import SwiftUI +@MainActor class SettingsViewModel: ObservableObject { let bdkClient: BDKClient