diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-03 17:24:42 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-07-03 19:56:50 +0800 |
commit | 29e2fb38f8e80dfa077d139d8ff563169c644d74 (patch) | |
tree | 95ddfb2c8fb11cbaae65c9ee59555411debef4cf /core/chain_manager_test.go | |
parent | 03129e7c93a4705eb159a2dacbab6e3755fe02ed (diff) | |
download | go-tangerine-29e2fb38f8e80dfa077d139d8ff563169c644d74.tar go-tangerine-29e2fb38f8e80dfa077d139d8ff563169c644d74.tar.gz go-tangerine-29e2fb38f8e80dfa077d139d8ff563169c644d74.tar.bz2 go-tangerine-29e2fb38f8e80dfa077d139d8ff563169c644d74.tar.lz go-tangerine-29e2fb38f8e80dfa077d139d8ff563169c644d74.tar.xz go-tangerine-29e2fb38f8e80dfa077d139d8ff563169c644d74.tar.zst go-tangerine-29e2fb38f8e80dfa077d139d8ff563169c644d74.zip |
core, miner: miner header validation, transaction & receipt writing
* Miners do now verify their own header, not their state.
* Changed old putTx and putReceipts to be exported
* Moved writing of transactions and receipts out of the block processer
in to the chain manager. Closes #1386
* Miner post ChainHeadEvent & ChainEvent. Closes #1388
Diffstat (limited to 'core/chain_manager_test.go')
-rw-r--r-- | core/chain_manager_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/chain_manager_test.go b/core/chain_manager_test.go index 6869bc746..c013fc729 100644 --- a/core/chain_manager_test.go +++ b/core/chain_manager_test.go @@ -33,7 +33,7 @@ func thePow() pow.PoW { func theChainManager(db common.Database, t *testing.T) *ChainManager { var eventMux event.TypeMux genesis := GenesisBlock(0, db) - chainMan, err := NewChainManager(genesis, db, db, thePow(), &eventMux) + chainMan, err := NewChainManager(genesis, db, db, db, thePow(), &eventMux) if err != nil { t.Error("failed creating chainmanager:", err) t.FailNow() @@ -96,7 +96,7 @@ func printChain(bc *ChainManager) { func testChain(chainB types.Blocks, bman *BlockProcessor) (*big.Int, error) { td := new(big.Int) for _, block := range chainB { - _, err := bman.bc.processor.Process(block) + _, _, err := bman.bc.processor.Process(block) if err != nil { if IsKnownBlockErr(err) { continue @@ -367,7 +367,7 @@ func TestGetBlocksFromHash(t *testing.T) { type bproc struct{} -func (bproc) Process(*types.Block) (state.Logs, error) { return nil, nil } +func (bproc) Process(*types.Block) (state.Logs, types.Receipts, error) { return nil, nil, nil } func makeChainWithDiff(genesis *types.Block, d []int, seed byte) []*types.Block { var chain []*types.Block @@ -390,7 +390,7 @@ func makeChainWithDiff(genesis *types.Block, d []int, seed byte) []*types.Block func chm(genesis *types.Block, db common.Database) *ChainManager { var eventMux event.TypeMux - bc := &ChainManager{blockDb: db, stateDb: db, genesisBlock: genesis, eventMux: &eventMux, pow: FakePow{}} + bc := &ChainManager{extraDb: db, blockDb: db, stateDb: db, genesisBlock: genesis, eventMux: &eventMux, pow: FakePow{}} bc.cache, _ = lru.New(100) bc.futureBlocks, _ = lru.New(100) bc.processor = bproc{} @@ -479,12 +479,12 @@ func TestGenesisMismatch(t *testing.T) { db, _ := ethdb.NewMemDatabase() var mux event.TypeMux genesis := GenesisBlock(0, db) - _, err := NewChainManager(genesis, db, db, thePow(), &mux) + _, err := NewChainManager(genesis, db, db, db, thePow(), &mux) if err != nil { t.Error(err) } genesis = GenesisBlock(1, db) - _, err = NewChainManager(genesis, db, db, thePow(), &mux) + _, err = NewChainManager(genesis, db, db, db, thePow(), &mux) if err == nil { t.Error("expected genesis mismatch error") } |