fix: Extra data empty response (#381)

This commit is contained in:
crypto-facs 2021-07-29 19:40:59 +02:00 committed by GitHub
parent 63aa0de1e8
commit c4aa8fafab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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),

View File

@ -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{}))
}