diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-10-02 19:41:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 19:41:10 +0800 |
commit | f86c4177d506b635f9ebdaea8ab5aef27f53d20a (patch) | |
tree | 937622958d23a10dc95cb41682305b1e075df833 /internal | |
parent | d78ad226c26c84635c60fad233de9e6e438a5599 (diff) | |
parent | 7e9e3a134b9607209def42279db081973b5e0ac2 (diff) | |
download | go-tangerine-f86c4177d506b635f9ebdaea8ab5aef27f53d20a.tar go-tangerine-f86c4177d506b635f9ebdaea8ab5aef27f53d20a.tar.gz go-tangerine-f86c4177d506b635f9ebdaea8ab5aef27f53d20a.tar.bz2 go-tangerine-f86c4177d506b635f9ebdaea8ab5aef27f53d20a.tar.lz go-tangerine-f86c4177d506b635f9ebdaea8ab5aef27f53d20a.tar.xz go-tangerine-f86c4177d506b635f9ebdaea8ab5aef27f53d20a.tar.zst go-tangerine-f86c4177d506b635f9ebdaea8ab5aef27f53d20a.zip |
Merge pull request #15042 from rjl493456442/receipt_rpc
internal/ethapi: add status code to receipt rpc return
Diffstat (limited to 'internal')
-rw-r--r-- | internal/ethapi/api.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 8d1a6f746..ab8478929 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -991,7 +991,6 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(hash common.Hash) (map[ from, _ := types.Sender(signer, tx) fields := map[string]interface{}{ - "root": hexutil.Bytes(receipt.PostState), "blockHash": blockHash, "blockNumber": hexutil.Uint64(blockNumber), "transactionHash": hash, @@ -1004,6 +1003,13 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(hash common.Hash) (map[ "logs": receipt.Logs, "logsBloom": receipt.Bloom, } + + // Assign receipt status or post state. + if len(receipt.PostState) > 0 { + fields["root"] = hexutil.Bytes(receipt.PostState) + } else { + fields["status"] = hexutil.Uint(receipt.Status) + } if receipt.Logs == nil { fields["logs"] = [][]*types.Log{} } |