diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-27 05:06:36 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-27 05:06:36 +0800 |
commit | 5f6a5e28e7d2832f7372a00a7d3a388da6babb17 (patch) | |
tree | d206113de7b5c2e0ab41cec3c0231206cae99054 /packages/web3-wrapper | |
parent | b0792a85a4d002bfe54ba228bfeadf29c89bfe09 (diff) | |
parent | 825911ed89e63f065c1a843ad83fb28ed72bb8ee (diff) | |
download | dexon-sol-tools-5f6a5e28e7d2832f7372a00a7d3a388da6babb17.tar dexon-sol-tools-5f6a5e28e7d2832f7372a00a7d3a388da6babb17.tar.gz dexon-sol-tools-5f6a5e28e7d2832f7372a00a7d3a388da6babb17.tar.bz2 dexon-sol-tools-5f6a5e28e7d2832f7372a00a7d3a388da6babb17.tar.lz dexon-sol-tools-5f6a5e28e7d2832f7372a00a7d3a388da6babb17.tar.xz dexon-sol-tools-5f6a5e28e7d2832f7372a00a7d3a388da6babb17.tar.zst dexon-sol-tools-5f6a5e28e7d2832f7372a00a7d3a388da6babb17.zip |
Merge branch 'development' into feature/header-tweaks
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.json | 9 | ||||
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 9725640ac..ad6902e33 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "version": "3.1.6", + "changes": [ + { + "note": "Unmarshall mined transaction receipts", + "pr": 1308 + } + ] + }, + { "version": "3.1.5", "changes": [ { diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index f1247e48a..76cae4b01 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -223,7 +223,10 @@ export class Web3Wrapper { method: 'eth_getTransactionReceipt', params: [txHash], }); - if (!_.isNull(transactionReceiptRpc)) { + // HACK Parity can return a pending transaction receipt. We check for a non null + // block number before continuing with returning a fully realised receipt. + // ref: https://github.com/paritytech/parity-ethereum/issues/1180 + if (!_.isNull(transactionReceiptRpc) && !_.isNull(transactionReceiptRpc.blockNumber)) { transactionReceiptRpc.status = Web3Wrapper._normalizeTxReceiptStatus(transactionReceiptRpc.status); const transactionReceipt = marshaller.unmarshalTransactionReceipt(transactionReceiptRpc); return transactionReceipt; @@ -577,7 +580,7 @@ export class Web3Wrapper { } // Immediately check if the transaction has already been mined. let transactionReceipt = await this.getTransactionReceiptIfExistsAsync(txHash); - if (!_.isUndefined(transactionReceipt) && !_.isNull(transactionReceipt.blockNumber)) { + if (!_.isUndefined(transactionReceipt)) { const logsWithDecodedArgs = _.map( transactionReceipt.logs, this.abiDecoder.tryToDecodeLogOrNoop.bind(this.abiDecoder), |