From af1993cc015e880b2334d162df5fd58583fcf150 Mon Sep 17 00:00:00 2001 From: sneurlax <sneurlax@gmail.com> Date: Mon, 10 Apr 2023 16:56:17 -0500 Subject: [PATCH 1/2] amount-related ui fixes for firo/spend-mints --- lib/services/coins/firo/firo_wallet.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/services/coins/firo/firo_wallet.dart b/lib/services/coins/firo/firo_wallet.dart index fc0d2a6eb..49d0bda1f 100644 --- a/lib/services/coins/firo/firo_wallet.dart +++ b/lib/services/coins/firo/firo_wallet.dart @@ -914,8 +914,16 @@ class FiroWallet extends CoinServiceAPI type: isar_models.TransactionType.outgoing, subType: isar_models.TransactionSubType.none, // precision may be lost here hence the following amountString - amount: (txData["recipientAmt"] as Amount).raw.toInt(), - amountString: (txData["recipientAmt"] as Amount).toJsonString(), + amount: Amount( + rawValue: BigInt.from(txData["recipientAmt"] as int), + fractionDigits: coin.decimals) + .raw + .toInt(), + amountString: Amount( + rawValue: BigInt.from(txData["recipientAmt"] as int), + fractionDigits: coin.decimals) + .raw + .toString(), fee: txData["fee"] as int, height: null, isCancelled: false, @@ -2663,7 +2671,7 @@ class FiroWallet extends CoinServiceAPI Future<List<Map<String, dynamic>>> createMintsFromAmount(int total) async { var tmpTotal = total; - var index = 1; + var index = 1; // var mints = <Map<String, dynamic>>[]; final nextFreeMintIndex = firoGetMintIndex()!; while (tmpTotal > 0) { From aeff2f82aebef10e45512e4d453e2d9840e43c2c Mon Sep 17 00:00:00 2001 From: sneurlax <sneurlax@gmail.com> Date: Mon, 10 Apr 2023 16:58:07 -0500 Subject: [PATCH 2/2] remove typo --- lib/services/coins/firo/firo_wallet.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/coins/firo/firo_wallet.dart b/lib/services/coins/firo/firo_wallet.dart index 49d0bda1f..665ab063a 100644 --- a/lib/services/coins/firo/firo_wallet.dart +++ b/lib/services/coins/firo/firo_wallet.dart @@ -2671,7 +2671,7 @@ class FiroWallet extends CoinServiceAPI Future<List<Map<String, dynamic>>> createMintsFromAmount(int total) async { var tmpTotal = total; - var index = 1; // + var index = 1; var mints = <Map<String, dynamic>>[]; final nextFreeMintIndex = firoGetMintIndex()!; while (tmpTotal > 0) {