From 0921c863e7dfef1010ac43e9ebd166cba46c08d2 Mon Sep 17 00:00:00 2001 From: noot <36753753+noot@users.noreply.github.com> Date: Thu, 18 Jun 2020 16:35:06 -0400 Subject: [PATCH] update uncles return (#337) --- rpc/eth_api.go | 2 +- tests/rpc_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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{})) }