all: move common.Database to package ethdb

This commit is contained in:
Felix Lange
2015-09-14 09:35:57 +02:00
parent 55ed8d108d
commit 8c4dab77ba
24 changed files with 85 additions and 75 deletions

View File

@ -23,6 +23,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/rlp"
@ -56,7 +57,7 @@ func (self Storage) Copy() Storage {
type StateObject struct {
// State database for storing state changes
db common.Database
db ethdb.Database
trie *trie.SecureTrie
// Address belonging to this account
@ -87,7 +88,7 @@ type StateObject struct {
dirty bool
}
func NewStateObject(address common.Address, db common.Database) *StateObject {
func NewStateObject(address common.Address, db ethdb.Database) *StateObject {
object := &StateObject{db: db, address: address, balance: new(big.Int), gasPool: new(big.Int), dirty: true}
object.trie = trie.NewSecure((common.Hash{}).Bytes(), db)
object.storage = make(Storage)
@ -96,7 +97,7 @@ func NewStateObject(address common.Address, db common.Database) *StateObject {
return object
}
func NewStateObjectFromBytes(address common.Address, data []byte, db common.Database) *StateObject {
func NewStateObjectFromBytes(address common.Address, data []byte, db ethdb.Database) *StateObject {
// TODO clean me up
var extobject struct {
Nonce uint64