aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-09-14 15:35:57 +0800
committerFelix Lange <fjl@twurst.com>2015-09-15 05:36:30 +0800
commit8c4dab77ba48dc68073fe1df79e7000043c0f966 (patch)
tree09ebb0fdb1b72e49ea2cfb9ebdc55a73a174302a /core/chain_makers.go
parent55ed8d108d72d12543ecdc6d8c9d9978392dabf0 (diff)
downloaddexon-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar
dexon-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.gz
dexon-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.bz2
dexon-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.lz
dexon-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.xz
dexon-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.zst
dexon-8c4dab77ba48dc68073fe1df79e7000043c0f966.zip
all: move common.Database to package ethdb
Diffstat (limited to 'core/chain_makers.go')
-rw-r--r--core/chain_makers.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/chain_makers.go b/core/chain_makers.go
index f89218f82..d3b7c42b6 100644
--- a/core/chain_makers.go
+++ b/core/chain_makers.go
@@ -22,6 +22,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/pow"
)
@@ -142,7 +143,7 @@ func (b *BlockGen) PrevBlock(index int) *types.Block {
// Blocks created by GenerateChain do not contain valid proof of work
// values. Inserting them into ChainManager requires use of FakePow or
// a similar non-validating proof of work implementation.
-func GenerateChain(parent *types.Block, db common.Database, n int, gen func(int, *BlockGen)) []*types.Block {
+func GenerateChain(parent *types.Block, db ethdb.Database, n int, gen func(int, *BlockGen)) []*types.Block {
statedb := state.New(parent.Root(), db)
blocks := make(types.Blocks, n)
genblock := func(i int, h *types.Header) *types.Block {
@@ -185,7 +186,7 @@ func makeHeader(parent *types.Block, state *state.StateDB) *types.Header {
// newCanonical creates a new deterministic canonical chain by running
// InsertChain on the result of makeChain.
-func newCanonical(n int, db common.Database) (*BlockProcessor, error) {
+func newCanonical(n int, db ethdb.Database) (*BlockProcessor, error) {
evmux := &event.TypeMux{}
WriteTestNetGenesisBlock(db, 0)
@@ -201,7 +202,7 @@ func newCanonical(n int, db common.Database) (*BlockProcessor, error) {
return bman, err
}
-func makeChain(parent *types.Block, n int, db common.Database, seed int) []*types.Block {
+func makeChain(parent *types.Block, n int, db ethdb.Database, seed int) []*types.Block {
return GenerateChain(parent, db, n, func(i int, b *BlockGen) {
b.SetCoinbase(common.Address{0: byte(seed), 19: byte(i)})
})