diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-11-27 17:41:22 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-11-27 17:41:22 +0800 |
commit | 7dde2b902cf81e90b484b1a48f6d45e0abd10e0f (patch) | |
tree | 9b92cb3e42269697e0a2b553ba31c36aef73cc25 /tests | |
parent | ffe58bf5abe5100b29ac1091c882f586cd3a2ef9 (diff) | |
parent | 3e1000fda3424d880bc43ebbb16d8a33447d4182 (diff) | |
download | dexon-7dde2b902cf81e90b484b1a48f6d45e0abd10e0f.tar dexon-7dde2b902cf81e90b484b1a48f6d45e0abd10e0f.tar.gz dexon-7dde2b902cf81e90b484b1a48f6d45e0abd10e0f.tar.bz2 dexon-7dde2b902cf81e90b484b1a48f6d45e0abd10e0f.tar.lz dexon-7dde2b902cf81e90b484b1a48f6d45e0abd10e0f.tar.xz dexon-7dde2b902cf81e90b484b1a48f6d45e0abd10e0f.tar.zst dexon-7dde2b902cf81e90b484b1a48f6d45e0abd10e0f.zip |
Merge pull request #1970 from karalabe/customizable-protocol-stacks
Customizable protocol stacks
Diffstat (limited to 'tests')
-rw-r--r-- | tests/block_test_util.go | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/tests/block_test_util.go b/tests/block_test_util.go index 6a2eb96a4..473bc3419 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -36,7 +36,9 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rlp" ) @@ -165,15 +167,6 @@ func runBlockTest(test *BlockTest) error { ks := crypto.NewKeyStorePassphrase(filepath.Join(common.DefaultDataDir(), "keystore"), crypto.StandardScryptN, crypto.StandardScryptP) am := accounts.NewManager(ks) db, _ := ethdb.NewMemDatabase() - cfg := ð.Config{ - DataDir: common.DefaultDataDir(), - Verbosity: 5, - Etherbase: common.Address{}, - AccountManager: am, - NewDB: func(path string) (ethdb.Database, error) { return db, nil }, - } - - cfg.GenesisBlock = test.Genesis // import pre accounts & construct test genesis block & state root _, err := test.InsertPreState(db, am) @@ -181,16 +174,16 @@ func runBlockTest(test *BlockTest) error { return fmt.Errorf("InsertPreState: %v", err) } - ethereum, err := eth.New(cfg) - if err != nil { - return err + cfg := ð.Config{ + TestGenesisState: db, + TestGenesisBlock: test.Genesis, + Etherbase: common.Address{}, + AccountManager: am, } - - err = ethereum.Start() + ethereum, err := eth.New(&node.ServiceContext{EventMux: new(event.TypeMux)}, cfg) if err != nil { return err } - cm := ethereum.BlockChain() validBlocks, err := test.TryBlocksInsert(cm) if err != nil { |