internal/ethapi: Fix eth_getBlockReceipts

There is an issue. After marshaling rpc.BlockNumberOrHash we have e.g. {"jsonrpc":"2.0","id":3,"method":"eth_getBlockReceipts","params":[{"blockNumber":"0x2"}]} instead of {"jsonrpc":"2.0","id":3,"method":"eth_getBlockReceipts","params":["0x2"]} and invalid response.
This commit is contained in:
Andrianov Konstantin 2023-09-09 23:42:27 +03:00 committed by GitHub
parent 5cf53f51ac
commit 28c2b6a0d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,7 +111,7 @@ func (ec *Client) PeerCount(ctx context.Context) (uint64, error) {
// BlockReceipts returns the receipts of a given block number or hash
func (ec *Client) BlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]*types.Receipt, error) {
var r []*types.Receipt
err := ec.c.CallContext(ctx, &r, "eth_getBlockReceipts", blockNrOrHash)
err := ec.c.CallContext(ctx, &r, "eth_getBlockReceipts", blockNrOrHash.String())
if err == nil && r == nil {
return nil, ethereum.NotFound
}