From 4e8ec2359d0f3842411d752fcfe966d540b10178 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 21 Sep 2018 10:56:31 +0100 Subject: Also make sure the transactionReceipt contains a blockNumber when checking if a transaction has been mined. --- packages/web3-wrapper/CHANGELOG.json | 9 +++++++++ packages/web3-wrapper/src/web3_wrapper.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index 57e6f7689..e1fdede0e 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.3", + "changes": [ + { + "note": + "Fixes issue #1076 where Parity now returns a placeholder transactionReceipt before the transaction is mined." + } + ] + }, { "timestamp": 1536142250, "version": "2.0.2", diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index ea78f8801..af0fe3a72 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -539,7 +539,7 @@ export class Web3Wrapper { } // Immediately check if the transaction has already been mined. let transactionReceipt = await this.getTransactionReceiptAsync(txHash); - if (!_.isNull(transactionReceipt)) { + if (!_.isNull(transactionReceipt) && !_.isNull(transactionReceipt.blockNumber)) { const logsWithDecodedArgs = _.map( transactionReceipt.logs, this.abiDecoder.tryToDecodeLogOrNoop.bind(this.abiDecoder), -- cgit v1.2.3