diff options
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.json | 32 | ||||
-rw-r--r-- | packages/web3-wrapper/CHANGELOG.md | 17 | ||||
-rw-r--r-- | packages/web3-wrapper/package.json | 14 | ||||
-rw-r--r-- | packages/web3-wrapper/src/marshaller.ts | 6 | ||||
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 7 |
5 files changed, 64 insertions, 12 deletions
diff --git a/packages/web3-wrapper/CHANGELOG.json b/packages/web3-wrapper/CHANGELOG.json index cc65c2a7d..6b76626a9 100644 --- a/packages/web3-wrapper/CHANGELOG.json +++ b/packages/web3-wrapper/CHANGELOG.json @@ -1,5 +1,34 @@ [ { + "version": "3.2.1", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1544739608 + }, + { + "version": "3.2.0", + "changes": [ + { + "note": "Return `value` and `gasPrice` as BigNumbers to avoid loss of precision errors", + "pr": 1402 + } + ], + "timestamp": 1544570656 + }, + { + "version": "3.1.6", + "changes": [ + { + "note": "Unmarshall mined transaction receipts", + "pr": 1308 + } + ], + "timestamp": 1543401373 + }, + { "version": "3.1.5", "changes": [ { @@ -10,7 +39,8 @@ "note": "Return `undefined` instead of `null` if transaction receipt not found", "pr": 1291 } - ] + ], + "timestamp": 1542821676 }, { "timestamp": 1542208198, diff --git a/packages/web3-wrapper/CHANGELOG.md b/packages/web3-wrapper/CHANGELOG.md index 70a00ee1e..76ca80e69 100644 --- a/packages/web3-wrapper/CHANGELOG.md +++ b/packages/web3-wrapper/CHANGELOG.md @@ -5,6 +5,23 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v3.2.1 - _December 13, 2018_ + + * Dependencies updated + +## v3.2.0 - _December 11, 2018_ + + * Return `value` and `gasPrice` as BigNumbers to avoid loss of precision errors (#1402) + +## v3.1.6 - _November 28, 2018_ + + * Unmarshall mined transaction receipts (#1308) + +## v3.1.5 - _November 21, 2018_ + + * Add unmarshalling of transaction receipts (#1291) + * Return `undefined` instead of `null` if transaction receipt not found (#1291) + ## v3.1.4 - _November 14, 2018_ * Dependencies updated diff --git a/packages/web3-wrapper/package.json b/packages/web3-wrapper/package.json index 8d4d7ec35..e5af24965 100644 --- a/packages/web3-wrapper/package.json +++ b/packages/web3-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@0x/web3-wrapper", - "version": "3.1.4", + "version": "3.2.1", "engines": { "node": ">=6.12" }, @@ -36,7 +36,7 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md", "devDependencies": { - "@0x/tslint-config": "^1.0.10", + "@0x/tslint-config": "^2.0.0", "@types/ganache-core": "^2.1.0", "@types/lodash": "4.14.104", "chai": "^4.0.1", @@ -54,11 +54,11 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/assert": "^1.0.17", - "@0x/json-schemas": "^2.1.1", - "@0x/typescript-typings": "^3.0.4", - "@0x/utils": "^2.0.5", - "ethereum-types": "^1.1.2", + "@0x/assert": "^1.0.20", + "@0x/json-schemas": "^2.1.4", + "@0x/typescript-typings": "^3.0.6", + "@0x/utils": "^2.0.8", + "ethereum-types": "^1.1.4", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", "lodash": "^4.17.5" diff --git a/packages/web3-wrapper/src/marshaller.ts b/packages/web3-wrapper/src/marshaller.ts index 7bd274c85..4230f8eab 100644 --- a/packages/web3-wrapper/src/marshaller.ts +++ b/packages/web3-wrapper/src/marshaller.ts @@ -120,9 +120,11 @@ export const marshaller = { } const txData = { ...txDataRpc, - value: !_.isUndefined(txDataRpc.value) ? utils.convertHexToNumber(txDataRpc.value) : undefined, + value: !_.isUndefined(txDataRpc.value) ? utils.convertAmountToBigNumber(txDataRpc.value) : undefined, gas: !_.isUndefined(txDataRpc.gas) ? utils.convertHexToNumber(txDataRpc.gas) : undefined, - gasPrice: !_.isUndefined(txDataRpc.gasPrice) ? utils.convertHexToNumber(txDataRpc.gasPrice) : undefined, + gasPrice: !_.isUndefined(txDataRpc.gasPrice) + ? utils.convertAmountToBigNumber(txDataRpc.gasPrice) + : undefined, nonce: !_.isUndefined(txDataRpc.nonce) ? utils.convertHexToNumber(txDataRpc.nonce) : undefined, }; return txData; 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), |