This adopts the `getRecipient()` function of 0.18.1-beta. (#323)
It lets the wallet know the recipient addresses of a given transaction set package manager `upToNextMinor` with 0.18.0-beta Update packages Adopt fs_cache_db changes of Zcash SDK. (#322) * Adopt fs_cache_db changes of Zcash SDK. Fixes #306 * Point ZcashLightClientKit to main branch * Fix `fixPendingDbName()` when file already was migrated Adopt Current ZcashLightClientKit commit `cf60f44aa83938432c81361917406483ff42c719`
This commit is contained in:
parent
53c9ed3b87
commit
c59257b27c
|
@ -754,7 +754,6 @@
|
||||||
0D1250F623B557E40014EE3A = {
|
0D1250F623B557E40014EE3A = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
34030EE8297A88B300552CAD /* Packages */,
|
|
||||||
0D12510123B557E40014EE3A /* wallet */,
|
0D12510123B557E40014EE3A /* wallet */,
|
||||||
0D12511823B557E60014EE3A /* walletTests */,
|
0D12511823B557E60014EE3A /* walletTests */,
|
||||||
0D12512323B557E60014EE3A /* walletUITests */,
|
0D12512323B557E60014EE3A /* walletUITests */,
|
||||||
|
@ -980,14 +979,6 @@
|
||||||
path = Components;
|
path = Components;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
34030EE8297A88B300552CAD /* Packages */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
0D9F91D7297F2EF70012617D /* ZcashLightClientKit */,
|
|
||||||
);
|
|
||||||
name = Packages;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
|
@ -2297,7 +2288,7 @@
|
||||||
repositoryURL = "https://github.com/zcash/ZcashLightClientKit";
|
repositoryURL = "https://github.com/zcash/ZcashLightClientKit";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = revision;
|
kind = revision;
|
||||||
revision = fad3aae1743467686db8e3a77998baa2ca823fce;
|
revision = cf60f44aa83938432c81361917406483ff42c719;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
/* End XCRemoteSwiftPackageReference section */
|
/* End XCRemoteSwiftPackageReference section */
|
||||||
|
|
|
@ -189,6 +189,14 @@
|
||||||
"version" : "0.2.0"
|
"version" : "0.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"identity" : "zcashlightclientkit",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/zcash/ZcashLightClientKit",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "cf60f44aa83938432c81361917406483ff42c719"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"identity" : "zealous-logger",
|
"identity" : "zealous-logger",
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
|
|
|
@ -217,13 +217,13 @@ extension Date {
|
||||||
|
|
||||||
extension DetailModel {
|
extension DetailModel {
|
||||||
|
|
||||||
init(transaction: ZcashTransaction.Overview, memos: [Memo]) {
|
init(transaction: ZcashTransaction.Overview, memos: [Memo], recipients: [TransactionRecipient]) {
|
||||||
self.date = Date(timeIntervalSince1970: transaction.blockTime ?? 0)
|
self.date = Date(timeIntervalSince1970: transaction.blockTime ?? 0)
|
||||||
self.id = transaction.rawID.toHexStringTxId()
|
self.id = transaction.rawID.toHexStringTxId()
|
||||||
self.shielded = true
|
self.shielded = true
|
||||||
self.status = transaction.isSentTransaction ? .paid(success: (transaction.minedHeight ?? 0) > 0) : .received
|
self.status = transaction.isSentTransaction ? .paid(success: (transaction.minedHeight ?? 0) > 0) : .received
|
||||||
self.subtitle = transaction.isSentTransaction ? "wallet_history_sent".localized() + " \(self.date.transactionDetail)" : "Received".localized() + " \(self.date.transactionDetail)"
|
self.subtitle = transaction.isSentTransaction ? "wallet_history_sent".localized() + " \(self.date.transactionDetail)" : "Received".localized() + " \(self.date.transactionDetail)"
|
||||||
self.zAddress = nil
|
self.zAddress = recipients.first?.stringEncodedAddress
|
||||||
self.amount = transaction.isSentTransaction ? -transaction.value : transaction.value
|
self.amount = transaction.isSentTransaction ? -transaction.value : transaction.value
|
||||||
if let memo = memos.first {
|
if let memo = memos.first {
|
||||||
self.memo = memo.toString()
|
self.memo = memo.toString()
|
||||||
|
@ -307,11 +307,11 @@ extension PendingTransactionRecipient {
|
||||||
case .address(let recipient):
|
case .address(let recipient):
|
||||||
switch recipient {
|
switch recipient {
|
||||||
case .sapling(let saplingAddress):
|
case .sapling(let saplingAddress):
|
||||||
return saplingAddress.stringEncoded.shortAddress
|
return saplingAddress.stringEncoded
|
||||||
case .transparent(let transparentAddress):
|
case .transparent(let transparentAddress):
|
||||||
return transparentAddress.stringEncoded.shortAddress
|
return transparentAddress.stringEncoded
|
||||||
case .unified(let unified):
|
case .unified(let unified):
|
||||||
return unified.stringEncoded.shortAddress
|
return unified.stringEncoded
|
||||||
}
|
}
|
||||||
case .internalAccount(let account):
|
case .internalAccount(let account):
|
||||||
return "Funds shielded account \(account)"
|
return "Funds shielded account \(account)"
|
||||||
|
|
|
@ -337,7 +337,9 @@ extension CombineSynchronizer {
|
||||||
memos = []
|
memos = []
|
||||||
}
|
}
|
||||||
|
|
||||||
return DetailModel(transaction: transaction, memos: memos)
|
let recipients = self.synchronizer.getRecipients(for: transaction)
|
||||||
|
|
||||||
|
return DetailModel(transaction: transaction, memos: memos, recipients: recipients)
|
||||||
}
|
}
|
||||||
.filter { detailModel in
|
.filter { detailModel in
|
||||||
pending.first { (p) -> Bool in p.id == detailModel.id } == nil
|
pending.first { (p) -> Bool in p.id == detailModel.id } == nil
|
||||||
|
|
|
@ -232,27 +232,6 @@ final class ZECCWalletEnvironment: ObservableObject {
|
||||||
case .wipeAttemptWhileProcessing:
|
case .wipeAttemptWhileProcessing:
|
||||||
return WalletError.genericErrorWithMessage(message: synchronizerError.localizedDescription)
|
return WalletError.genericErrorWithMessage(message: synchronizerError.localizedDescription)
|
||||||
}
|
}
|
||||||
} else if let serviceError = error as? LightWalletServiceError {
|
|
||||||
switch serviceError {
|
|
||||||
case .criticalError:
|
|
||||||
return WalletError.criticalError(error: serviceError)
|
|
||||||
case .userCancelled:
|
|
||||||
return WalletError.connectionFailed
|
|
||||||
case .unknown:
|
|
||||||
return WalletError.connectionFailed
|
|
||||||
case .failed:
|
|
||||||
return WalletError.connectionFailedWithError(error: error)
|
|
||||||
case .generalError:
|
|
||||||
return WalletError.connectionFailed
|
|
||||||
case .invalidBlock:
|
|
||||||
return WalletError.genericErrorWithError(error: error)
|
|
||||||
case .sentFailed(let error):
|
|
||||||
return WalletError.sendFailed(error: error)
|
|
||||||
case .genericError(error: let error):
|
|
||||||
return WalletError.genericErrorWithError(error: error)
|
|
||||||
case .timeOut:
|
|
||||||
return WalletError.networkTimeout
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return WalletError.genericErrorWithError(error: error)
|
return WalletError.genericErrorWithError(error: error)
|
||||||
|
|
Loading…
Reference in New Issue