update uncles return (#337)

This commit is contained in:
noot 2020-06-18 16:35:06 -04:00 committed by GitHub
parent 9f573690a6
commit 0921c863e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -545,7 +545,7 @@ func formatBlock(
"gasUsed": (*hexutil.Big)(gasUsed), "gasUsed": (*hexutil.Big)(gasUsed),
"timestamp": hexutil.Uint64(header.Time.Unix()), "timestamp": hexutil.Uint64(header.Time.Unix()),
"transactions": transactions.([]common.Hash), "transactions": transactions.([]common.Hash),
"uncles": nil, "uncles": []string{},
} }
} }

View File

@ -763,4 +763,5 @@ func TestEth_GetBlockByNumber(t *testing.T) {
err := json.Unmarshal(rpcRes.Result, &block) err := json.Unmarshal(rpcRes.Result, &block)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, "0x0", block["extraData"].(string)) require.Equal(t, "0x0", block["extraData"].(string))
require.Equal(t, []interface{}{}, block["uncles"].([]interface{}))
} }