diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-07-11 18:55:11 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-07-16 19:30:03 +0800 |
commit | 14bad7e212011337d14e40c9f975efd096ab7418 (patch) | |
tree | 9cd51c5fd6af97deb85d1e558b836b52afec7f21 /tests/block_test_util.go | |
parent | 8c20fe17bdd78a15226a3df589e8f89b48726b6e (diff) | |
download | go-tangerine-14bad7e212011337d14e40c9f975efd096ab7418.tar go-tangerine-14bad7e212011337d14e40c9f975efd096ab7418.tar.gz go-tangerine-14bad7e212011337d14e40c9f975efd096ab7418.tar.bz2 go-tangerine-14bad7e212011337d14e40c9f975efd096ab7418.tar.lz go-tangerine-14bad7e212011337d14e40c9f975efd096ab7418.tar.xz go-tangerine-14bad7e212011337d14e40c9f975efd096ab7418.tar.zst go-tangerine-14bad7e212011337d14e40c9f975efd096ab7418.zip |
[release/1.4.10] core, params, tests: add DAO hard-fork balance moves
(cherry picked from commit 461cdb593b9e5bd9ae9ac35c68809a3a29290dcb)
Diffstat (limited to 'tests/block_test_util.go')
-rw-r--r-- | tests/block_test_util.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go index b92c183e1..30bed3402 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -103,7 +103,7 @@ type btTransaction struct { Value string } -func RunBlockTestWithReader(homesteadBlock *big.Int, r io.Reader, skipTests []string) error { +func RunBlockTestWithReader(homesteadBlock, daoForkBlock *big.Int, r io.Reader, skipTests []string) error { btjs := make(map[string]*btJSON) if err := readJson(r, &btjs); err != nil { return err @@ -114,13 +114,13 @@ func RunBlockTestWithReader(homesteadBlock *big.Int, r io.Reader, skipTests []st return err } - if err := runBlockTests(homesteadBlock, bt, skipTests); err != nil { + if err := runBlockTests(homesteadBlock, daoForkBlock, bt, skipTests); err != nil { return err } return nil } -func RunBlockTest(homesteadBlock *big.Int, file string, skipTests []string) error { +func RunBlockTest(homesteadBlock, daoForkBlock *big.Int, file string, skipTests []string) error { btjs := make(map[string]*btJSON) if err := readJsonFile(file, &btjs); err != nil { return err @@ -130,13 +130,13 @@ func RunBlockTest(homesteadBlock *big.Int, file string, skipTests []string) erro if err != nil { return err } - if err := runBlockTests(homesteadBlock, bt, skipTests); err != nil { + if err := runBlockTests(homesteadBlock, daoForkBlock, bt, skipTests); err != nil { return err } return nil } -func runBlockTests(homesteadBlock *big.Int, bt map[string]*BlockTest, skipTests []string) error { +func runBlockTests(homesteadBlock, daoForkBlock *big.Int, bt map[string]*BlockTest, skipTests []string) error { skipTest := make(map[string]bool, len(skipTests)) for _, name := range skipTests { skipTest[name] = true @@ -148,7 +148,7 @@ func runBlockTests(homesteadBlock *big.Int, bt map[string]*BlockTest, skipTests continue } // test the block - if err := runBlockTest(homesteadBlock, test); err != nil { + if err := runBlockTest(homesteadBlock, daoForkBlock, test); err != nil { return fmt.Errorf("%s: %v", name, err) } glog.Infoln("Block test passed: ", name) @@ -157,7 +157,7 @@ func runBlockTests(homesteadBlock *big.Int, bt map[string]*BlockTest, skipTests return nil } -func runBlockTest(homesteadBlock *big.Int, test *BlockTest) error { +func runBlockTest(homesteadBlock, daoForkBlock *big.Int, test *BlockTest) error { // import pre accounts & construct test genesis block & state root db, _ := ethdb.NewMemDatabase() if _, err := test.InsertPreState(db); err != nil { @@ -169,7 +169,7 @@ func runBlockTest(homesteadBlock *big.Int, test *BlockTest) error { core.WriteCanonicalHash(db, test.Genesis.Hash(), test.Genesis.NumberU64()) core.WriteHeadBlockHash(db, test.Genesis.Hash()) evmux := new(event.TypeMux) - config := &core.ChainConfig{HomesteadBlock: homesteadBlock} + config := &core.ChainConfig{HomesteadBlock: homesteadBlock, DAOForkBlock: daoForkBlock, DAOForkSupport: true} chain, err := core.NewBlockChain(db, config, ethash.NewShared(), evmux) if err != nil { return err |