From 130f877234517d435e68c50b2459f6de5fc9b95e Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Sun, 2 Mar 2025 17:29:53 +0200 Subject: [PATCH] minor: improve eth/poly fees error message --- cw_evm/lib/evm_chain_exceptions.dart | 4 ++-- cw_evm/lib/evm_chain_wallet.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cw_evm/lib/evm_chain_exceptions.dart b/cw_evm/lib/evm_chain_exceptions.dart index d0f300270..c7509a17f 100644 --- a/cw_evm/lib/evm_chain_exceptions.dart +++ b/cw_evm/lib/evm_chain_exceptions.dart @@ -16,8 +16,8 @@ class EVMChainTransactionCreationException implements Exception { class EVMChainTransactionFeesException implements Exception { final String exceptionMessage; - EVMChainTransactionFeesException() - : exceptionMessage = 'Current balance is less than the estimated fees for this transaction.'; + EVMChainTransactionFeesException(String currency) + : exceptionMessage = 'Transaction failed due to insufficient $currency balance to cover the fees.'; @override String toString() => exceptionMessage; diff --git a/cw_evm/lib/evm_chain_wallet.dart b/cw_evm/lib/evm_chain_wallet.dart index 646abd7ae..9691993ad 100644 --- a/cw_evm/lib/evm_chain_wallet.dart +++ b/cw_evm/lib/evm_chain_wallet.dart @@ -417,7 +417,7 @@ abstract class EVMChainWalletBase // check the fees on the base currency (Eth/Polygon) if (estimatedFeesForTransaction > balance[currency]!.balance) { - throw EVMChainTransactionFeesException(); + throw EVMChainTransactionFeesException(currency.title); } if (currencyBalance.balance < totalAmount) {