minor: improve eth/poly fees error message
OmarHatem committed
Mar 2, 2025 at 17:29 UTC
130f877234517d435e68c50b2459f6de5fc9b95e
2 files changed
+3
-3
cw_evm/lib/evm_chain_exceptions.dart
+2
-2
@@ -16,8 +16,8 @@ class EVMChainTransactionCreationException implements Exception {
16
class EVMChainTransactionFeesException implements Exception {
17
final String exceptionMessage;
18
19
- EVMChainTransactionFeesException()
20
- : exceptionMessage = 'Current balance is less than the estimated fees for this transaction.';
19
+ EVMChainTransactionFeesException(String currency)
20
+ : exceptionMessage = 'Transaction failed due to insufficient $currency balance to cover the fees.';
21
22
@override
23
String toString() => exceptionMessage;
cw_evm/lib/evm_chain_wallet.dart
+1
-1
@@ -417,7 +417,7 @@ abstract class EVMChainWalletBase
417
418
// check the fees on the base currency (Eth/Polygon)
419
if (estimatedFeesForTransaction > balance[currency]!.balance) {
420
- throw EVMChainTransactionFeesException();
420
+ throw EVMChainTransactionFeesException(currency.title);
421
}
422
423
if (currencyBalance.balance < totalAmount) {