fix: sorting of transactions (#3494)

* fix: zcash address for exchange

* fix: honour the restore height the user entered

- Make Zcash rescan work in both directions by resetting sync from the new birth height
- Keep the entered height when restoring a wallet from keys
- Tolerate grouping separators in typed restore heights

* fix: sorting of transactions
fix: tx fee for outgoing transactions

---------

Co-authored-by: Vik Sharma <vik@cakewallet.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
cyan
2026-08-11 03:18:06 +02:00
committed by GitHub
co-authored by Vik Sharma Omar Hatem
parent 3b16f2fb7c
commit 19653afeab
3 changed files with 15 additions and 6 deletions
+4 -1
View File
@@ -622,7 +622,10 @@ abstract class ZcashWalletBase
final info = ZcashTransactionInfo(
id: tx.txHash,
amount: Money(amount, currency),
fee: Money.zero(currency),
fee: Money(
direction == TransactionDirection.outgoing ? tx.fee : BigInt.zero,
currency,
),
direction: direction,
isPending: tx.height == 0,
date: tx.time,
+10 -4
View File
@@ -33,10 +33,13 @@ class ZkoolTx {
DateTime get time {
final ts = max(_tx.time, _txAccount.time) * 1000;
if (ts == 0) {
return ZcashHeight.getTimeByBlockHeight(height);
if (ts != 0) {
return DateTime.fromMillisecondsSinceEpoch(ts);
}
return DateTime.fromMillisecondsSinceEpoch(ts);
if (height == 0) {
return DateTime.now();
}
return ZcashHeight.getTimeByBlockHeight(height);
}
String? get to => _txAccount.outputs.firstOrNull?.address;
@@ -96,7 +99,8 @@ class ZkoolTx {
BigInt get value => _value.abs();
BigInt get fee => value - _calcValue;
BigInt get fee => BigInt.from(_tx.fee);
BigInt get _value {
if (_tx.value != 0) {
@@ -166,6 +170,7 @@ class ZkoolTx {
"height": _tx.height,
"time": _tx.time,
"value": value.toInt(),
"tpe": _tx.tpe,
"zsaValue": _tx.zsaValue,
"assetDisplay": _tx.assetDisplay,
@@ -277,6 +282,7 @@ class ZkoolTx {
height: _asInt(txJson["height"]),
time: _asInt(txJson["time"]),
value: _asInt(txJson["value"]),
fee: _asInt(txJson["fee"]),
tpe: txJson["tpe"] == null ? null : _asInt(txJson["tpe"]),
zsaValue: _asInt(txJson["zsaValue"]),
assetDisplay: txJson["assetDisplay"] as String? ?? "",
+1 -1
View File
@@ -21,7 +21,7 @@ dependencies:
# path: ../../zkool2
git:
url: https://github.com/cake-tech/zkool2.git
ref: 16fd3d11575f850939f498c3ea75d391915456d1
ref: 36e72b530c274c4a54a6127aadb94886e84d67bf
path_provider: any
sqflite_common_ffi: any