From 9fcbc4d72a9d1b763f8fdfc21071f6024e1b4630 Mon Sep 17 00:00:00 2001 From: cyan Date: Wed, 4 Dec 2024 07:01:49 -0500 Subject: [PATCH] CW-846: Correctly display balance (#1848) * Correctly display balance even with frozen coins * remove package= from AndroidMainfest.xml * update namespace --- android/app/src/debug/AndroidManifest.xml | 3 +-- android/app/src/profile/AndroidManifest.xml | 3 +-- cw_core/lib/monero_balance.dart | 4 ++-- cw_monero/lib/monero_wallet.dart | 5 +++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index dc767a55d..f880684a6 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index dc767a55d..f880684a6 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/cw_core/lib/monero_balance.dart b/cw_core/lib/monero_balance.dart index 98a7f134a..9a63c407e 100644 --- a/cw_core/lib/monero_balance.dart +++ b/cw_core/lib/monero_balance.dart @@ -3,8 +3,8 @@ import 'package:cw_core/monero_amount_format.dart'; class MoneroBalance extends Balance { MoneroBalance({required this.fullBalance, required this.unlockedBalance, this.frozenBalance = 0}) - : formattedFullBalance = moneroAmountToString(amount: fullBalance), - formattedUnlockedBalance = moneroAmountToString(amount: unlockedBalance - frozenBalance), + : formattedFullBalance = moneroAmountToString(amount: frozenBalance + fullBalance), + formattedUnlockedBalance = moneroAmountToString(amount: unlockedBalance), formattedLockedBalance = moneroAmountToString(amount: frozenBalance + fullBalance - unlockedBalance), super(unlockedBalance, fullBalance); diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index 2b302e745..d7a67c47d 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -725,8 +725,9 @@ abstract class MoneroWalletBase extends WalletBase