diff options
Diffstat (limited to 'eth/helper_test.go')
-rw-r--r-- | eth/helper_test.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/eth/helper_test.go b/eth/helper_test.go index 3ad31394a..e67b49691 100644 --- a/eth/helper_test.go +++ b/eth/helper_test.go @@ -42,10 +42,7 @@ import ( var ( testBankKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") - testBank = core.GenesisAccount{ - Address: crypto.PubkeyToAddress(testBankKey.PublicKey), - Balance: big.NewInt(1000000), - } + testBank = crypto.PubkeyToAddress(testBankKey.PublicKey) ) // newTestProtocolManager creates a new protocol manager for testing purposes, @@ -53,19 +50,22 @@ var ( // channels for different events. func newTestProtocolManager(fastSync bool, blocks int, generator func(int, *core.BlockGen), newtx chan<- []*types.Transaction) (*ProtocolManager, error) { var ( - evmux = new(event.TypeMux) - pow = new(pow.FakePow) - db, _ = ethdb.NewMemDatabase() - genesis = core.WriteGenesisBlockForTesting(db, testBank) - chainConfig = ¶ms.ChainConfig{HomesteadBlock: big.NewInt(0)} // homestead set to 0 because of chain maker - blockchain, _ = core.NewBlockChain(db, chainConfig, pow, evmux, vm.Config{}) + evmux = new(event.TypeMux) + pow = new(pow.FakePow) + db, _ = ethdb.NewMemDatabase() + gspec = &core.Genesis{ + Config: params.TestChainConfig, + Alloc: core.GenesisAlloc{testBank: {Balance: big.NewInt(1000000)}}, + } + genesis = gspec.MustCommit(db) + blockchain, _ = core.NewBlockChain(db, gspec.Config, pow, evmux, vm.Config{}) ) - chain, _ := core.GenerateChain(chainConfig, genesis, db, blocks, generator) + chain, _ := core.GenerateChain(gspec.Config, genesis, db, blocks, generator) if _, err := blockchain.InsertChain(chain); err != nil { panic(err) } - pm, err := NewProtocolManager(chainConfig, fastSync, NetworkId, 1000, evmux, &testTxPool{added: newtx}, pow, blockchain, db) + pm, err := NewProtocolManager(gspec.Config, fastSync, NetworkId, 1000, evmux, &testTxPool{added: newtx}, pow, blockchain, db) if err != nil { return nil, err } |