aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-11-26 18:21:36 +0800
committerGitHub <noreply@github.com>2018-11-26 18:21:36 +0800
commit1d83d99d87385c396a57bfdf48a8a0211ace557b (patch)
treefe20abb5a40457c047dc79048d5e8de8281657b7 /packages
parenta5359df002d121c1b7c1f29e8a2bd8b351090ee3 (diff)
parent03b3b80a657de864f020f605060b0dffd452b482 (diff)
downloaddexon-sol-tools-1d83d99d87385c396a57bfdf48a8a0211ace557b.tar
dexon-sol-tools-1d83d99d87385c396a57bfdf48a8a0211ace557b.tar.gz
dexon-sol-tools-1d83d99d87385c396a57bfdf48a8a0211ace557b.tar.bz2
dexon-sol-tools-1d83d99d87385c396a57bfdf48a8a0211ace557b.tar.lz
dexon-sol-tools-1d83d99d87385c396a57bfdf48a8a0211ace557b.tar.xz
dexon-sol-tools-1d83d99d87385c396a57bfdf48a8a0211ace557b.tar.zst
dexon-sol-tools-1d83d99d87385c396a57bfdf48a8a0211ace557b.zip
Merge pull request #1308 from 0xProject/bug/web3-wrapper/unmarshall-parity-receipt
[web3-wrapper] Only unmarshall receipt if blockNumber present
Diffstat (limited to 'packages')
-rw-r--r--packages/web3-wrapper/CHANGELOG.json9
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts7
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),