diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-16 18:59:52 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-16 18:59:52 +0800 |
commit | f486c0ae563eaf89a601ca5d60f30be96db2e69a (patch) | |
tree | a134ae6e38b90a268d91c61eab4ceb17856f2144 /core | |
parent | b5234413611ce5984292f85a01de1f56c045b490 (diff) | |
download | dexon-f486c0ae563eaf89a601ca5d60f30be96db2e69a.tar.gz dexon-f486c0ae563eaf89a601ca5d60f30be96db2e69a.tar.zst dexon-f486c0ae563eaf89a601ca5d60f30be96db2e69a.zip |
new type + additional methods
Diffstat (limited to 'core')
-rw-r--r-- | core/types/block.go | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/core/types/block.go b/core/types/block.go index 2d65cdca6..fadf67086 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -8,26 +8,26 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" ) type Header struct { // Hash to the previous block - ParentHash []byte + ParentHash common.Hash // Uncles of this block - UncleHash []byte + UncleHash common.Hash // The coin base address - Coinbase []byte + Coinbase common.Address // Block Trie state - Root []byte + Root common.Hash // Tx sha - TxHash []byte + TxHash common.Hash // Receipt sha - ReceiptHash []byte + ReceiptHash common.Hash // Bloom - Bloom []byte + Bloom [256]byte // Difficulty for the current block Difficulty *big.Int // The block number @@ -41,9 +41,9 @@ type Header struct { // Extra data Extra string // Mix digest for quick checking to prevent DOS - MixDigest []byte + MixDigest common.Hash // Nonce - Nonce []byte + Nonce [8]byte } func (self *Header) rlpData(withNonce bool) []interface{} { @@ -206,13 +206,13 @@ func (self *Block) SetNonce(nonce uint64) { self.header.setNonce(nonce) } -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) Root() []byte { return self.header.Root } -func (self *Block) SetRoot(root []byte) { self.header.Root = root } +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) Root() []byte { return self.header.Root } +func (self *Block) SetRoot(root []byte) { self.header.Root = root } func (self *Block) Size() common.StorageSize { return common.StorageSize(len(common.Encode(self))) } func (self *Block) GetTransaction(i int) *Transaction { if len(self.transactions) > i { |