mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
internal/ethapi: return error code -32602 for invalid storage key
This commit is contained in:
parent
cf93077fab
commit
c31bd7cf4d
1 changed files with 2 additions and 2 deletions
|
|
@ -376,7 +376,7 @@ func (api *BlockChainAPI) GetProof(ctx context.Context, address common.Address,
|
|||
var err error
|
||||
keys[i], keyLengths[i], err = decodeHash(hexKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, &invalidParamsError{fmt.Sprintf("invalid storage key %q", hexKey)}
|
||||
}
|
||||
}
|
||||
statedb, header, err := api.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
|
||||
|
|
@ -591,7 +591,7 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address common.Addre
|
|||
}
|
||||
key, _, err := decodeHash(hexKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to decode storage key: %s", err)
|
||||
return nil, &invalidParamsError{fmt.Sprintf("invalid storage key: %q", hexKey)}
|
||||
}
|
||||
res := state.GetState(address, key)
|
||||
return res[:], state.Error()
|
||||
|
|
|
|||
Loading…
Reference in a new issue