mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-12 09:32:33 +00:00
fix: incorrectly displaying XMR instead of WOW
This commit is contained in:
parent
361fff9eb8
commit
acc0977711
4 changed files with 11 additions and 13 deletions
|
@ -12,7 +12,7 @@ import 'package:monero/wownero.dart' as wownero;
|
|||
wownero.WalletManager? _wmPtr;
|
||||
final wownero.WalletManager wmPtr = Pointer.fromAddress((() {
|
||||
try {
|
||||
// Problems with the wallet? Crashes? Lags? this will print all calls to xmr
|
||||
// Problems with the wallet? Crashes? Lags? this will print all calls to wow
|
||||
// codebase, so it will be easier to debug what happens. At least easier
|
||||
// than plugging gdb in. Especially on windows/android.
|
||||
wownero.printStarts = false;
|
||||
|
|
|
@ -11,7 +11,7 @@ class DoubleSpendException implements Exception {
|
|||
|
||||
@override
|
||||
String toString() =>
|
||||
'This transaction cannot be committed. This can be due to many reasons including the wallet not being synced, there is not enough XMR in your available balance, or previous transactions are not yet fully processed.';
|
||||
'This transaction cannot be committed. This can be due to many reasons including the wallet not being synced, there is not enough WOW in your available balance, or previous transactions are not yet fully processed.';
|
||||
}
|
||||
|
||||
class PendingWowneroTransaction with PendingTransaction {
|
||||
|
@ -28,12 +28,12 @@ class PendingWowneroTransaction with PendingTransaction {
|
|||
String get txKey => pendingTransactionDescription.txKey;
|
||||
|
||||
@override
|
||||
String get amountFormatted => AmountConverter.amountIntToString(
|
||||
CryptoCurrency.xmr, pendingTransactionDescription.amount);
|
||||
String get amountFormatted =>
|
||||
AmountConverter.amountIntToString(CryptoCurrency.wow, pendingTransactionDescription.amount);
|
||||
|
||||
@override
|
||||
String get feeFormatted => AmountConverter.amountIntToString(
|
||||
CryptoCurrency.xmr, pendingTransactionDescription.fee);
|
||||
String get feeFormatted =>
|
||||
AmountConverter.amountIntToString(CryptoCurrency.wow, pendingTransactionDescription.fee);
|
||||
|
||||
@override
|
||||
Future<void> commit() async {
|
||||
|
|
|
@ -67,8 +67,7 @@ class WowneroTransactionInfo extends TransactionInfo {
|
|||
String? _fiatAmount;
|
||||
|
||||
@override
|
||||
String amountFormatted() =>
|
||||
'${formatAmount(wowneroAmountToString(amount: amount))} XMR';
|
||||
String amountFormatted() => '${formatAmount(wowneroAmountToString(amount: amount))} WOW';
|
||||
|
||||
@override
|
||||
String fiatAmount() => _fiatAmount ?? '';
|
||||
|
@ -77,6 +76,5 @@ class WowneroTransactionInfo extends TransactionInfo {
|
|||
void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount);
|
||||
|
||||
@override
|
||||
String feeFormatted() =>
|
||||
'${formatAmount(wowneroAmountToString(amount: fee))} XMR';
|
||||
String feeFormatted() => '${formatAmount(wowneroAmountToString(amount: fee))} WOW';
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ abstract class WowneroWalletBase
|
|||
WowneroWalletBase(
|
||||
{required WalletInfo walletInfo, required Box<UnspentCoinsInfo> unspentCoinsInfo})
|
||||
: balance = ObservableMap<CryptoCurrency, WowneroBalance>.of({
|
||||
CryptoCurrency.xmr: WowneroBalance(
|
||||
CryptoCurrency.wow: WowneroBalance(
|
||||
fullBalance: wownero_wallet.getFullBalance(accountIndex: 0),
|
||||
unlockedBalance: wownero_wallet.getFullBalance(accountIndex: 0))
|
||||
}),
|
||||
|
@ -242,7 +242,7 @@ abstract class WowneroWalletBase
|
|||
if (hasMultiDestination) {
|
||||
if (outputs.any((item) => item.sendAll || (item.formattedCryptoAmount ?? 0) <= 0)) {
|
||||
throw WowneroTransactionCreationException(
|
||||
'You do not have enough XMR to send this amount.');
|
||||
'You do not have enough WOW to send this amount.');
|
||||
}
|
||||
|
||||
final int totalAmount =
|
||||
|
@ -251,7 +251,7 @@ abstract class WowneroWalletBase
|
|||
final estimatedFee = calculateEstimatedFee(_credentials.priority, totalAmount);
|
||||
if (unlockedBalance < totalAmount) {
|
||||
throw WowneroTransactionCreationException(
|
||||
'You do not have enough XMR to send this amount.');
|
||||
'You do not have enough WOW to send this amount.');
|
||||
}
|
||||
|
||||
if (!spendAllCoins && (allInputsAmount < totalAmount + estimatedFee)) {
|
||||
|
|
Loading…
Reference in a new issue