diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-10-15 00:32:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-15 00:32:11 +0800 |
commit | 81b01f1c2bba8340f9cf2bf1da8ef131e3decd50 (patch) | |
tree | 0b2269cb3dfa9719cf3bf7a828c49b0c1ffccab8 /tests/block_test_util.go | |
parent | a4d9e63d12c80a14294c0d085de6bf711ceec779 (diff) | |
parent | 64af2aafdaf16d0bab4c2b89573324b076602bab (diff) | |
download | dexon-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar dexon-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.gz dexon-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.bz2 dexon-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.lz dexon-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.xz dexon-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.tar.zst dexon-81b01f1c2bba8340f9cf2bf1da8ef131e3decd50.zip |
Merge pull request #3111 from obscuren/gas-price-fork
core, core/vm: added gas price variance table (EIP #150)
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 7096b866d..010c8d4c0 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -104,7 +104,7 @@ type btTransaction struct { Value string } -func RunBlockTestWithReader(homesteadBlock, daoForkBlock *big.Int, r io.Reader, skipTests []string) error { +func RunBlockTestWithReader(homesteadBlock, daoForkBlock, gasPriceFork *big.Int, r io.Reader, skipTests []string) error { btjs := make(map[string]*btJSON) if err := readJson(r, &btjs); err != nil { return err @@ -115,13 +115,13 @@ func RunBlockTestWithReader(homesteadBlock, daoForkBlock *big.Int, r io.Reader, return err } - if err := runBlockTests(homesteadBlock, daoForkBlock, bt, skipTests); err != nil { + if err := runBlockTests(homesteadBlock, daoForkBlock, gasPriceFork, bt, skipTests); err != nil { return err } return nil } -func RunBlockTest(homesteadBlock, daoForkBlock *big.Int, file string, skipTests []string) error { +func RunBlockTest(homesteadBlock, daoForkBlock, gasPriceFork *big.Int, file string, skipTests []string) error { btjs := make(map[string]*btJSON) if err := readJsonFile(file, &btjs); err != nil { return err @@ -131,13 +131,13 @@ func RunBlockTest(homesteadBlock, daoForkBlock *big.Int, file string, skipTests if err != nil { return err } - if err := runBlockTests(homesteadBlock, daoForkBlock, bt, skipTests); err != nil { + if err := runBlockTests(homesteadBlock, daoForkBlock, gasPriceFork, bt, skipTests); err != nil { return err } return nil } -func runBlockTests(homesteadBlock, daoForkBlock *big.Int, bt map[string]*BlockTest, skipTests []string) error { +func runBlockTests(homesteadBlock, daoForkBlock, gasPriceFork *big.Int, bt map[string]*BlockTest, skipTests []string) error { skipTest := make(map[string]bool, len(skipTests)) for _, name := range skipTests { skipTest[name] = true @@ -149,7 +149,7 @@ func runBlockTests(homesteadBlock, daoForkBlock *big.Int, bt map[string]*BlockTe continue } // test the block - if err := runBlockTest(homesteadBlock, daoForkBlock, test); err != nil { + if err := runBlockTest(homesteadBlock, daoForkBlock, gasPriceFork, test); err != nil { return fmt.Errorf("%s: %v", name, err) } glog.Infoln("Block test passed: ", name) @@ -158,7 +158,7 @@ func runBlockTests(homesteadBlock, daoForkBlock *big.Int, bt map[string]*BlockTe return nil } -func runBlockTest(homesteadBlock, daoForkBlock *big.Int, test *BlockTest) error { +func runBlockTest(homesteadBlock, daoForkBlock, gasPriceFork *big.Int, test *BlockTest) error { // import pre accounts & construct test genesis block & state root db, _ := ethdb.NewMemDatabase() if _, err := test.InsertPreState(db); err != nil { @@ -170,7 +170,7 @@ func runBlockTest(homesteadBlock, daoForkBlock *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, DAOForkBlock: daoForkBlock, DAOForkSupport: true} + config := &core.ChainConfig{HomesteadBlock: homesteadBlock, DAOForkBlock: daoForkBlock, DAOForkSupport: true, HomesteadGasRepriceBlock: gasPriceFork} chain, err := core.NewBlockChain(db, config, ethash.NewShared(), evmux) if err != nil { return err |