fix transaction receipts (#274)

* return ethtypes.Receipt in GetTransactionReceipt

* add PostState to receipts, test working

* add contract addr assert to tests

* update tests

* cleanup, working with web3

* remove print

* update tests
This commit is contained in:
noot
2020-05-02 13:39:26 -04:00
committed by GitHub
parent d3c802f99e
commit 86cd39defb
2 changed files with 47 additions and 9 deletions
+5 -4
View File
@@ -707,12 +707,13 @@ func (e *PublicEthAPI) GetTransactionReceipt(hash common.Hash) (map[string]inter
e.cliCtx.Codec.MustUnmarshalJSON(res, &logs)
txData := tx.TxResult.GetData()
data, err := types.DecodeResultData(txData)
if err != nil {
return nil, err
status = 0 // transaction failed
}
fields := map[string]interface{}{
receipt := map[string]interface{}{
"blockHash": blockHash,
"blockNumber": hexutil.Uint64(tx.Height),
"transactionHash": hash,
@@ -728,10 +729,10 @@ func (e *PublicEthAPI) GetTransactionReceipt(hash common.Hash) (map[string]inter
}
if data.Address != (common.Address{}) {
fields["contractAddress"] = data.Address
receipt["contractAddress"] = data.Address
}
return fields, nil
return receipt, nil
}
// PendingTransactions returns the transactions that are in the transaction pool