aboutsummaryrefslogtreecommitdiffstats
path: root/tests/difficulty_test_util.go
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2019-04-03 04:28:48 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-04-08 17:00:42 +0800
commitaf401d03a395c21fdb297edb687edf8af3470cb2 (patch)
treed2ee3476c9005ffe1aca7abbe7152765da0efe32 /tests/difficulty_test_util.go
parent80a2a35bc3aaf208b5f91a1fb1d803975d4bb01c (diff)
downloadgo-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar
go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.gz
go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.bz2
go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.lz
go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.xz
go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.tar.zst
go-tangerine-af401d03a395c21fdb297edb687edf8af3470cb2.zip
all: simplify timestamps to uint64 (#19372)
* all: simplify timestamps to uint64 * tests: update definitions * clef, faucet, mobile: leftover uint64 fixups * ethash: fix tests * graphql: update schema for timestamp * ethash: remove unused variable
Diffstat (limited to 'tests/difficulty_test_util.go')
-rw-r--r--tests/difficulty_test_util.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/difficulty_test_util.go b/tests/difficulty_test_util.go
index 00d699cf7..fe6e90b02 100644
--- a/tests/difficulty_test_util.go
+++ b/tests/difficulty_test_util.go
@@ -30,18 +30,18 @@ import (
//go:generate gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go
type DifficultyTest struct {
- ParentTimestamp *big.Int `json:"parentTimestamp"`
+ ParentTimestamp uint64 `json:"parentTimestamp"`
ParentDifficulty *big.Int `json:"parentDifficulty"`
UncleHash common.Hash `json:"parentUncles"`
- CurrentTimestamp *big.Int `json:"currentTimestamp"`
+ CurrentTimestamp uint64 `json:"currentTimestamp"`
CurrentBlockNumber uint64 `json:"currentBlockNumber"`
CurrentDifficulty *big.Int `json:"currentDifficulty"`
}
type difficultyTestMarshaling struct {
- ParentTimestamp *math.HexOrDecimal256
+ ParentTimestamp math.HexOrDecimal64
ParentDifficulty *math.HexOrDecimal256
- CurrentTimestamp *math.HexOrDecimal256
+ CurrentTimestamp math.HexOrDecimal64
CurrentDifficulty *math.HexOrDecimal256
UncleHash common.Hash
CurrentBlockNumber math.HexOrDecimal64
@@ -56,7 +56,7 @@ func (test *DifficultyTest) Run(config *params.ChainConfig) error {
UncleHash: test.UncleHash,
}
- actual := ethash.CalcDifficulty(config, test.CurrentTimestamp.Uint64(), parent)
+ actual := ethash.CalcDifficulty(config, test.CurrentTimestamp, parent)
exp := test.CurrentDifficulty
if actual.Cmp(exp) != 0 {