diff options
author | Felix Lange <fjl@twurst.com> | 2016-10-06 22:19:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-06 22:19:53 +0800 |
commit | eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad (patch) | |
tree | 092de74597c335d666af44b44f645b2ed597174f /core | |
parent | 7335a70a020517cc9cebe7ae82c0e49ba133abf1 (diff) | |
parent | 1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4 (diff) | |
download | dexon-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar dexon-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar.gz dexon-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar.bz2 dexon-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar.lz dexon-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar.xz dexon-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.tar.zst dexon-eeb2a1a6e3c7a0c77ee6836f3103708cff4102ad.zip |
Merge pull request #3094 from fjl/tests-update
tests: update test files from github.com/ethereum/tests @ 45bc1d21d3c1
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 280270ac8..ab14ae156 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) } |