diff --git a/Example/ZcashLightClientSample/ZcashLightClientSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/ZcashLightClientSample/ZcashLightClientSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a8d1b373..902c34ff 100644 --- a/Example/ZcashLightClientSample/ZcashLightClientSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Example/ZcashLightClientSample/ZcashLightClientSample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -140,8 +140,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/zcash-hackworks/zcash-light-client-ffi", "state" : { - "branch" : "bin/librustzcash_0_7", - "revision" : "e8fbb84c1bec44af9dbef7e27c85f25e8f51a5af" + "revision" : "9ca1958bb4d7755b7d3ca29d176483b4127f1259" } } ], diff --git a/Package.resolved b/Package.resolved index 00effce4..d7e5ec68 100644 --- a/Package.resolved +++ b/Package.resolved @@ -86,7 +86,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/zcash-hackworks/zcash-light-client-ffi", "state" : { - "revision" : "57c2de3825aab0ab8b5f4100dc0184e52ca86ba1" + "revision" : "b9915d53cf563a31722e70a4388e9dce72ea6194" } } ], diff --git a/Package.swift b/Package.swift index ae7b4599..96280f8f 100644 --- a/Package.swift +++ b/Package.swift @@ -16,7 +16,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.8.0"), .package(url: "https://github.com/stephencelis/SQLite.swift.git", from: "0.13.0"), - .package(name:"libzcashlc", url: "https://github.com/zcash-hackworks/zcash-light-client-ffi", revision: "57c2de3825aab0ab8b5f4100dc0184e52ca86ba1") + .package(name:"libzcashlc", url: "https://github.com/zcash-hackworks/zcash-light-client-ffi", revision: "b9915d53cf563a31722e70a4388e9dce72ea6194") ], targets: [ .target( diff --git a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift index 0460dad6..48be5c7b 100644 --- a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift +++ b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift @@ -267,12 +267,18 @@ class ZcashRustBackend: ZcashRustBackendWelding { } let dbData = dbData.osStr() - return zcashlc_get_total_transparent_balance_for_account( + let balance = zcashlc_get_total_transparent_balance_for_account( dbData.0, dbData.1, networkType.networkId, account ) + + guard balance >= 0 else { + throw throwDataDbError(lastError() ?? .genericError(message: "Error getting Total Transparent balance from account \(account)")) + } + + return balance } static func getVerifiedBalance(dbData: URL, account: Int32, networkType: NetworkType) -> Int64 {