|
|
@ -33,7 +33,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) { |
|
|
|
GasLimit math.HexOrDecimal64 |
|
|
|
GasLimit math.HexOrDecimal64 |
|
|
|
GasUsed math.HexOrDecimal64 |
|
|
|
GasUsed math.HexOrDecimal64 |
|
|
|
Timestamp math.HexOrDecimal64 |
|
|
|
Timestamp math.HexOrDecimal64 |
|
|
|
BaseFee *math.HexOrDecimal256 |
|
|
|
BaseFeePerGas *math.HexOrDecimal256 |
|
|
|
} |
|
|
|
} |
|
|
|
var enc btHeader |
|
|
|
var enc btHeader |
|
|
|
enc.Bloom = b.Bloom |
|
|
|
enc.Bloom = b.Bloom |
|
|
@ -52,7 +52,7 @@ func (b btHeader) MarshalJSON() ([]byte, error) { |
|
|
|
enc.GasLimit = math.HexOrDecimal64(b.GasLimit) |
|
|
|
enc.GasLimit = math.HexOrDecimal64(b.GasLimit) |
|
|
|
enc.GasUsed = math.HexOrDecimal64(b.GasUsed) |
|
|
|
enc.GasUsed = math.HexOrDecimal64(b.GasUsed) |
|
|
|
enc.Timestamp = math.HexOrDecimal64(b.Timestamp) |
|
|
|
enc.Timestamp = math.HexOrDecimal64(b.Timestamp) |
|
|
|
enc.BaseFee = (*math.HexOrDecimal256)(b.BaseFee) |
|
|
|
enc.BaseFeePerGas = (*math.HexOrDecimal256)(b.BaseFeePerGas) |
|
|
|
return json.Marshal(&enc) |
|
|
|
return json.Marshal(&enc) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -75,7 +75,7 @@ func (b *btHeader) UnmarshalJSON(input []byte) error { |
|
|
|
GasLimit *math.HexOrDecimal64 |
|
|
|
GasLimit *math.HexOrDecimal64 |
|
|
|
GasUsed *math.HexOrDecimal64 |
|
|
|
GasUsed *math.HexOrDecimal64 |
|
|
|
Timestamp *math.HexOrDecimal64 |
|
|
|
Timestamp *math.HexOrDecimal64 |
|
|
|
BaseFee *math.HexOrDecimal256 |
|
|
|
BaseFeePerGas *math.HexOrDecimal256 |
|
|
|
} |
|
|
|
} |
|
|
|
var dec btHeader |
|
|
|
var dec btHeader |
|
|
|
if err := json.Unmarshal(input, &dec); err != nil { |
|
|
|
if err := json.Unmarshal(input, &dec); err != nil { |
|
|
@ -129,8 +129,8 @@ func (b *btHeader) UnmarshalJSON(input []byte) error { |
|
|
|
if dec.Timestamp != nil { |
|
|
|
if dec.Timestamp != nil { |
|
|
|
b.Timestamp = uint64(*dec.Timestamp) |
|
|
|
b.Timestamp = uint64(*dec.Timestamp) |
|
|
|
} |
|
|
|
} |
|
|
|
if dec.BaseFee != nil { |
|
|
|
if dec.BaseFeePerGas != nil { |
|
|
|
b.BaseFee = (*big.Int)(dec.BaseFee) |
|
|
|
b.BaseFeePerGas = (*big.Int)(dec.BaseFeePerGas) |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|