aboutsummaryrefslogtreecommitdiffstats
path: root/tests/block_test_util.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-11-13 19:47:27 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-03 20:45:35 +0800
commit6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (patch)
treec92974f8b82209073ad1ee3faec6e149f834bf69 /tests/block_test_util.go
parentb8caba97099ee5eed33c3b80dd4ea540722e7d8f (diff)
downloaddexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.gz
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.bz2
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.lz
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.xz
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.tar.zst
dexon-6f69cdd109b1dd692b8dfb15e7c53d2051fbc946.zip
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'tests/block_test_util.go')
-rw-r--r--tests/block_test_util.go20
1 files changed, 10 insertions, 10 deletions
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)