diff --git a/rpc/eth_api.go b/rpc/eth_api.go index ede966dc..3266cc07 100644 --- a/rpc/eth_api.go +++ b/rpc/eth_api.go @@ -545,7 +545,7 @@ func formatBlock( "gasUsed": (*hexutil.Big)(gasUsed), "timestamp": hexutil.Uint64(header.Time.Unix()), "transactions": transactions.([]common.Hash), - "uncles": nil, + "uncles": []string{}, } } diff --git a/tests/rpc_test.go b/tests/rpc_test.go index 4da6d83e..1c784508 100644 --- a/tests/rpc_test.go +++ b/tests/rpc_test.go @@ -763,4 +763,5 @@ func TestEth_GetBlockByNumber(t *testing.T) { err := json.Unmarshal(rpcRes.Result, &block) require.NoError(t, err) require.Equal(t, "0x0", block["extraData"].(string)) + require.Equal(t, []interface{}{}, block["uncles"].([]interface{})) }