Skip to content

Commit

Permalink
refactor(evm): remove outdated comment and improper error message text (
Browse files Browse the repository at this point in the history
#2088)

* refactor(evm): remove outdated comment and improper error message text

* chore: changelog
  • Loading branch information
Unique-Divine authored Oct 22, 2024
1 parent 3348e14 commit 0e5f2fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Use effective gas price in RefundGas and make sure that units are properly
reflected on all occurences of "base fee" in the codebase. This fixes [#2059](https://github.com/NibiruChain/nibiru/issues/2059)
and the [related comments from @Unique-Divine and @berndartmueller](https://github.com/NibiruChain/nibiru/issues/2059#issuecomment-2408625724).
- [#2088](https://github.com/NibiruChain/nibiru/pull/2088) - refactor(evm): remove outdated comment and improper error message text


#### Dapp modules: perp, spot, oracle, etc
Expand Down
10 changes: 5 additions & 5 deletions app/evmante/evmante_gas_consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,18 @@ func (anteDec AnteDecEthGasConsume) AnteHandle(
return next(newCtx, tx, simulate)
}

// deductFee checks if the fee payer has enough funds to pay for the fees and deducts them.
// If the spendable balance is not enough, it tries to claim enough staking rewards to cover the fees.
// deductFee checks if the fee payer has enough funds to pay for the fees and
// deducts them.
func (anteDec AnteDecEthGasConsume) deductFee(
ctx sdk.Context, fees sdk.Coins, feePayer sdk.AccAddress,
) error {
if fees.IsZero() {
return nil
}

// If the account balance is not sufficient, try to withdraw enough staking rewards

if err := anteDec.evmKeeper.DeductTxCostsFromUserBalance(ctx, fees, gethcommon.BytesToAddress(feePayer)); err != nil {
if err := anteDec.evmKeeper.DeductTxCostsFromUserBalance(
ctx, fees, gethcommon.BytesToAddress(feePayer),
); err != nil {
return errors.Wrapf(err, "failed to deduct transaction costs from user balance")
}
return nil
Expand Down
4 changes: 2 additions & 2 deletions x/evm/precompile/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ func (p precompileOracle) decomposeQueryExchangeRateArgs(args []any) (
pair string,
err error,
) {
if len(args) != 1 {
err = fmt.Errorf("expected 3 arguments but got %d", len(args))
if e := assertNumArgs(len(args), 1); e != nil {
err = e
return
}

Expand Down

0 comments on commit 0e5f2fc

Please sign in to comment.