aboutsummaryrefslogtreecommitdiffstats
path: root/tests/block_test_util.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-04-01 19:42:19 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-04-01 19:42:19 +0800
commitc58079461bafe508bea9233e2b81852df5188f57 (patch)
tree33d4c6a96eed3bf1ce9f69bbef3cbc1561f2b114 /tests/block_test_util.go
parent10d3466c934bd425a8c941270749a652a588527d (diff)
parent1f3596c25af077a3303c554ee6b49404b20f7117 (diff)
downloadgo-tangerine-c58079461bafe508bea9233e2b81852df5188f57.tar.gz
go-tangerine-c58079461bafe508bea9233e2b81852df5188f57.tar.zst
go-tangerine-c58079461bafe508bea9233e2b81852df5188f57.zip
Merge pull request #2281 from obscuren/configurable-genesis
core: homestead chain configuration & artificial gas floor target mining flag
Diffstat (limited to 'tests/block_test_util.go')
-rw-r--r--tests/block_test_util.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go
index f517eddd1..482a9ae0a 100644
--- a/tests/block_test_util.go
+++ b/tests/block_test_util.go
@@ -108,7 +108,7 @@ type btTransaction struct {
Value string
}
-func RunBlockTestWithReader(r io.Reader, skipTests []string) error {
+func RunBlockTestWithReader(homesteadBlock *big.Int, r io.Reader, skipTests []string) error {
btjs := make(map[string]*btJSON)
if err := readJson(r, &btjs); err != nil {
return err
@@ -119,13 +119,13 @@ func RunBlockTestWithReader(r io.Reader, skipTests []string) error {
return err
}
- if err := runBlockTests(bt, skipTests); err != nil {
+ if err := runBlockTests(homesteadBlock, bt, skipTests); err != nil {
return err
}
return nil
}
-func RunBlockTest(file string, skipTests []string) error {
+func RunBlockTest(homesteadBlock *big.Int, file string, skipTests []string) error {
btjs := make(map[string]*btJSON)
if err := readJsonFile(file, &btjs); err != nil {
return err
@@ -135,13 +135,13 @@ func RunBlockTest(file string, skipTests []string) error {
if err != nil {
return err
}
- if err := runBlockTests(bt, skipTests); err != nil {
+ if err := runBlockTests(homesteadBlock, bt, skipTests); err != nil {
return err
}
return nil
}
-func runBlockTests(bt map[string]*BlockTest, skipTests []string) error {
+func runBlockTests(homesteadBlock *big.Int, bt map[string]*BlockTest, skipTests []string) error {
skipTest := make(map[string]bool, len(skipTests))
for _, name := range skipTests {
skipTest[name] = true
@@ -153,7 +153,7 @@ func runBlockTests(bt map[string]*BlockTest, skipTests []string) error {
continue
}
// test the block
- if err := runBlockTest(test); err != nil {
+ if err := runBlockTest(homesteadBlock, test); err != nil {
return fmt.Errorf("%s: %v", name, err)
}
glog.Infoln("Block test passed: ", name)
@@ -162,7 +162,7 @@ func runBlockTests(bt map[string]*BlockTest, skipTests []string) error {
return nil
}
-func runBlockTest(test *BlockTest) error {
+func runBlockTest(homesteadBlock *big.Int, test *BlockTest) error {
ks := crypto.NewKeyStorePassphrase(filepath.Join(common.DefaultDataDir(), "keystore"), crypto.StandardScryptN, crypto.StandardScryptP)
am := accounts.NewManager(ks)
db, _ := ethdb.NewMemDatabase()
@@ -174,6 +174,7 @@ func runBlockTest(test *BlockTest) error {
}
cfg := &eth.Config{
+ ChainConfig: &core.ChainConfig{HomesteadBlock: homesteadBlock},
TestGenesisState: db,
TestGenesisBlock: test.Genesis,
Etherbase: common.Address{},