Skip to content

Commit

Permalink
fix: fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt committed Oct 23, 2024
1 parent eb72b31 commit f356315
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x/evm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check warning on line 595 in x/evm/keeper/msg_server.go

View check run for this annotation

Codecov / codecov/patch

x/evm/keeper/msg_server.go#L595

Added line #L595 was not covered by tests
}
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")

Check warning on line 598 in x/evm/keeper/msg_server.go

View check run for this annotation

Codecov / codecov/patch

x/evm/keeper/msg_server.go#L598

Added line #L598 was not covered by tests
}

// Escrow Coins on module account
Expand All @@ -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")

Check warning on line 622 in x/evm/keeper/msg_server.go

View check run for this annotation

Codecov / codecov/patch

x/evm/keeper/msg_server.go#L622

Added line #L622 was not covered by tests
}
if evmModuleBalance.Cmp(coin.Amount.BigInt()) < 0 {
return nil, fmt.Errorf("insufficient balance in EVM module account")
Expand Down Expand Up @@ -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")

Check warning on line 651 in x/evm/keeper/msg_server.go

View check run for this annotation

Codecov / codecov/patch

x/evm/keeper/msg_server.go#L651

Added line #L651 was not covered by tests
}

Expand Down

0 comments on commit f356315

Please sign in to comment.