aboutsummaryrefslogtreecommitdiff
path: root/core/types/gen_header_json.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/types/gen_header_json.go')
-rw-r--r--core/types/gen_header_json.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go
index 48b35db..385892c 100644
--- a/core/types/gen_header_json.go
+++ b/core/types/gen_header_json.go
@@ -7,8 +7,8 @@ import (
"errors"
"math/big"
- "github.com/ava-labs/go-ethereum/common"
- "github.com/ava-labs/go-ethereum/common/hexutil"
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
)
var _ = (*headerMarshaling)(nil)
@@ -31,6 +31,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
Extra hexutil.Bytes `json:"extraData" gencodec:"required"`
MixDigest common.Hash `json:"mixHash"`
Nonce BlockNonce `json:"nonce"`
+ ExtDataHash common.Hash `json:"extDataHash" gencodec:"required"`
Hash common.Hash `json:"hash"`
}
var enc Header
@@ -49,6 +50,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
enc.Extra = h.Extra
enc.MixDigest = h.MixDigest
enc.Nonce = h.Nonce
+ enc.ExtDataHash = h.ExtDataHash
enc.Hash = h.Hash()
return json.Marshal(&enc)
}
@@ -71,6 +73,7 @@ func (h *Header) UnmarshalJSON(input []byte) error {
Extra *hexutil.Bytes `json:"extraData" gencodec:"required"`
MixDigest *common.Hash `json:"mixHash"`
Nonce *BlockNonce `json:"nonce"`
+ ExtDataHash *common.Hash `json:"extDataHash" gencodec:"required"`
}
var dec Header
if err := json.Unmarshal(input, &dec); err != nil {
@@ -134,5 +137,8 @@ func (h *Header) UnmarshalJSON(input []byte) error {
if dec.Nonce != nil {
h.Nonce = *dec.Nonce
}
+ if dec.ExtDataHash != nil {
+ h.ExtDataHash = *dec.ExtDataHash
+ }
return nil
}