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

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekunze committed Jan 5, 2022
1 parent 73c8340 commit ac2fa40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 2 additions & 4 deletions x/evm/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ func (suite *KeeperTestSuite) TestQueryCode() {
}

func (suite *KeeperTestSuite) TestQueryTxLogs() {
var (
expLogs []*types.Log
)
var expLogs []*types.Log
txHash := common.BytesToHash([]byte("tx_hash"))
txIndex := uint(1)
logIndex := uint(1)
Expand Down Expand Up @@ -593,7 +591,7 @@ func (suite *KeeperTestSuite) TestEstimateGas() {
rsp, err := suite.queryClient.EstimateGas(sdk.WrapSDKContext(suite.ctx), &req)
if tc.expPass {
suite.Require().NoError(err)
suite.Require().Equal(tc.expGas, rsp.Gas)
suite.Require().Equal(int64(tc.expGas), int64(rsp.Gas))
} else {
suite.Require().Error(err)
}
Expand Down
7 changes: 1 addition & 6 deletions x/evm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,7 @@ func (k *Keeper) GetNonce(ctx sdk.Context, addr common.Address) uint64 {
return 0
}

ethAcct, ok := acct.(ethermint.EthAccountI)
if !ok {
return 0
}

return ethAcct.GetSequence()
return acct.GetSequence()
}

// GetBalance load account's balance of gas token
Expand Down
1 change: 1 addition & 0 deletions x/evm/keeper/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func (k *Keeper) DeleteAccount(ctx sdk.Context, addr common.Address) error {
return nil
}

// NOTE: only Ethereum accounts (contracts) can be selfdestructed
ethAcct, ok := acct.(ethermint.EthAccountI)
if !ok {
return sdkerrors.Wrapf(types.ErrInvalidAccount, "type %T, address %s", acct, addr)
Expand Down

0 comments on commit ac2fa40

Please sign in to comment.