all: switch gas limits from big.Int to uint64
This commit is contained in:
@ -29,8 +29,8 @@ func (b btHeader) MarshalJSON() ([]byte, error) {
|
||||
UncleHash common.Hash
|
||||
ExtraData hexutil.Bytes
|
||||
Difficulty *math.HexOrDecimal256
|
||||
GasLimit *math.HexOrDecimal256
|
||||
GasUsed *math.HexOrDecimal256
|
||||
GasLimit math.HexOrDecimal64
|
||||
GasUsed math.HexOrDecimal64
|
||||
Timestamp *math.HexOrDecimal256
|
||||
}
|
||||
var enc btHeader
|
||||
@ -47,8 +47,8 @@ func (b btHeader) MarshalJSON() ([]byte, error) {
|
||||
enc.UncleHash = b.UncleHash
|
||||
enc.ExtraData = b.ExtraData
|
||||
enc.Difficulty = (*math.HexOrDecimal256)(b.Difficulty)
|
||||
enc.GasLimit = (*math.HexOrDecimal256)(b.GasLimit)
|
||||
enc.GasUsed = (*math.HexOrDecimal256)(b.GasUsed)
|
||||
enc.GasLimit = (math.HexOrDecimal64)(b.GasLimit)
|
||||
enc.GasUsed = (math.HexOrDecimal64)(b.GasUsed)
|
||||
enc.Timestamp = (*math.HexOrDecimal256)(b.Timestamp)
|
||||
return json.Marshal(&enc)
|
||||
}
|
||||
@ -68,8 +68,8 @@ func (b *btHeader) UnmarshalJSON(input []byte) error {
|
||||
UncleHash *common.Hash
|
||||
ExtraData hexutil.Bytes
|
||||
Difficulty *math.HexOrDecimal256
|
||||
GasLimit *math.HexOrDecimal256
|
||||
GasUsed *math.HexOrDecimal256
|
||||
GasLimit *math.HexOrDecimal64
|
||||
GasUsed *math.HexOrDecimal64
|
||||
Timestamp *math.HexOrDecimal256
|
||||
}
|
||||
var dec btHeader
|
||||
@ -116,10 +116,10 @@ func (b *btHeader) UnmarshalJSON(input []byte) error {
|
||||
b.Difficulty = (*big.Int)(dec.Difficulty)
|
||||
}
|
||||
if dec.GasLimit != nil {
|
||||
b.GasLimit = (*big.Int)(dec.GasLimit)
|
||||
b.GasLimit = uint64(*dec.GasLimit)
|
||||
}
|
||||
if dec.GasUsed != nil {
|
||||
b.GasUsed = (*big.Int)(dec.GasUsed)
|
||||
b.GasUsed = uint64(*dec.GasUsed)
|
||||
}
|
||||
if dec.Timestamp != nil {
|
||||
b.Timestamp = (*big.Int)(dec.Timestamp)
|
||||
|
Reference in New Issue
Block a user