Unverified Commit d379e3f6 authored by Felix Lange's avatar Felix Lange Committed by GitHub

ethclient/gethclient: ensure getProof keys parameter is not null (#26409)

Other clients do not accept a parameter value of null for this array.
parent b748709a
...@@ -96,6 +96,11 @@ func (ec *Client) GetProof(ctx context.Context, account common.Address, keys []s ...@@ -96,6 +96,11 @@ func (ec *Client) GetProof(ctx context.Context, account common.Address, keys []s
StorageProof []storageResult `json:"storageProof"` StorageProof []storageResult `json:"storageProof"`
} }
// Avoid keys being 'null'.
if keys == nil {
keys = []string{}
}
var res accountResult var res accountResult
err := ec.c.CallContext(ctx, &res, "eth_getProof", account, keys, toBlockNumArg(blockNumber)) err := ec.c.CallContext(ctx, &res, "eth_getProof", account, keys, toBlockNumArg(blockNumber))
// Turn hexutils back to normal datatypes // Turn hexutils back to normal datatypes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment