aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/parsing.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-07-07 02:59:12 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-07-07 03:18:24 +0800
commit666a7dda369e9a30715f560c8f72b81735a347fc (patch)
tree62011e66bba6335bf4c7693d796c4757395e248e /rpc/api/parsing.go
parent4c30f0f9ac33e02908c6848744dafff9031b86f3 (diff)
downloadgo-tangerine-666a7dda369e9a30715f560c8f72b81735a347fc.tar
go-tangerine-666a7dda369e9a30715f560c8f72b81735a347fc.tar.gz
go-tangerine-666a7dda369e9a30715f560c8f72b81735a347fc.tar.bz2
go-tangerine-666a7dda369e9a30715f560c8f72b81735a347fc.tar.lz
go-tangerine-666a7dda369e9a30715f560c8f72b81735a347fc.tar.xz
go-tangerine-666a7dda369e9a30715f560c8f72b81735a347fc.tar.zst
go-tangerine-666a7dda369e9a30715f560c8f72b81735a347fc.zip
core, eth, rpc: proper gas used. Closes #1417
Added some additional backward compatibility code for old receipts
Diffstat (limited to 'rpc/api/parsing.go')
-rw-r--r--rpc/api/parsing.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/rpc/api/parsing.go b/rpc/api/parsing.go
index 8e25ffffb..493d196e0 100644
--- a/rpc/api/parsing.go
+++ b/rpc/api/parsing.go
@@ -421,11 +421,11 @@ func NewReceiptRes(rec *types.Receipt) *ReceiptRes {
var v = new(ReceiptRes)
v.TransactionHash = newHexData(rec.TxHash)
- // v.TransactionIndex = newHexNum(input)
- // v.BlockNumber = newHexNum(input)
- // v.BlockHash = newHexData(input)
+ if rec.GasUsed != nil {
+ v.GasUsed = newHexNum(rec.GasUsed.Bytes())
+ }
v.CumulativeGasUsed = newHexNum(rec.CumulativeGasUsed)
- // v.GasUsed = newHexNum(input)
+
// If the ContractAddress is 20 0x0 bytes, assume it is not a contract creation
if bytes.Compare(rec.ContractAddress.Bytes(), bytes.Repeat([]byte{0}, 20)) != 0 {
v.ContractAddress = newHexData(rec.ContractAddress)