evm: cleanup, remove atlas/ (#1152)

* evm: cleanup, remove atlas/

* rm tparse action

* fix lint issue

* use cases.NoLower

* tidy
This commit is contained in:
Federico Kunze Küllmer
2022-06-27 11:58:44 +02:00
committed by GitHub
parent 27ade5d731
commit 3ac8b93a1c
18 changed files with 67 additions and 372 deletions
+4
View File
@@ -366,11 +366,13 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace
// should have already been checked on Ante Handler
return nil, sdkerrors.Wrap(err, "intrinsic gas failed")
}
// Should check again even if it is checked on Ante Handler, because eth_call don't go through Ante Handler.
if msg.Gas() < intrinsicGas {
// eth_estimateGas will check for this exact error
return nil, sdkerrors.Wrap(core.ErrIntrinsicGas, "apply message")
}
leftoverGas := msg.Gas() - intrinsicGas
// access list preparation is moved from ante handler to here, because it's needed when `ApplyMessage` is called
@@ -401,11 +403,13 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace
if msg.Gas() < leftoverGas {
return nil, sdkerrors.Wrap(types.ErrGasOverflow, "apply message")
}
temporaryGasUsed := msg.Gas() - leftoverGas
refund := GasToRefund(stateDB.GetRefund(), temporaryGasUsed, refundQuotient)
if refund > temporaryGasUsed {
return nil, sdkerrors.Wrap(types.ErrGasOverflow, "apply message")
}
temporaryGasUsed -= refund
// EVM execution error needs to be available for the JSON-RPC client
-10
View File
@@ -206,16 +206,6 @@ func (suite *KeeperTestSuite) TestGetEthIntrinsicGas() {
true,
params.TxGas + params.TxDataNonZeroGasFrontier*1,
},
// we are not able to test the ErrGasUintOverflow due to RAM limitation
// {
// "with big data size overflow",
// make([]byte, 271300000000000000),
// nil,
// 1,
// false,
// false,
// 0,
// },
{
"no data, one accesslist, not contract creation, not homestead, not istanbul",
nil,
+1 -1
View File
@@ -68,7 +68,7 @@ func (k Keeper) DeductTxCostsFromUserBalance(
if feeAmt.Sign() == 0 {
// zero fee, no need to deduct
return sdk.NewCoins(), nil
return sdk.Coins{}, nil
}
fees := sdk.Coins{sdk.NewCoin(denom, sdk.NewIntFromBigInt(feeAmt))}