aboutsummaryrefslogtreecommitdiffstats
path: root/core/genesis.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/genesis.go
parent55ed8d108d72d12543ecdc6d8c9d9978392dabf0 (diff)
downloadgo-tangerine-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar
go-tangerine-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.gz
go-tangerine-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.bz2
go-tangerine-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.lz
go-tangerine-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.xz
go-tangerine-8c4dab77ba48dc68073fe1df79e7000043c0f966.tar.zst
go-tangerine-8c4dab77ba48dc68073fe1df79e7000043c0f966.zip
all: move common.Database to package ethdb
Diffstat (limited to 'core/genesis.go')
-rw-r--r--core/genesis.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 3a8f0af0c..727e2c75f 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -27,13 +27,14 @@ 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/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/params"
)
// WriteGenesisBlock writes the genesis block to the database as block number 0
-func WriteGenesisBlock(chainDb common.Database, reader io.Reader) (*types.Block, error) {
+func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block, error) {
contents, err := ioutil.ReadAll(reader)
if err != nil {
return nil, err
@@ -110,7 +111,7 @@ func WriteGenesisBlock(chainDb common.Database, reader io.Reader) (*types.Block,
// GenesisBlockForTesting creates a block in which addr has the given wei balance.
// The state trie of the block is written to db.
-func GenesisBlockForTesting(db common.Database, addr common.Address, balance *big.Int) *types.Block {
+func GenesisBlockForTesting(db ethdb.Database, addr common.Address, balance *big.Int) *types.Block {
statedb := state.New(common.Hash{}, db)
obj := statedb.GetOrNewStateObject(addr)
obj.SetBalance(balance)
@@ -124,7 +125,7 @@ func GenesisBlockForTesting(db common.Database, addr common.Address, balance *bi
return block
}
-func WriteGenesisBlockForTesting(db common.Database, addr common.Address, balance *big.Int) *types.Block {
+func WriteGenesisBlockForTesting(db ethdb.Database, addr common.Address, balance *big.Int) *types.Block {
testGenesis := fmt.Sprintf(`{
"nonce":"0x%x",
"gasLimit":"0x%x",
@@ -137,7 +138,7 @@ func WriteGenesisBlockForTesting(db common.Database, addr common.Address, balanc
return block
}
-func WriteTestNetGenesisBlock(chainDb common.Database, nonce uint64) (*types.Block, error) {
+func WriteTestNetGenesisBlock(chainDb ethdb.Database, nonce uint64) (*types.Block, error) {
testGenesis := fmt.Sprintf(`{
"nonce":"0x%x",
"gasLimit":"0x%x",