aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/api')
-rw-r--r--rpc/api/eth.go1
-rw-r--r--rpc/api/parsing.go8
2 files changed, 4 insertions, 5 deletions
diff --git a/rpc/api/eth.go b/rpc/api/eth.go
index 6d759a087..944e96070 100644
--- a/rpc/api/eth.go
+++ b/rpc/api/eth.go
@@ -615,7 +615,6 @@ func (self *ethApi) GetTransactionReceipt(req *shared.Request) (interface{}, err
v := NewReceiptRes(rec)
v.BlockHash = newHexData(bhash)
v.BlockNumber = newHexNum(bnum)
- v.GasUsed = newHexNum(tx.Gas().Bytes())
v.TransactionIndex = newHexNum(txi)
return v, nil
}
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)