evm: fix get storage (#375)

This commit is contained in:
Federico Kunze Küllmer 2021-07-27 10:33:56 -04:00 committed by GitHub
parent 8491ae3c64
commit bc2a2eb8f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 22 deletions

View File

@ -154,13 +154,6 @@ func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*typ
) )
} }
if ethermint.IsEmptyHash(req.Key) {
return nil, status.Errorf(
codes.InvalidArgument,
types.ErrEmptyHash.Error(),
)
}
ctx := sdk.UnwrapSDKContext(c) ctx := sdk.UnwrapSDKContext(c)
k.WithContext(ctx) k.WithContext(ctx)
@ -170,12 +163,6 @@ func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*typ
state := k.GetState(address, key) state := k.GetState(address, key)
stateHex := state.Hex() stateHex := state.Hex()
if ethermint.IsEmptyHash(stateHex) {
return nil, status.Error(
codes.NotFound, "contract code not found for given address",
)
}
return &types.QueryStorageResponse{ return &types.QueryStorageResponse{
Value: stateHex, Value: stateHex,
}, nil }, nil

View File

@ -271,15 +271,6 @@ func (suite *KeeperTestSuite) TestQueryStorage() {
}, },
false, false,
}, },
{"empty hash",
func() {
req = &types.QueryStorageRequest{
Address: suite.address.String(),
Key: ethcmn.Hash{}.String(),
}
},
false,
},
{ {
"success", "success",
func() { func() {