aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2017-06-16 05:12:06 +0800
committerGitHub <noreply@github.com>2017-06-16 05:12:06 +0800
commit08b8e89b88678b9fbe2816b0501d700deba8bb97 (patch)
treefd7ed75457928039303d02980bd8fddd967557c3
parent1a4f982739a09a4fd757b5f45fcaeef1a93dd4a3 (diff)
parent6ae97290f0e744479a41e31507f79309137d94c0 (diff)
downloadtangerine-wallet-browser-08b8e89b88678b9fbe2816b0501d700deba8bb97.tar.gz
tangerine-wallet-browser-08b8e89b88678b9fbe2816b0501d700deba8bb97.tar.zst
tangerine-wallet-browser-08b8e89b88678b9fbe2816b0501d700deba8bb97.zip
Merge pull request #1610 from MetaMask/bumpProvider
Bump provider and check for the tx in the block that provider engine gives us
-rw-r--r--app/scripts/controllers/transactions.js20
-rw-r--r--package.json2
2 files changed, 6 insertions, 16 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 2db8041eb..71f90c2cd 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -338,12 +338,13 @@ module.exports = class TransactionController extends EventEmitter {
// checks if a signed tx is in a block and
// if included sets the tx status as 'confirmed'
- checkForTxInBlock () {
+ checkForTxInBlock (block) {
var signedTxList = this.getFilteredTxList({status: 'submitted'})
if (!signedTxList.length) return
signedTxList.forEach((txMeta) => {
var txHash = txMeta.hash
var txId = txMeta.id
+
if (!txHash) {
const errReason = {
errCode: 'No hash was provided',
@@ -351,20 +352,9 @@ module.exports = class TransactionController extends EventEmitter {
}
return this.setTxStatusFailed(txId, errReason)
}
- this.query.getTransactionByHash(txHash, (err, txParams) => {
- if (err || !txParams) {
- if (!txParams) return
- txMeta.err = {
- isWarning: true,
- errorCode: err,
- message: 'There was a problem loading this transaction.',
- }
- this.updateTx(txMeta)
- return log.error(err)
- }
- if (txParams.blockNumber) {
- this.setTxStatusConfirmed(txId)
- }
+
+ block.transactions.forEach((tx) => {
+ if (tx.hash === txHash) this.setTxStatusConfirmed(txId)
})
})
}
diff --git a/package.json b/package.json
index 2c23d9e10..7ee5dc5be 100644
--- a/package.json
+++ b/package.json
@@ -123,7 +123,7 @@
"valid-url": "^1.0.9",
"vreme": "^3.0.2",
"web3": "0.18.2",
- "web3-provider-engine": "^12.2.4",
+ "web3-provider-engine": "^13.0.1",
"web3-stream-provider": "^2.0.6",
"xtend": "^4.0.1"
},