diff options
author | Todd Stock <[email protected]> | 2020-11-21 12:30:06 -0500 |
---|---|---|
committer | Todd Stock <[email protected]> | 2020-11-21 12:30:06 -0500 |
commit | 7ce0588c5320894ddfae4069de45fe07d78b9f6f (patch) | |
tree | 213aa561f98772bddc44797d84d41121bc30b033 | |
parent | 7ec00e3668f99df1d041b63ebcdfb718275a52b0 (diff) |
fix ptr
-rw-r--r-- | ethclient/ethclient.go | 4 | ||||
-rw-r--r-- | internal/ethapi/api.go | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index deafa54..6c1fa8d 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -101,7 +101,7 @@ type rpcBlock struct { Transactions []rpcTransaction `json:"transactions"` UncleHashes []common.Hash `json:"uncles"` Version uint32 `json:"version"` - BlockExtraData *[]byte `json:"blockExtraData"` + BlockExtraData []byte `json:"blockExtraData"` } func (ec *Client) getBlock(ctx context.Context, method string, args ...interface{}) (*types.Block, error) { @@ -166,7 +166,7 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface } txs[i] = tx.tx } - return types.NewBlockWithHeader(head).WithBody(txs, uncles, body.Version, body.BlockExtraData), nil + return types.NewBlockWithHeader(head).WithBody(txs, uncles, body.Version, &body.BlockExtraData), nil } // HeaderByHash returns the block header with the given hash. diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index cb1b4bd..1a95d9b 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1161,9 +1161,7 @@ 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"] = block.ExtraData() - } + fields["blockExtraData"] = hexutil.Bytes(block.ExtraData()) if inclTx { formatTx := func(tx *types.Transaction) (interface{}, error) { |