all: switch gas limits from big.Int to uint64

This commit is contained in:
Péter Szilágyi
2017-11-13 13:47:27 +02:00
parent b8caba9709
commit 6f69cdd109
82 changed files with 606 additions and 642 deletions

View File

@ -77,8 +77,8 @@ type btHeader struct {
UncleHash common.Hash
ExtraData []byte
Difficulty *big.Int
GasLimit *big.Int
GasUsed *big.Int
GasLimit uint64
GasUsed uint64
Timestamp *big.Int
}
@ -86,8 +86,8 @@ type btHeaderMarshaling struct {
ExtraData hexutil.Bytes
Number *math.HexOrDecimal256
Difficulty *math.HexOrDecimal256
GasLimit *math.HexOrDecimal256
GasUsed *math.HexOrDecimal256
GasLimit *math.HexOrDecimal64
GasUsed *math.HexOrDecimal64
Timestamp *math.HexOrDecimal256
}
@ -141,8 +141,8 @@ func (t *BlockTest) genesis(config *params.ChainConfig) *core.Genesis {
Timestamp: t.json.Genesis.Timestamp.Uint64(),
ParentHash: t.json.Genesis.ParentHash,
ExtraData: t.json.Genesis.ExtraData,
GasLimit: t.json.Genesis.GasLimit.Uint64(),
GasUsed: t.json.Genesis.GasUsed.Uint64(),
GasLimit: t.json.Genesis.GasLimit,
GasUsed: t.json.Genesis.GasUsed,
Difficulty: t.json.Genesis.Difficulty,
Mixhash: t.json.Genesis.MixHash,
Coinbase: t.json.Genesis.Coinbase,
@ -234,11 +234,11 @@ func validateHeader(h *btHeader, h2 *types.Header) error {
if h.Difficulty.Cmp(h2.Difficulty) != 0 {
return fmt.Errorf("Difficulty: want: %v have: %v", h.Difficulty, h2.Difficulty)
}
if h.GasLimit.Cmp(h2.GasLimit) != 0 {
return fmt.Errorf("GasLimit: want: %v have: %v", h.GasLimit, h2.GasLimit)
if h.GasLimit != h2.GasLimit {
return fmt.Errorf("GasLimit: want: %d have: %d", h.GasLimit, h2.GasLimit)
}
if h.GasUsed.Cmp(h2.GasUsed) != 0 {
return fmt.Errorf("GasUsed: want: %v have: %v", h.GasUsed, h2.GasUsed)
if h.GasUsed != h2.GasUsed {
return fmt.Errorf("GasUsed: want: %d have: %d", h.GasUsed, h2.GasUsed)
}
if h.Timestamp.Cmp(h2.Time) != 0 {
return fmt.Errorf("Timestamp: want: %v have: %v", h.Timestamp, h2.Time)