diff options
author | Felix Lange <fjl@twurst.com> | 2016-10-06 05:55:47 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-10-06 22:25:17 +0800 |
commit | e97b30169b97adefa6e5067df1e307852b226583 (patch) | |
tree | 999e889d56d7435b93a964f40fd42839f248941a /core | |
parent | 438efdab282775e90ec3c6d7b6c8404b65ff19c4 (diff) | |
download | go-tangerine-e97b30169b97adefa6e5067df1e307852b226583.tar go-tangerine-e97b30169b97adefa6e5067df1e307852b226583.tar.gz go-tangerine-e97b30169b97adefa6e5067df1e307852b226583.tar.bz2 go-tangerine-e97b30169b97adefa6e5067df1e307852b226583.tar.lz go-tangerine-e97b30169b97adefa6e5067df1e307852b226583.tar.xz go-tangerine-e97b30169b97adefa6e5067df1e307852b226583.tar.zst go-tangerine-e97b30169b97adefa6e5067df1e307852b226583.zip |
[release/1.4.16] tests: update test files from github.com/ethereum/tests @ 45bc1d21d3c1
Two new tests are skipped because they're buggy. Making some newer
random state tests work required implementing the 'compressed return
value encoding'.
(cherry picked from commit 1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4)
Diffstat (limited to 'core')
-rw-r--r-- | core/database_util_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/database_util_test.go b/core/database_util_test.go index 45de75e12..3c3837163 100644 --- a/core/database_util_test.go +++ b/core/database_util_test.go @@ -62,7 +62,7 @@ func (d *diffTest) UnmarshalJSON(b []byte) (err error) { return nil } -func TestDifficultyFrontier(t *testing.T) { +func TestCalcDifficulty(t *testing.T) { file, err := os.Open("../tests/files/BasicTests/difficulty.json") if err != nil { t.Fatal(err) @@ -75,9 +75,10 @@ func TestDifficultyFrontier(t *testing.T) { t.Fatal(err) } + config := &ChainConfig{HomesteadBlock: big.NewInt(1150000)} for name, test := range tests { number := new(big.Int).Sub(test.CurrentBlocknumber, big.NewInt(1)) - diff := calcDifficultyFrontier(test.CurrentTimestamp, test.ParentTimestamp, number, test.ParentDifficulty) + diff := CalcDifficulty(config, test.CurrentTimestamp, test.ParentTimestamp, number, test.ParentDifficulty) if diff.Cmp(test.CurrentDifficulty) != 0 { t.Error(name, "failed. Expected", test.CurrentDifficulty, "and calculated", diff) } |