aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-10-06 05:55:47 +0800
committerFelix Lange <fjl@twurst.com>2016-10-06 21:36:21 +0800
commit1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4 (patch)
tree0d8d9cd20dc8584599209cbce1cffae0b0e0516d /core
parent2acb9a6ea7ddab541122ede96f2275598ae36931 (diff)
downloadgo-tangerine-1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4.tar
go-tangerine-1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4.tar.gz
go-tangerine-1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4.tar.bz2
go-tangerine-1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4.tar.lz
go-tangerine-1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4.tar.xz
go-tangerine-1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4.tar.zst
go-tangerine-1b7b2ba2163c7b2b2acc0c4f107951ad873cd8a4.zip
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'.
Diffstat (limited to 'core')
-rw-r--r--core/database_util_test.go5
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)
}