Skip to content

Commit

Permalink
fix test build
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Feb 23, 2024
1 parent e264bdd commit a587955
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 114 deletions.
8 changes: 4 additions & 4 deletions app/ante/eth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() {
0,
func() {
vmdb.AddBalance(addr, big.NewInt(1000000))
suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1))
suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(1))
},
false, true,
0,
Expand All @@ -265,7 +265,7 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() {
tx2GasLimit, // it's capped
func() {
vmdb.AddBalance(addr, big.NewInt(1001000000000000))
suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(10000000000000000000))
suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(10000000000000000000))
},
true, false,
tx2Priority,
Expand All @@ -276,7 +276,7 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() {
tx2GasLimit, // it's capped
func() {
vmdb.AddBalance(addr, big.NewInt(1001000000000000))
suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(10000000000000000000))
suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(10000000000000000000))
},
true, false,
dynamicFeeTxPriority,
Expand All @@ -302,7 +302,7 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() {

if tc.expPanic {
suite.Require().Panics(func() {
_, _ = dec.AnteHandle(suite.ctx.WithIsCheckTx(true).WithGasMeter(sdk.NewGasMeter(1)), tc.tx, false, NextFn)
_, _ = dec.AnteHandle(suite.ctx.WithIsCheckTx(true).WithGasMeter(storetypes.NewGasMeter(1)), tc.tx, false, NextFn)
})
return
}
Expand Down
6 changes: 3 additions & 3 deletions app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type AnteTestSuite struct {
const TestGasLimit uint64 = 100000

func (suite *AnteTestSuite) StateDB() *statedb.StateDB {
return statedb.New(suite.ctx, suite.app.EvmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes())))
return statedb.New(suite.ctx, suite.app.EvmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash())))
}

func (suite *AnteTestSuite) SetupTest() {
Expand Down Expand Up @@ -111,9 +111,9 @@ func (suite *AnteTestSuite) SetupTest() {
return genesis
})

suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: testutil.TestnetChainID + "-1", Time: time.Now().UTC()})
suite.ctx = suite.app.BaseApp.NewContext(checkTx).WithBlockHeader(tmproto.Header{Height: 2, ChainID: testutil.TestnetChainID + "-1", Time: time.Now().UTC()})
suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(evmtypes.DefaultEVMDenom, sdkmath.OneInt())))
suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1000000000000000000))
suite.ctx = suite.ctx.WithBlockGasMeter(storetypes.NewGasMeter(1000000000000000000))
suite.app.EvmKeeper.WithChainID(suite.ctx)

infCtx := suite.ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ func NewEthermintApp(
app.AccountKeeper,
app.BankKeeper,
authAddr,
address.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
address.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
)
app.MintKeeper = mintkeeper.NewKeeper(
appCodec,
Expand Down
8 changes: 4 additions & 4 deletions app/simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (

simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"

"cosmossdk.io/log"
"cosmossdk.io/store"
storetypes "cosmossdk.io/store/types"
evidencetypes "cosmossdk.io/x/evidence/types"
dbm "github.com/cosmos/cosmos-db"
abci "github.com/cometbft/cometbft/abci/types"
"cosmossdk.io/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
dbm "github.com/cosmos/cosmos-db"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -229,8 +229,8 @@ func TestAppImportExport(t *testing.T) {
}
}()

ctxA := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight(), ChainID: SimAppChainID})
ctxB := newApp.NewContext(true, tmproto.Header{Height: app.LastBlockHeight(), ChainID: SimAppChainID})
ctxA := app.NewContext(true).WithBlockHeader(tmproto.Header{Height: app.LastBlockHeight(), ChainID: SimAppChainID})
ctxB := newApp.NewContext(true).WithBlockHeader(tmproto.Header{Height: app.LastBlockHeight(), ChainID: SimAppChainID})
newApp.mm.InitGenesis(ctxB, app.AppCodec(), genesisState)
newApp.StoreConsensusParams(ctxB, exported.ConsensusParams)

Expand Down
2 changes: 1 addition & 1 deletion app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func genesisStateWithValSet(codec codec.Codec, genesisState GenesisState,
MinSelfDelegation: sdkmath.ZeroInt(),
}
validators = append(validators, validator)
delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), val.Address.String(), sdkmath.LegacyOneDec()))
delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), sdkmath.LegacyOneDec()))
}
// set validators and delegations
stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations)
Expand Down
6 changes: 3 additions & 3 deletions tests/importer/importer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (suite *ImporterTestSuite) DoSetupTest(t require.TestingT) {
priv, err := ethsecp256k1.GenerateKey()
require.NoError(t, err)
consAddress := sdk.ConsAddress(priv.PubKey().Address())
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
suite.ctx = suite.app.BaseApp.NewContext(checkTx).WithBlockHeader(tmproto.Header{
Height: 1,
ChainID: "ethermint_9000-1",
Time: time.Now().UTC(),
Expand Down Expand Up @@ -139,9 +139,9 @@ func (suite *ImporterTestSuite) TestImportBlocks() {
suite.app.BeginBlock(types.RequestBeginBlock{

Check failure on line 139 in tests/importer/importer_test.go

View workflow job for this annotation

GitHub Actions / test-importer

suite.app.BeginBlock undefined (type *"github.com/evmos/ethermint/app".EthermintApp has no field or method BeginBlock)

Check failure on line 139 in tests/importer/importer_test.go

View workflow job for this annotation

GitHub Actions / test-importer

undefined: types.RequestBeginBlock
Header: tmheader,
})
ctx := suite.app.NewContext(false, tmheader)
ctx := suite.app.NewContext(false).WithBlockHeader(tmheader)
ctx = ctx.WithBlockHeight(tmheader.Height)
vmdb := statedb.New(ctx, suite.app.EvmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())))
vmdb := statedb.New(ctx, suite.app.EvmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash())))

if chainConfig.DAOForkSupport && chainConfig.DAOForkBlock != nil && chainConfig.DAOForkBlock.Cmp(block.Number()) == 0 {
applyDAOHardFork(vmdb)
Expand Down
52 changes: 15 additions & 37 deletions x/evm/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/evmos/ethermint/x/evm/keeper"

sdkmath "cosmossdk.io/math"
"github.com/cosmos/gogoproto/proto"
storetypes "cosmossdk.io/store/types"

abci "github.com/cometbft/cometbft/abci/types"
tmjson "github.com/cometbft/cometbft/libs/json"
Expand All @@ -36,7 +36,6 @@ import (
"github.com/evmos/ethermint/crypto/ethsecp256k1"
"github.com/evmos/ethermint/tests"
ethermint "github.com/evmos/ethermint/types"
"github.com/evmos/ethermint/x/evm"
"github.com/evmos/ethermint/x/evm/statedb"
"github.com/evmos/ethermint/x/evm/types"

Expand All @@ -51,7 +50,7 @@ type EvmTestSuite struct {
suite.Suite

ctx sdk.Context
handler sdk.Handler
server types.MsgServer
app *app.EthermintApp
codec codec.Codec
chainID *big.Int
Expand Down Expand Up @@ -114,15 +113,15 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {

// Initialize the chain
suite.app.InitChain(
abci.RequestInitChain{
&abci.RequestInitChain{
ChainId: "ethermint_9000-1",
Validators: []abci.ValidatorUpdate{},
ConsensusParams: app.DefaultConsensusParams,
AppStateBytes: stateBytes,
},
)

suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
suite.ctx = suite.app.BaseApp.NewContext(checkTx).WithBlockHeader(tmproto.Header{
Height: 1,
ChainID: "ethermint_9000-1",
Time: time.Now().UTC(),
Expand Down Expand Up @@ -157,7 +156,7 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
suite.app.AccountKeeper.SetAccount(suite.ctx, acc)

valAddr := sdk.ValAddress(address.Bytes())
validator, err := stakingtypes.NewValidator(valAddr, priv.PubKey(), stakingtypes.Description{})
validator, err := stakingtypes.NewValidator(valAddr.String(), priv.PubKey(), stakingtypes.Description{})
require.NoError(t, err)

err = suite.app.StakingKeeper.SetValidatorByConsAddr(suite.ctx, validator)
Expand All @@ -167,7 +166,6 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
suite.app.StakingKeeper.SetValidator(suite.ctx, validator)

suite.ethSigner = ethtypes.LatestSignerForChainID(suite.app.EvmKeeper.ChainID())
suite.handler = evm.NewHandler(suite.app.EvmKeeper)
}

func (suite *EvmTestSuite) SetupTest() {
Expand All @@ -181,7 +179,7 @@ func (suite *EvmTestSuite) SignTx(tx *types.MsgEthereumTx) {
}

func (suite *EvmTestSuite) StateDB() *statedb.StateDB {
return statedb.New(suite.ctx, suite.app.EvmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes())))
return statedb.New(suite.ctx, suite.app.EvmKeeper, statedb.NewEmptyTxConfig(common.BytesToHash(suite.ctx.HeaderHash())))
}

func TestEvmTestSuite(t *testing.T) {
Expand Down Expand Up @@ -241,7 +239,7 @@ func (suite *EvmTestSuite) TestHandleMsgEthereumTx() {
suite.SetupTest() // reset
//nolint
tc.malleate()
res, err := suite.handler(suite.ctx, tx)
res, err := suite.server.EthereumTx(suite.ctx, tx)

//nolint
if tc.expPass {
Expand Down Expand Up @@ -282,14 +280,9 @@ func (suite *EvmTestSuite) TestHandlerLogs() {
tx := types.NewTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil)
suite.SignTx(tx)

result, err := suite.handler(suite.ctx, tx)
txResponse, err := suite.server.EthereumTx(suite.ctx, tx)
suite.Require().NoError(err, "failed to handle eth tx msg")

var txResponse types.MsgEthereumTxResponse

err = proto.Unmarshal(result.Data, &txResponse)
suite.Require().NoError(err, "failed to decode result data")

suite.Require().Equal(len(txResponse.Logs), 1)
suite.Require().Equal(len(txResponse.Logs[0].Topics), 2)
}
Expand Down Expand Up @@ -357,13 +350,8 @@ func (suite *EvmTestSuite) TestDeployAndCallContract() {
tx := types.NewTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil)
suite.SignTx(tx)

result, err := suite.handler(suite.ctx, tx)
res, err := suite.server.EthereumTx(suite.ctx, tx)
suite.Require().NoError(err, "failed to handle eth tx msg")

var res types.MsgEthereumTxResponse

err = proto.Unmarshal(result.Data, &res)
suite.Require().NoError(err, "failed to decode result data")
suite.Require().Equal(res.VmError, "", "failed to handle eth tx msg")

// store - changeOwner
Expand All @@ -376,23 +364,17 @@ func (suite *EvmTestSuite) TestDeployAndCallContract() {
tx = types.NewTx(suite.chainID, 2, &receiver, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil)
suite.SignTx(tx)

result, err = suite.handler(suite.ctx, tx)
res, err = suite.server.EthereumTx(suite.ctx, tx)
suite.Require().NoError(err, "failed to handle eth tx msg")

err = proto.Unmarshal(result.Data, &res)
suite.Require().NoError(err, "failed to decode result data")
suite.Require().Equal(res.VmError, "", "failed to handle eth tx msg")

// query - getOwner
bytecode = common.FromHex("0x893d20e8")
tx = types.NewTx(suite.chainID, 2, &receiver, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil)
suite.SignTx(tx)

result, err = suite.handler(suite.ctx, tx)
res, err = suite.server.EthereumTx(suite.ctx, tx)
suite.Require().NoError(err, "failed to handle eth tx msg")

err = proto.Unmarshal(result.Data, &res)
suite.Require().NoError(err, "failed to decode result data")
suite.Require().Equal(res.VmError, "", "failed to handle eth tx msg")

// FIXME: correct owner?
Expand All @@ -408,7 +390,7 @@ func (suite *EvmTestSuite) TestSendTransaction() {
tx := types.NewTx(suite.chainID, 1, &common.Address{0x1}, big.NewInt(1), gasLimit, gasPrice, nil, nil, nil, nil)
suite.SignTx(tx)

result, err := suite.handler(suite.ctx, tx)
result, err := suite.server.EthereumTx(suite.ctx, tx)
suite.Require().NoError(err)
suite.Require().NotNil(result)
}
Expand Down Expand Up @@ -470,7 +452,7 @@ func (suite *EvmTestSuite) TestOutOfGasWhenDeployContract() {

// Deploy contract - Owner.sol
gasLimit := uint64(1)
suite.ctx = suite.ctx.WithGasMeter(sdk.NewGasMeter(gasLimit))
suite.ctx = suite.ctx.WithGasMeter(storetypes.NewGasMeter(gasLimit))
gasPrice := big.NewInt(10000)

bytecode := common.FromHex("0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a36102c4806100dc6000396000f3fe608060405234801561001057600080fd5b5060043610610053576000357c010000000000000000000000000000000000000000000000000000000090048063893d20e814610058578063a6f9dae1146100a2575b600080fd5b6100606100e6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100e4600480360360208110156100b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061010f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146101d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616c6c6572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fea265627a7a72315820f397f2733a89198bc7fed0764083694c5b828791f39ebcbc9e414bccef14b48064736f6c63430005100032")
Expand All @@ -485,7 +467,7 @@ func (suite *EvmTestSuite) TestOutOfGasWhenDeployContract() {
}
}()

suite.handler(suite.ctx, tx)
suite.server.EthereumTx(suite.ctx, tx)
suite.Require().Fail("panic did not happen")
}

Expand All @@ -498,11 +480,7 @@ func (suite *EvmTestSuite) TestErrorWhenDeployContract() {
tx := types.NewTx(suite.chainID, 1, nil, big.NewInt(0), gasLimit, gasPrice, nil, nil, bytecode, nil)
suite.SignTx(tx)

result, _ := suite.handler(suite.ctx, tx)
var res types.MsgEthereumTxResponse

_ = proto.Unmarshal(result.Data, &res)

res, _ := suite.server.EthereumTx(suite.ctx, tx)
suite.Require().Equal("invalid opcode: opcode 0xa6 not defined", res.VmError, "correct evm error")

// TODO: snapshot checking
Expand Down
2 changes: 1 addition & 1 deletion x/evm/keeper/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func (suite *KeeperTestSuite) TestEndBlock() {
em := suite.ctx.EventManager()
suite.Require().Equal(0, len(em.Events()))

res := suite.app.EvmKeeper.EndBlock(suite.ctx, types.RequestEndBlock{})
res := suite.app.EvmKeeper.EndBlock(suite.ctx)
suite.Require().Equal([]types.ValidatorUpdate{}, res)

// should emit 1 EventTypeBlockBloom event on EndBlock
Expand Down
2 changes: 1 addition & 1 deletion x/evm/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (suite *KeeperTestSuite) TestQueryTxLogs() {
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
suite.SetupTest() // reset

vmdb := statedb.New(suite.ctx, suite.app.EvmKeeper, statedb.NewTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()), txHash, txIndex, logIndex))
vmdb := statedb.New(suite.ctx, suite.app.EvmKeeper, statedb.NewTxConfig(common.BytesToHash(suite.ctx.HeaderHash()), txHash, txIndex, logIndex))
tc.malleate(vmdb)
suite.Require().NoError(vmdb.Commit())

Expand Down
2 changes: 1 addition & 1 deletion x/evm/keeper/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (suite *KeeperTestSuite) TestEvmHooks() {
ctx := suite.ctx
txHash := common.BigToHash(big.NewInt(1))
vmdb := statedb.New(ctx, k, statedb.NewTxConfig(
common.BytesToHash(ctx.HeaderHash().Bytes()),
common.BytesToHash(ctx.HeaderHash()),
txHash,
0,
0,
Expand Down
32 changes: 20 additions & 12 deletions x/evm/keeper/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"github.com/evmos/ethermint/testutil"
"github.com/evmos/ethermint/x/feemarket/types"

dbm "github.com/cosmos/cosmos-db"
abci "github.com/cometbft/cometbft/abci/types"
"cosmossdk.io/log"
abci "github.com/cometbft/cometbft/abci/types"
dbm "github.com/cosmos/cosmos-db"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
Expand Down Expand Up @@ -98,8 +98,8 @@ var _ = Describe("Feemarket", func() {
p := malleate()
to := tests.GenerateAddress()
msgEthereumTx := buildEthTx(privKey, &to, p.gasLimit, p.gasPrice, p.gasFeeCap, p.gasTipCap, p.accesses)
res := deliverEthTx(privKey, msgEthereumTx)
Expect(res.IsOK()).To(Equal(true), "transaction should have succeeded", res.GetLog())
_, err := deliverEthTx(privKey, msgEthereumTx)
Expect(err).To(BeNil(), "transaction should have succeeded")
},
Entry("legacy tx", func() txParams {
return txParams{100000, big.NewInt(baseFee), nil, nil, nil}
Expand Down Expand Up @@ -191,7 +191,7 @@ func setupChain(localMinGasPricesStr string) {

// Initialize the chain
newapp.InitChain(
abci.RequestInitChain{
&abci.RequestInitChain{
ChainId: app.ChainID,
Validators: []abci.ValidatorUpdate{},
AppStateBytes: stateBytes,
Expand Down Expand Up @@ -278,13 +278,21 @@ func prepareEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgEthereu
func checkEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgEthereumTx) abci.ResponseCheckTx {
bz := prepareEthTx(priv, msgEthereumTx)
req := abci.RequestCheckTx{Tx: bz}
res := s.app.BaseApp.CheckTx(req)
return res
res, err := s.app.BaseApp.CheckTx(&req)
if err != nil {
panic(err)
}

return *res
}

func deliverEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgEthereumTx) abci.ExecTxResult {
bz := prepareEthTx(priv, msgEthereumTx)
req := abci.RequestDeliverTx{Tx: bz}
res := s.app.BaseApp.DeliverTx(req)
return res
func deliverEthTx(priv *ethsecp256k1.PrivKey, msgEthereumTx *evmtypes.MsgEthereumTx) (*evmtypes.MsgEthereumTxResponse, error) {
//bz := prepareEthTx(priv, msgEthereumTx)
//req := abci.RequestDeliverTx{Tx: bz}
ctx := sdk.WrapSDKContext(s.app.NewContext(false))
res, err := s.app.EvmKeeper.EthereumTx(ctx, msgEthereumTx)
if err != nil {
return nil, err
}
return res, nil
}
Loading

0 comments on commit a587955

Please sign in to comment.