diff --git a/ethereum/rpc/types/utils.go b/ethereum/rpc/types/utils.go index 4aaf4149..7f1cd22f 100644 --- a/ethereum/rpc/types/utils.go +++ b/ethereum/rpc/types/utils.go @@ -168,7 +168,7 @@ func FormatBlock( "miner": validatorAddr, "mixHash": common.Hash{}, "difficulty": (*hexutil.Big)(big.NewInt(0)), - "extraData": "", + "extraData": "0x", "size": hexutil.Uint64(size), "gasLimit": hexutil.Uint64(gasLimit), // Static gas limit "gasUsed": (*hexutil.Big)(gasUsed), diff --git a/tests/rpc/rpc_test.go b/tests/rpc/rpc_test.go index 614aa35f..5a2ee1d6 100644 --- a/tests/rpc/rpc_test.go +++ b/tests/rpc/rpc_test.go @@ -909,6 +909,6 @@ func TestEth_GetBlockByNumber(t *testing.T) { block := make(map[string]interface{}) err := json.Unmarshal(rpcRes.Result, &block) require.NoError(t, err) - require.Equal(t, "0x0", block["extraData"].(string)) + require.Equal(t, "0x", block["extraData"].(string)) require.Equal(t, []interface{}{}, block["uncles"].([]interface{})) }