aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Stock <todd@avalabs.org>2020-11-21 11:55:20 -0500
committerTodd Stock <todd@avalabs.org>2020-11-21 11:55:20 -0500
commit0686a2ed5af2da04f06b8ebae9a4cbe0d9f2b212 (patch)
tree79c327752ce2d2f95ee6c2b8dd1d518de634faf9
parent244825095f38eadfe5687c2f226c5901088be3d3 (diff)
use byte array
-rw-r--r--ethclient/ethclient.go4
-rw-r--r--internal/ethapi/api.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go
index ed02182..dfd260c 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"`
- ExtraData *[]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.ExtraData), 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 77efcab..cb1b4bd 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -1162,7 +1162,7 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool) (map[string]i
fields["size"] = hexutil.Uint64(block.Size())
if len(block.ExtraData()) != 0 {
- fields["blockExtraData"] = hexutil.Encode(block.ExtraData())
+ fields["blockExtraData"] = block.ExtraData()
}
if inclTx {