Exposed usedGas through ethPub

This commit is contained in:
Maran 2014-06-11 11:40:50 +02:00
parent e090d131c3
commit 71ab5d52b6

View File

@ -47,6 +47,7 @@ type PBlock struct {
Time int64 `json:"time"` Time int64 `json:"time"`
Coinbase string `json:"coinbase"` Coinbase string `json:"coinbase"`
GasLimit string `json:"gasLimit"` GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
} }
// Creates a new QML Block from a chain block // Creates a new QML Block from a chain block
@ -65,7 +66,7 @@ func NewPBlock(block *ethchain.Block) *PBlock {
return nil return nil
} }
return &PBlock{ref: block, Number: int(block.Number.Uint64()), GasLimit: block.GasLimit.String(), Hash: ethutil.Hex(block.Hash()), Transactions: string(txJson), Time: block.Time, Coinbase: ethutil.Hex(block.Coinbase)} return &PBlock{ref: block, Number: int(block.Number.Uint64()), GasUsed: block.GasUsed.String(), GasLimit: block.GasLimit.String(), Hash: ethutil.Hex(block.Hash()), Transactions: string(txJson), Time: block.Time, Coinbase: ethutil.Hex(block.Coinbase)}
} }
func (self *PBlock) ToString() string { func (self *PBlock) ToString() string {