diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-07-05 01:03:37 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-07-05 01:03:37 +0800 |
commit | 30afd37604da40416b0dd4fdc8cad322c12651cf (patch) | |
tree | bc9929c4b0bf29dc29bf9f022af0d3acc7800c1d /rpc/api/parsing.go | |
parent | cd4cc309ae4ead756cbe58ad564b029e874d9832 (diff) | |
download | go-tangerine-30afd37604da40416b0dd4fdc8cad322c12651cf.tar go-tangerine-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.gz go-tangerine-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.bz2 go-tangerine-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.lz go-tangerine-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.xz go-tangerine-30afd37604da40416b0dd4fdc8cad322c12651cf.tar.zst go-tangerine-30afd37604da40416b0dd4fdc8cad322c12651cf.zip |
Compose additional fields
Diffstat (limited to 'rpc/api/parsing.go')
-rw-r--r-- | rpc/api/parsing.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/rpc/api/parsing.go b/rpc/api/parsing.go index 70e9bf942..cc7f60cad 100644 --- a/rpc/api/parsing.go +++ b/rpc/api/parsing.go @@ -1,6 +1,7 @@ package api import ( + "bytes" "encoding/binary" "encoding/hex" "encoding/json" @@ -419,11 +420,18 @@ func NewReceiptRes(rec *types.Receipt) *ReceiptRes { } var v = new(ReceiptRes) - // TODO fill out rest of object - // ContractAddress is all 0 when not a creation tx - v.ContractAddress = newHexData(rec.ContractAddress) - v.CumulativeGasUsed = newHexNum(rec.CumulativeGasUsed) v.TransactionHash = newHexData(rec.TxHash) + // v.TransactionIndex = newHexNum(input) // transaction + // v.BlockNumber = newHexNum(input) // transaction + // v.BlockHash = newHexData(input) //transaction + v.CumulativeGasUsed = newHexNum(rec.CumulativeGasUsed) + // v.GasUsed = newHexNum(input) // CumulativeGasUsed (blocknum-1) + // 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) + } + // v.Logs = rec.Logs() + return v } |