From d379e3f605351cd21d0feab63077cb300298ca6e Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 12 Jan 2023 11:31:21 +0100 Subject: [PATCH] ethclient/gethclient: ensure getProof keys parameter is not null (#26409) Other clients do not accept a parameter value of null for this array. --- ethclient/gethclient/gethclient.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ethclient/gethclient/gethclient.go b/ethclient/gethclient/gethclient.go index 8211ee75ae..fdcfb9a0ac 100644 --- a/ethclient/gethclient/gethclient.go +++ b/ethclient/gethclient/gethclient.go @@ -96,6 +96,11 @@ func (ec *Client) GetProof(ctx context.Context, account common.Address, keys []s StorageProof []storageResult `json:"storageProof"` } + // Avoid keys being 'null'. + if keys == nil { + keys = []string{} + } + var res accountResult err := ec.c.CallContext(ctx, &res, "eth_getProof", account, keys, toBlockNumArg(blockNumber)) // Turn hexutils back to normal datatypes