Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

chore(evm): Deprecate x/params usage in x/evm #1472

Merged
merged 70 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9f3fee9
imp(evm): Migrate from old Cosmos SDK params module to new way of kee…
Vvaradinov Nov 17, 2022
7d8d228
Updated changelog
Vvaradinov Nov 17, 2022
63d4a62
Apply changes from code review
Vvaradinov Nov 18, 2022
9aaa035
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 18, 2022
bfb2633
(impv): Added Shanghai and Cancun blocks to current types and latest …
Vvaradinov Nov 18, 2022
fa68d16
(tests): Update unit tests to include Shanghai and Cancun blocks
Vvaradinov Nov 18, 2022
0566f9d
(fix) - ran golangci-lint on the entire project
Vvaradinov Nov 18, 2022
7d09bb8
(fix) - remove deprecated params method
Vvaradinov Nov 18, 2022
4d519d5
(impv): added marshaling of booleans per individual param key
Vvaradinov Nov 18, 2022
72a8d4b
(impv): added individual param getting and setting
Vvaradinov Nov 19, 2022
4c4be05
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 19, 2022
86cc0e4
(impv): replaced getters with individual param
Vvaradinov Nov 21, 2022
567043c
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 21, 2022
5eb724d
(impv): added amino codec for MsgEthereumTx
Vvaradinov Nov 21, 2022
422a247
Added changes suggested in code review
Vvaradinov Nov 22, 2022
f95e918
(fix): updated the migration files for v4
Vvaradinov Nov 22, 2022
52a45ec
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 22, 2022
53b4ab0
(fix): fixed unit tests panic for incorrect interface
Vvaradinov Nov 22, 2022
512ed48
Merge branch 'Vvaradinov/refactor-deprecated-evm-params-logic' of htt…
Vvaradinov Nov 22, 2022
669d8f6
(fix): updated module msg handler
Vvaradinov Nov 23, 2022
ca95892
(fix): rename to original params getter method
Vvaradinov Nov 23, 2022
85d5eff
(refactor): registered implementation for the new msg
Vvaradinov Nov 24, 2022
fe9dc4c
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 24, 2022
74b1878
(refactor): added correct amino codec for MsgUpdateParams and removed…
Vvaradinov Nov 25, 2022
42e1405
Applied changes from code review
Vvaradinov Nov 25, 2022
90f7877
(fix): removed unnecessary duplicate
Vvaradinov Nov 25, 2022
6788828
(fix): removed params_legacy from the types and moved logic to migration
Vvaradinov Nov 25, 2022
096f422
(fix): Added v4 mocks to the migrations_test
Vvaradinov Nov 25, 2022
5db39eb
(fix): undo all the non related work regarding the Cancun and Shangha…
Vvaradinov Nov 25, 2022
efd88b3
(fix): reverted linting the entire project - will make a separate PR …
Vvaradinov Nov 25, 2022
960b213
Applied changes from review
Vvaradinov Nov 25, 2022
d8dd162
Applied changes from code review
Vvaradinov Nov 25, 2022
7158f1c
(fix): removed comments
Vvaradinov Nov 25, 2022
7431a28
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 25, 2022
a5c3397
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 25, 2022
b82775f
(fix): Ran formatter and fixed linting issues on unsed functions
Vvaradinov Nov 25, 2022
19146e6
(fix): Linting issues resolved
Vvaradinov Nov 25, 2022
a5e1e9f
(fix): refactor migrations and added default EIPs
Vvaradinov Nov 28, 2022
f6a4290
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 28, 2022
28a315c
(fix): Combined into one call
Vvaradinov Nov 28, 2022
0c48520
(fix): Added more straightforward way to handle migration
Vvaradinov Nov 28, 2022
2995dab
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 29, 2022
03e5b52
(fix): corrected migration test
Vvaradinov Nov 29, 2022
42429e5
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 29, 2022
5b8f891
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 30, 2022
42aefa5
Applied changes from code review
Vvaradinov Nov 30, 2022
36e13cb
(fix): Linter fix
Vvaradinov Nov 30, 2022
4e3fb16
(fix): Linter
Vvaradinov Nov 30, 2022
584a751
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Nov 30, 2022
6c9a676
(fix): Lint proto files
Vvaradinov Dec 1, 2022
381df32
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
MalteHerrmann Dec 9, 2022
2153748
Apply suggestions from code review
Vvaradinov Dec 9, 2022
31b1031
(fix): Added new block to migration
Vvaradinov Dec 9, 2022
db4de42
Merge branch 'Vvaradinov/refactor-deprecated-evm-params-logic' of htt…
Vvaradinov Dec 9, 2022
973a7e1
(fix): Added additional comments and formatted proto files
Vvaradinov Dec 9, 2022
953a809
(fix): Added name to unit test cases
Vvaradinov Dec 9, 2022
f7d2ed4
(fix): removed unused import
Vvaradinov Dec 9, 2022
ba122d7
Apply changes from code review
Vvaradinov Dec 12, 2022
6f19bd8
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Dec 12, 2022
a91e4a4
(fix): typo
Vvaradinov Dec 12, 2022
83226dd
Merge branch 'Vvaradinov/refactor-deprecated-evm-params-logic' of htt…
Vvaradinov Dec 12, 2022
bfd8e89
(fix): remove HTTP endpoint exposure
Vvaradinov Dec 12, 2022
abceb75
Apply suggestions from code review
Vvaradinov Dec 16, 2022
9cb60cb
applied changes from code review
Vvaradinov Dec 19, 2022
c9a2418
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Dec 19, 2022
408d3aa
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Jan 3, 2023
0403e57
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
Vvaradinov Jan 3, 2023
3812eee
fix: extra line added in merge removed
Vvaradinov Jan 3, 2023
ddaf663
fix: applied changes from code review
Vvaradinov Jan 4, 2023
aae45b2
Merge branch 'main' into Vvaradinov/refactor-deprecated-evm-params-logic
danburck Jan 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### State Machine Breaking

* (evm) [#1470](https://github.com/evmos/ethermint/pull/1470) Refactor deprecated Cosmos SDK x/params module
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved
* (deps) [#1361](https://github.com/evmos/ethermint/pull/1361) Bump ibc-go to [`v5.0.0`](https://github.com/cosmos/ibc-go/releases/tag/v5.0.0)
* (evm) [\#1272](https://github.com/evmos/ethermint/pull/1272) Implement modular interface for the EVM.
* (deps) [#1168](https://github.com/evmos/ethermint/pull/1168) Upgrade Cosmos SDK to `v0.46`.
Expand Down
24 changes: 14 additions & 10 deletions app/ante/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ func NewEthSigVerificationDecorator(ek EVMKeeper) EthSigVerificationDecorator {
// Failure in RecheckTx will prevent tx to be included into block, especially when CheckTx succeed, in which case user
// won't see the error message.
func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
params := esvd.evmKeeper.GetParams(ctx)
chainID := esvd.evmKeeper.ChainID()
chainCfg := esvd.evmKeeper.GetChainConfig(ctx)
chainCfg := params.GetChainConfig()
ethCfg := chainCfg.EthereumConfig(chainID)
blockNum := big.NewInt(ctx.BlockHeight())
signer := ethtypes.MakeSigner(ethCfg, blockNum)
Expand All @@ -52,7 +53,7 @@ func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, s
return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evmtypes.MsgEthereumTx)(nil))
}

allowUnprotectedTxs := esvd.evmKeeper.GetAllowUnprotectedTxs(ctx)
allowUnprotectedTxs := params.GetAllowUnprotectedTxs()
ethTx := msgEthTx.AsTransaction()
if !allowUnprotectedTxs && !ethTx.Protected() {
return ctx, sdkerrors.Wrapf(
Expand Down Expand Up @@ -176,7 +177,8 @@ func NewEthGasConsumeDecorator(
// - transaction or block gas meter runs out of gas
// - sets the gas meter limit
func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) {
chainCfg := egcd.evmKeeper.GetChainConfig(ctx)
params := egcd.evmKeeper.GetParams(ctx)
chainCfg := params.ChainConfig
ethCfg := chainCfg.EthereumConfig(egcd.evmKeeper.ChainID())

blockHeight := big.NewInt(ctx.BlockHeight())
Expand Down Expand Up @@ -211,7 +213,7 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
gasWanted += txData.GetGas()
}

evmDenom := egcd.evmKeeper.GetEVMDenom(ctx)
evmDenom := params.EvmDenom
fees, priority, err := egcd.evmKeeper.DeductTxCostsFromUserBalance(
ctx,
*msgEthTx,
Expand Down Expand Up @@ -435,13 +437,14 @@ func (vbd EthValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simu
txFee := sdk.Coins{}
txGasLimit := uint64(0)

chainCfg := vbd.evmKeeper.GetChainConfig(ctx)
params := vbd.evmKeeper.GetParams(ctx)
chainCfg := params.ChainConfig
chainID := vbd.evmKeeper.ChainID()
ethCfg := chainCfg.EthereumConfig(chainID)
baseFee := vbd.evmKeeper.GetBaseFee(ctx, ethCfg)
enableCreate := vbd.evmKeeper.GetEnableCreate(ctx)
enableCall := vbd.evmKeeper.GetEnableCall(ctx)
evmDenom := vbd.evmKeeper.GetEVMDenom(ctx)
enableCreate := params.EnableCreate
enableCall := params.EnableCall
evmDenom := params.EvmDenom

for _, msg := range protoTx.GetMsgs() {
msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx)
Expand Down Expand Up @@ -552,10 +555,11 @@ func NewEthMempoolFeeDecorator(ek EVMKeeper) EthMempoolFeeDecorator {
// It only do the check if london hardfork not enabled or feemarket not enabled, because in that case feemarket will take over the task.
func (mfd EthMempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
if ctx.IsCheckTx() && !simulate {
chainCfg := mfd.evmKeeper.GetChainConfig(ctx)
params := mfd.evmKeeper.GetParams(ctx)
chainCfg := params.ChainConfig
evmDenom := params.EvmDenom
ethCfg := chainCfg.EthereumConfig(mfd.evmKeeper.ChainID())
baseFee := mfd.evmKeeper.GetBaseFee(ctx, ethCfg)
evmDenom := mfd.evmKeeper.GetEVMDenom(ctx)

if baseFee == nil {
for _, msg := range tx.GetMsgs() {
Expand Down
3 changes: 2 additions & 1 deletion app/ante/fee_market.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func NewGasWantedDecorator(
}

func (gwd GasWantedDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
chainCfg := gwd.evmKeeper.GetChainConfig(ctx)
params := gwd.evmKeeper.GetParams(ctx)
chainCfg := params.ChainConfig
ethCfg := chainCfg.EthereumConfig(gwd.evmKeeper.ChainID())

blockHeight := big.NewInt(ctx.BlockHeight())
Expand Down
6 changes: 4 additions & 2 deletions app/ante/fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func (mpd MinGasPriceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate
return next(ctx, tx, simulate)
}

evmDenom := mpd.evmKeeper.GetEVMDenom(ctx)
params := mpd.evmKeeper.GetParams(ctx)
evmDenom := params.EvmDenom
minGasPrices := sdk.DecCoins{
{
Denom: evmDenom,
Expand Down Expand Up @@ -93,7 +94,8 @@ func (empd EthMinGasPriceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul
return next(ctx, tx, simulate)
}

chainCfg := empd.evmKeeper.GetChainConfig(ctx)
params := empd.evmKeeper.GetParams(ctx)
chainCfg := params.ChainConfig
ethCfg := chainCfg.EthereumConfig(empd.evmKeeper.ChainID())
baseFee := empd.evmKeeper.GetBaseFee(ctx, ethCfg)

Expand Down
5 changes: 0 additions & 5 deletions app/ante/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ type EVMKeeper interface {
GetBalance(ctx sdk.Context, addr common.Address) *big.Int
ResetTransientGasUsed(ctx sdk.Context)
GetTxIndexTransient(ctx sdk.Context) uint64
GetChainConfig(ctx sdk.Context) evmtypes.ChainConfig
GetEVMDenom(ctx sdk.Context) string
GetEnableCreate(ctx sdk.Context) bool
GetEnableCall(ctx sdk.Context) bool
GetAllowUnprotectedTxs(ctx sdk.Context) bool
}

type protoTxProvider interface {
Expand Down
2 changes: 2 additions & 0 deletions app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ func (suite *AnteTestSuite) SetupTest() {
evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt
evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt
evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt
evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt
evmGenesis.Params.ChainConfig.CancunBlock = &maxInt
}
if suite.evmParamsOption != nil {
suite.evmParamsOption(&evmGenesis.Params)
Expand Down
4 changes: 3 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,10 @@ func NewEthermintApp(
appCodec, app.GetSubspace(feemarkettypes.ModuleName), keys[feemarkettypes.StoreKey], tkeys[feemarkettypes.TransientKey],
)

// Create EVM keeper with a new field authority which is defaulted to the
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved
// Cosmos SDK gov module account
app.EvmKeeper = evmkeeper.NewKeeper(
appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], app.GetSubspace(evmtypes.ModuleName),
appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.FeeMarketKeeper,
nil, geth.NewEVM, tracer,
)
Expand Down
6 changes: 2 additions & 4 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions proto/ethermint/evm/v1/evm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ message ChainConfig {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.moretags) = "yaml:\"merge_netsplit_block\""
];
// Shanghai switch block (nil = no fork, 0 = already on shanghai)
string shanghai_block = 22 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.moretags) = "yaml:\"shanghai_block\""
];
// Cancun switch block (nil = no fork, 0 = already on cancun)
string cancun_block = 23 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.moretags) = "yaml:\"cancun_block\""
];
}

// State represents a single Storage key value pair item.
Expand Down
25 changes: 25 additions & 0 deletions proto/ethermint/evm/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "cosmos_proto/cosmos.proto";
import "ethermint/evm/v1/evm.proto";
import "cosmos/msg/v1/msg.proto";

option go_package = "github.com/evmos/ethermint/x/evm/types";

Expand All @@ -15,6 +16,11 @@ service Msg {
rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse) {
option (google.api.http).post = "/ethermint/evm/v1/ethereum_tx";
};
// UpdateParams defined a governance operation for updating the x/evm module parameters.
// The authority is hard-coded to the Cosmos SDK x/gov module account
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
option (google.api.http).post = "/ethermint/evm/v1/update_params";
};
}

// MsgEthereumTx encapsulates an Ethereum transaction as an SDK message.
Expand Down Expand Up @@ -156,3 +162,22 @@ message MsgEthereumTxResponse {
// gas consumed by the transaction
uint64 gas_used = 5;
}

Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved

// MsgUpdateParams is the Msg/UpdateParams request type for EVM parameters.
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved
// Since: cosmos-sdk 0.47
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved

// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// params defines the x/evm parameters to update.
// NOTE: All parameters must be supplied.
Params params = 2 [(gogoproto.nullable) = false];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
// Since: cosmos-sdk 0.47
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved
message MsgUpdateParamsResponse {}
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions rpc/backend/backend_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package backend
import (
"bufio"
"fmt"
"github.com/evmos/ethermint/crypto/ethsecp256k1"
"math/big"
"os"
"path/filepath"
"testing"

"github.com/evmos/ethermint/crypto/ethsecp256k1"

dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -87,7 +88,6 @@ func (suite *BackendTestSuite) SetupTest() {
// Add codec
encCfg := encoding.MakeConfig(app.ModuleBasics)
suite.backend.clientCtx.Codec = encCfg.Codec

}

// buildEthereumTx returns an example legacy Ethereum transaction
Expand Down
4 changes: 2 additions & 2 deletions rpc/backend/call_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package backend
import (
"encoding/json"
"fmt"
"math/big"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand All @@ -12,7 +14,6 @@ import (
"github.com/evmos/ethermint/tests"
evmtypes "github.com/evmos/ethermint/x/evm/types"
"google.golang.org/grpc/metadata"
"math/big"
)

func (suite *BackendTestSuite) TestResend() {
Expand Down Expand Up @@ -480,5 +481,4 @@ func (suite *BackendTestSuite) TestGasPrice() {
}
})
}

}
3 changes: 1 addition & 2 deletions rpc/backend/chain_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ func (suite *BackendTestSuite) TestChainId() {
var header metadata.MD
queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient)
RegisterParamsInvalidHeight(queryClient, &header, int64(1))

},
expChainId,
true,
Expand Down Expand Up @@ -387,7 +386,7 @@ func (suite *BackendTestSuite) TestFeeHistory() {
{
"fail - Invalid base fee",
func(validator sdk.AccAddress) {
//baseFee := sdk.NewInt(1)
// baseFee := sdk.NewInt(1)
queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient)
client := suite.backend.clientCtx.Client.(*mocks.Client)
suite.backend.cfg.JSONRPC.FeeHistoryCap = 2
Expand Down
4 changes: 3 additions & 1 deletion rpc/backend/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package backend

import (
"context"
"testing"

"github.com/cosmos/cosmos-sdk/client"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
Expand All @@ -18,7 +20,6 @@ import (
tmrpcclient "github.com/tendermint/tendermint/rpc/client"
tmrpctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/tendermint/tendermint/types"
"testing"
)

// Client defines a mocked object that implements the Tendermint JSON-RPC Client
Expand Down Expand Up @@ -96,6 +97,7 @@ func RegisterBlockMultipleTxs(
client.On("Block", rpc.ContextWithHeight(height), mock.AnythingOfType("*int64")).Return(resBlock, nil)
return resBlock, nil
}

func RegisterBlock(
client *mocks.Client,
height int64,
Expand Down
5 changes: 3 additions & 2 deletions rpc/backend/evm_query_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"strconv"
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
grpctypes "github.com/cosmos/cosmos-sdk/types/grpc"
Expand All @@ -18,8 +21,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"strconv"
"testing"
)

// QueryClient defines a mocked object that implements the ethermint GRPC
Expand Down
2 changes: 1 addition & 1 deletion rpc/backend/filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package backend

import (
"encoding/json"

"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/evmos/ethermint/rpc/backend/mocks"
Expand All @@ -11,7 +12,6 @@ import (
)

func (suite *BackendTestSuite) TestGetLogs() {

_, bz := suite.buildEthereumTx()
block := tmtypes.MakeBlock(1, []tmtypes.Tx{bz}, nil, nil)
logs := make([]*evmtypes.Log, 0, 1)
Expand Down
6 changes: 3 additions & 3 deletions rpc/backend/node_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package backend

import (
"fmt"
"math/big"

sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -11,7 +13,6 @@ import (
ethermint "github.com/evmos/ethermint/types"
"github.com/spf13/viper"
tmrpcclient "github.com/tendermint/tendermint/rpc/client"
"math/big"
)

func (suite *BackendTestSuite) TestRPCMinGasPrice() {
Expand Down Expand Up @@ -190,7 +191,6 @@ func (suite *BackendTestSuite) TestSyncing() {
RegisterStatus(client)
status, _ := client.Status(suite.backend.ctx)
status.SyncInfo.CatchingUp = true

},
map[string]interface{}{
"startingBlock": hexutil.Uint64(0),
Expand Down Expand Up @@ -254,7 +254,7 @@ func (suite *BackendTestSuite) TestSetEtherbase() {
c := sdk.NewDecCoin("aphoton", sdk.NewIntFromBigInt(big.NewInt(1)))
suite.backend.cfg.SetMinGasPrices(sdk.DecCoins{c})
delAddr, _ := suite.backend.GetCoinbase()
//account, _ := suite.backend.clientCtx.AccountRetriever.GetAccount(suite.backend.clientCtx, delAddr)
// account, _ := suite.backend.clientCtx.AccountRetriever.GetAccount(suite.backend.clientCtx, delAddr)
delCommonAddr := common.BytesToAddress(delAddr.Bytes())
request := &authtypes.QueryAccountRequest{Address: sdk.AccAddress(delCommonAddr.Bytes()).String()}
requestMarshal, _ := request.Marshal()
Expand Down
1 change: 1 addition & 0 deletions rpc/backend/sign_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package backend

import (
"fmt"

"github.com/cosmos/cosmos-sdk/crypto"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
Expand Down
4 changes: 2 additions & 2 deletions rpc/backend/tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package backend

import (
"fmt"

"github.com/cosmos/cosmos-sdk/crypto"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (suite *BackendTestSuite) TestTraceTransaction() {
{
"fail - block not found",
func() {
//var header metadata.MD
// var header metadata.MD
client := suite.backend.clientCtx.Client.(*mocks.Client)
RegisterBlockError(client, 1)
},
Expand Down Expand Up @@ -220,7 +221,6 @@ func (suite *BackendTestSuite) TestTraceBlock() {
func() {
queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient)
RegisterTraceBlock(queryClient, []*evmtypes.MsgEthereumTx{msgEthTx})

},
[]*evmtypes.TxTraceResult{},
&resBlockFilled,
Expand Down
Loading