From f356315ac62b860f3ea0e9f6e3878ea4e4a7606c Mon Sep 17 00:00:00 2001 From: matthiasmatt Date: Wed, 23 Oct 2024 13:02:45 +0200 Subject: [PATCH] fix: fix error message --- x/evm/keeper/msg_server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/evm/keeper/msg_server.go b/x/evm/keeper/msg_server.go index b706b7ceb..90f905be2 100644 --- a/x/evm/keeper/msg_server.go +++ b/x/evm/keeper/msg_server.go @@ -592,10 +592,10 @@ func (k Keeper) convertCoinNativeERC20( recipientBalanceBefore, err := k.ERC20().BalanceOf(erc20Addr, recipient, ctx) if err != nil { - return nil, errors.Wrap(err, "failed to retrieve EVM module account balance") + return nil, errors.Wrap(err, "failed to retrieve recipient balance") } if recipientBalanceBefore == nil { - return nil, fmt.Errorf("failed to retrieve EVM module account balance, balance is nil") + return nil, fmt.Errorf("failed to retrieve recipient balance, balance is nil") } // Escrow Coins on module account @@ -619,7 +619,7 @@ func (k Keeper) convertCoinNativeERC20( return nil, errors.Wrap(err, "failed to retrieve balance") } if evmModuleBalance == nil { - return nil, fmt.Errorf("failed to retrieve balance, balance is nil") + return nil, fmt.Errorf("failed to retrieve EVM module account balance, balance is nil") } if evmModuleBalance.Cmp(coin.Amount.BigInt()) < 0 { return nil, fmt.Errorf("insufficient balance in EVM module account") @@ -647,7 +647,7 @@ func (k Keeper) convertCoinNativeERC20( // Burn escrowed Coins based on the actual amount received by the recipient actualReceivedAmount := big.NewInt(0).Sub(recipientBalanceAfter, recipientBalanceBefore) - if actualReceivedAmount.Sign() == 0 { + if actualReceivedAmount.Sign() <= 0 { return nil, fmt.Errorf("no ERC20 tokens were received by the recipient") }