cmd, core, eth, common: genesis preparation

Implemented the --genesis flag thru which we can set a custom genesis
block, including the official Ethereum genesis block.
This commit is contained in:
Jeffrey Wilcke
2015-07-10 14:29:40 +02:00
parent 5a810758db
commit a32c51effd
15 changed files with 244 additions and 138 deletions

View File

@ -178,10 +178,11 @@ type testPeer struct {
}
func newProtocolManagerForTesting(txAdded chan<- []*types.Transaction) *ProtocolManager {
db, _ := ethdb.NewMemDatabase()
core.WriteTestNetGenesisBlock(db, db, 0)
var (
em = new(event.TypeMux)
db, _ = ethdb.NewMemDatabase()
chain, _ = core.NewChainManager(core.GenesisBlock(0, db), db, db, db, core.FakePow{}, em)
chain, _ = core.NewChainManager(db, db, db, core.FakePow{}, em)
txpool = &fakeTxPool{added: txAdded}
pm = NewProtocolManager(0, em, txpool, core.FakePow{}, chain)
)