evm: fix get storage (#375)
This commit is contained in:
parent
8491ae3c64
commit
bc2a2eb8f3
@ -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)
|
||||
k.WithContext(ctx)
|
||||
|
||||
@ -170,12 +163,6 @@ func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*typ
|
||||
state := k.GetState(address, key)
|
||||
stateHex := state.Hex()
|
||||
|
||||
if ethermint.IsEmptyHash(stateHex) {
|
||||
return nil, status.Error(
|
||||
codes.NotFound, "contract code not found for given address",
|
||||
)
|
||||
}
|
||||
|
||||
return &types.QueryStorageResponse{
|
||||
Value: stateHex,
|
||||
}, nil
|
||||
|
@ -271,15 +271,6 @@ func (suite *KeeperTestSuite) TestQueryStorage() {
|
||||
},
|
||||
false,
|
||||
},
|
||||
{"empty hash",
|
||||
func() {
|
||||
req = &types.QueryStorageRequest{
|
||||
Address: suite.address.String(),
|
||||
Key: ethcmn.Hash{}.String(),
|
||||
}
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"success",
|
||||
func() {
|
||||
|
Loading…
Reference in New Issue
Block a user