From 6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Mon, 13 Nov 2017 13:47:27 +0200 Subject: all: switch gas limits from big.Int to uint64 --- tests/block_test_util.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/block_test_util.go') diff --git a/tests/block_test_util.go b/tests/block_test_util.go index a789e6d88..e2d1a0b43 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -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) -- cgit