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

Other clients do not accept a parameter value of null for this array.
pull/26487/head
Felix Lange 2 years ago committed by GitHub
parent b748709a11
commit d379e3f605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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

Loading…
Cancel
Save