diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-07 20:17:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-07 20:17:48 +0800 |
commit | fed3e6a808921fb8274b50043c5c39a24a1bbccf (patch) | |
tree | d632e95cfce78bd9a99a52bf7f30ee3ff980dfd3 /core/types/block.go | |
parent | 032ab665299d75bffc25260e8fa477ace19db06a (diff) | |
download | go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.gz go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.tar.zst go-tangerine-fed3e6a808921fb8274b50043c5c39a24a1bbccf.zip |
Refactored ethutil.Config.Db out
Diffstat (limited to 'core/types/block.go')
-rw-r--r-- | core/types/block.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/types/block.go b/core/types/block.go index 7e19d003f..be57e86a6 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -9,9 +9,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethutil" - "github.com/ethereum/go-ethereum/ptrie" "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/state" ) type Header struct { @@ -168,16 +166,18 @@ func (self *Block) RlpDataForStorage() interface{} { } // Header accessors (add as you need them) -func (self *Block) Number() *big.Int { return self.header.Number } -func (self *Block) NumberU64() uint64 { return self.header.Number.Uint64() } -func (self *Block) Bloom() []byte { return self.header.Bloom } -func (self *Block) Coinbase() []byte { return self.header.Coinbase } -func (self *Block) Time() int64 { return int64(self.header.Time) } -func (self *Block) GasLimit() *big.Int { return self.header.GasLimit } -func (self *Block) GasUsed() *big.Int { return self.header.GasUsed } -func (self *Block) Trie() *ptrie.Trie { return ptrie.New(self.header.Root, ethutil.Config.Db) } +func (self *Block) Number() *big.Int { return self.header.Number } +func (self *Block) NumberU64() uint64 { return self.header.Number.Uint64() } +func (self *Block) Bloom() []byte { return self.header.Bloom } +func (self *Block) Coinbase() []byte { return self.header.Coinbase } +func (self *Block) Time() int64 { return int64(self.header.Time) } +func (self *Block) GasLimit() *big.Int { return self.header.GasLimit } +func (self *Block) GasUsed() *big.Int { return self.header.GasUsed } + +//func (self *Block) Trie() *ptrie.Trie { return ptrie.New(self.header.Root, ethutil.Config.Db) } +//func (self *Block) State() *state.StateDB { return state.New(self.Trie()) } +func (self *Block) Root() []byte { return self.header.Root } func (self *Block) SetRoot(root []byte) { self.header.Root = root } -func (self *Block) State() *state.StateDB { return state.New(self.Trie()) } func (self *Block) Size() ethutil.StorageSize { return ethutil.StorageSize(len(ethutil.Encode(self))) } // Implement pow.Block |