diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-25 18:53:06 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-25 18:53:06 +0800 |
commit | 6afc16399f9624663579ad72950b4ea3b887db57 (patch) | |
tree | 34a2077e34ca34be1e9a51b61923ac40d7b76b5e /ethpipe | |
parent | 3f904bf3acb5779f68834ebca95825ea1990f85b (diff) | |
download | dexon-6afc16399f9624663579ad72950b4ea3b887db57.tar dexon-6afc16399f9624663579ad72950b4ea3b887db57.tar.gz dexon-6afc16399f9624663579ad72950b4ea3b887db57.tar.bz2 dexon-6afc16399f9624663579ad72950b4ea3b887db57.tar.lz dexon-6afc16399f9624663579ad72950b4ea3b887db57.tar.xz dexon-6afc16399f9624663579ad72950b4ea3b887db57.tar.zst dexon-6afc16399f9624663579ad72950b4ea3b887db57.zip |
Block size
Diffstat (limited to 'ethpipe')
-rw-r--r-- | ethpipe/js_types.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ethpipe/js_types.go b/ethpipe/js_types.go index 0fb3a3876..d9cbef12d 100644 --- a/ethpipe/js_types.go +++ b/ethpipe/js_types.go @@ -14,6 +14,7 @@ import ( // Block interface exposed to QML type JSBlock struct { ref *ethchain.Block + Size string `json:"size"` Number int `json:"number"` Hash string `json:"hash"` Transactions string `json:"transactions"` @@ -40,7 +41,7 @@ func NewJSBlock(block *ethchain.Block) *JSBlock { return nil } - return &JSBlock{ref: block, Number: int(block.Number.Uint64()), GasUsed: block.GasUsed.String(), GasLimit: block.GasLimit.String(), Hash: ethutil.Bytes2Hex(block.Hash()), Transactions: string(txJson), Time: block.Time, Coinbase: ethutil.Bytes2Hex(block.Coinbase)} + return &JSBlock{ref: block, Size: block.Size().String(), Number: int(block.Number.Uint64()), GasUsed: block.GasUsed.String(), GasLimit: block.GasLimit.String(), Hash: ethutil.Bytes2Hex(block.Hash()), Transactions: string(txJson), Time: block.Time, Coinbase: ethutil.Bytes2Hex(block.Coinbase)} } func (self *JSBlock) ToString() string { |