aboutsummaryrefslogtreecommitdiff
path: root/internal/ethapi/api.go
diff options
context:
space:
mode:
authoraaronbuchwald <[email protected]>2020-11-19 10:39:57 -0500
committerGitHub <[email protected]>2020-11-19 10:39:57 -0500
commit59453f4676ae1d778a32fd9a4edcc94d74747e14 (patch)
tree099426cdaad4d80a15c3d7ff8229146faf102139 /internal/ethapi/api.go
parent2a52b64b2f94602ac02df458e9ba66e43fd57489 (diff)
parent5337f45e5469c3240d6917d0ec47a7d9b93ae9ea (diff)
Merge pull request #57 from ava-labs/block_extra_data
add block extra data to eth_getBlockByNumber
Diffstat (limited to 'internal/ethapi/api.go')
-rw-r--r--internal/ethapi/api.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index d894ea0..77efcab 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -1161,6 +1161,10 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool) (map[string]i
fields := RPCMarshalHeader(block.Header())
fields["size"] = hexutil.Uint64(block.Size())
+ if len(block.ExtraData()) != 0 {
+ fields["blockExtraData"] = hexutil.Encode(block.ExtraData())
+ }
+
if inclTx {
formatTx := func(tx *types.Transaction) (interface{}, error) {
return tx.Hash(), nil