From 57b5f15265be2ae39ddf538915f8bd57538760b6 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 26 Sep 2017 10:01:16 -0700 Subject: [PATCH 01/15] Remove slack link --- CHANGELOG.md | 2 ++ ui/app/info.js | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e692c58dc..334fd4f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Remove Slack link from info page, since it is a big phishing target. + ## 3.10.3 2017-9-21 - Fix bug where metamask-dapp connections are lost on rpc error diff --git a/ui/app/info.js b/ui/app/info.js index 4c7d4cb4c..24c211c1f 100644 --- a/ui/app/info.js +++ b/ui/app/info.js @@ -126,13 +126,6 @@ InfoScreen.prototype.render = function () { ]), ]), - h('div.fa.fa-slack', [ - h('a.info', { - href: 'http://slack.metamask.io', - target: '_blank', - }, 'Join the conversation on Slack'), - ]), - h('div', [ h('.fa.fa-twitter', [ h('a.info', { From f69cf1670ff49637281388a6b4a71b377dfb087f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 28 Sep 2017 17:02:58 +0000 Subject: [PATCH 02/15] chore(package): update coveralls to version 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b9a38ac71..5a96a819c 100644 --- a/package.json +++ b/package.json @@ -158,7 +158,7 @@ "brfs": "^1.4.3", "browserify": "^14.4.0", "chai": "^4.1.0", - "coveralls": "^2.13.1", + "coveralls": "^3.0.0", "deep-freeze-strict": "^1.1.1", "del": "^3.0.0", "envify": "^4.0.0", From 8cc8fecdacb8dbc355e74bd6958ff4a4565b9346 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Sun, 1 Oct 2017 18:55:52 -0700 Subject: [PATCH 03/15] Don't pass origin as an HTTP header Requests with this nonstandard header are being blocked by CORS when made against Parity. Not sending it ought to fix #1779. --- app/scripts/metamask-controller.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 03e021a92..1a468b6c7 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -221,7 +221,6 @@ module.exports = class MetamaskController extends EventEmitter { eth_syncing: false, web3_clientVersion: `MetaMask/v${version}`, }, - originHttpHeaderKey: 'X-Metamask-Origin', // account mgmt getAccounts: (cb) => { const isUnlocked = this.keyringController.memStore.getState().isUnlocked From db1dd46f8dd93710d7dd88c08bbe05998fdd63c0 Mon Sep 17 00:00:00 2001 From: Branden Soropia Date: Mon, 2 Oct 2017 00:02:30 -0400 Subject: [PATCH 04/15] Removed MetaMasktitle. Fixed #1730. --- ui/app/app.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ui/app/app.js b/ui/app/app.js index 50121b055..613577913 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -167,14 +167,6 @@ App.prototype.renderAppBar = function () { }), ]), - // metamask name - props.isUnlocked && h('h1', { - style: { - position: 'relative', - left: '9px', - }, - }, 'MetaMask'), - props.isUnlocked && h('div', { style: { display: 'flex', From 7af696bfbe721db74efad91ca916b18198070e76 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 14:56:59 -0700 Subject: [PATCH 05/15] pending tx tracker - dont throw on load failure --- app/scripts/lib/pending-tx-tracker.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/scripts/lib/pending-tx-tracker.js b/app/scripts/lib/pending-tx-tracker.js index 3d358b00e..48d1e1d06 100644 --- a/app/scripts/lib/pending-tx-tracker.js +++ b/app/scripts/lib/pending-tx-tracker.js @@ -137,7 +137,6 @@ module.exports = class PendingTransactionTracker extends EventEmitter { message: 'There was a problem loading this transaction.', } this.emit('tx:warning', txMeta) - throw err } } From 22eaf92ec2c948ed88df30bc3a3b26f140359f09 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 15:00:23 -0700 Subject: [PATCH 06/15] pending tx tracker - resubmit - warn dont error on unknown error --- app/scripts/lib/pending-tx-tracker.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/pending-tx-tracker.js b/app/scripts/lib/pending-tx-tracker.js index 48d1e1d06..dcaa1d716 100644 --- a/app/scripts/lib/pending-tx-tracker.js +++ b/app/scripts/lib/pending-tx-tracker.js @@ -86,12 +86,15 @@ module.exports = class PendingTransactionTracker extends EventEmitter { // other || errorMessage.includes('gateway timeout') || errorMessage.includes('nonce too low') - || txMeta.retryCount > 1 ) // ignore resubmit warnings, return early if (isKnownTx) return // encountered real error - transition to error state - this.emit('tx:failed', txMeta.id, err) + txMeta.warning = { + error: errorMessage, + message: 'There was an error when resubmitting this transaction.', + } + this.emit('tx:warning', txMeta) })) } From a86f6d6d90bda273861079b464c290dff6ef5c0e Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 15:14:15 -0700 Subject: [PATCH 07/15] pending tx tracker - test - rename tests to match event name --- test/unit/pending-tx-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/pending-tx-test.js b/test/unit/pending-tx-test.js index 4da0eff5d..097564033 100644 --- a/test/unit/pending-tx-test.js +++ b/test/unit/pending-tx-test.js @@ -57,7 +57,7 @@ describe('PendingTransactionTracker', function () { const block = Proxy.revocable({}, {}).revoke() pendingTxTracker.checkForTxInBlock(block) }) - it('should emit \'txFailed\' if the txMeta does not have a hash', function (done) { + it('should emit \'tx:failed\' if the txMeta does not have a hash', function (done) { const block = Proxy.revocable({}, {}).revoke() pendingTxTracker.getPendingTransactions = () => [txMetaNoHash] pendingTxTracker.once('tx:failed', (txId, err) => { @@ -105,7 +105,7 @@ describe('PendingTransactionTracker', function () { }) describe('#_checkPendingTx', function () { - it('should emit \'txFailed\' if the txMeta does not have a hash', function (done) { + it('should emit \'tx:failed\' if the txMeta does not have a hash', function (done) { pendingTxTracker.once('tx:failed', (txId, err) => { assert(txId, txMetaNoHash.id, 'should pass txId') done() @@ -172,7 +172,7 @@ describe('PendingTransactionTracker', function () { .catch(done) pendingTxTracker.resubmitPendingTxs() }) - it('should not emit \'txFailed\' if the txMeta throws a known txError', function (done) { + it('should not emit \'tx:failed\' if the txMeta throws a known txError', function (done) { knownErrors =[ // geth ' Replacement transaction Underpriced ', @@ -199,7 +199,7 @@ describe('PendingTransactionTracker', function () { pendingTxTracker.resubmitPendingTxs() }) - it('should emit \'txFailed\' if it encountered a real error', function (done) { + it('should emit \'tx:failed\' if it encountered a real error', function (done) { pendingTxTracker.once('tx:failed', (id, err) => err.message === 'im some real error' ? txList[id - 1].resolve() : done(err)) pendingTxTracker.getPendingTransactions = () => txList From ed77304e73e91f252e6e0a3f682569ad17a0d52d Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 15:20:01 -0700 Subject: [PATCH 08/15] pending tx tracker - tx:warning event includes err obj --- app/scripts/lib/pending-tx-tracker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/lib/pending-tx-tracker.js b/app/scripts/lib/pending-tx-tracker.js index dcaa1d716..474c4d5a2 100644 --- a/app/scripts/lib/pending-tx-tracker.js +++ b/app/scripts/lib/pending-tx-tracker.js @@ -94,7 +94,7 @@ module.exports = class PendingTransactionTracker extends EventEmitter { error: errorMessage, message: 'There was an error when resubmitting this transaction.', } - this.emit('tx:warning', txMeta) + this.emit('tx:warning', txMeta, err) })) } @@ -139,7 +139,7 @@ module.exports = class PendingTransactionTracker extends EventEmitter { error: err, message: 'There was a problem loading this transaction.', } - this.emit('tx:warning', txMeta) + this.emit('tx:warning', txMeta, err) } } From 25a80932a64f718ba1a39ab399b17395f0fd5d88 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 15:20:18 -0700 Subject: [PATCH 09/15] pending tx tracker - test - expect warning event on resubmit failure --- test/unit/pending-tx-test.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/unit/pending-tx-test.js b/test/unit/pending-tx-test.js index 097564033..6b62bb5b1 100644 --- a/test/unit/pending-tx-test.js +++ b/test/unit/pending-tx-test.js @@ -199,8 +199,15 @@ describe('PendingTransactionTracker', function () { pendingTxTracker.resubmitPendingTxs() }) - it('should emit \'tx:failed\' if it encountered a real error', function (done) { - pendingTxTracker.once('tx:failed', (id, err) => err.message === 'im some real error' ? txList[id - 1].resolve() : done(err)) + it('should emit \'tx:warning\' if it encountered a real error', function (done) { + pendingTxTracker.once('tx:warning', (txMeta, err) => { + if (err.message === 'im some real error') { + const matchingTx = txList.find(tx => tx.id === txMeta.id) + matchingTx.resolve() + } else { + done(err) + } + }) pendingTxTracker.getPendingTransactions = () => txList pendingTxTracker._resubmitTx = async (tx) => { throw new TypeError('im some real error') } From 062eaa6a82f6730eb180c1a1fb61f035eb123451 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 15:39:11 -0700 Subject: [PATCH 10/15] pending tx tracker - on tx:warn append error message instead of error obj --- app/scripts/lib/pending-tx-tracker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/lib/pending-tx-tracker.js b/app/scripts/lib/pending-tx-tracker.js index 474c4d5a2..6f1601586 100644 --- a/app/scripts/lib/pending-tx-tracker.js +++ b/app/scripts/lib/pending-tx-tracker.js @@ -136,7 +136,7 @@ module.exports = class PendingTransactionTracker extends EventEmitter { } } catch (err) { txMeta.warning = { - error: err, + error: err.message, message: 'There was a problem loading this transaction.', } this.emit('tx:warning', txMeta, err) From 2113d8348969f4da3c61ddf1cee4aa38f7a5958a Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 2 Oct 2017 15:39:44 -0700 Subject: [PATCH 11/15] ui - tx history - simplify error+warning display code --- ui/app/components/transaction-list-item.js | 34 ++++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 0e5c0b5a3..a9961f47c 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -133,7 +133,7 @@ function recipientField (txParams, transaction, isTx, isMsg) { }, }, [ message, - failIfFailed(transaction), + renderErrorOrWarning(transaction), ]) } @@ -141,25 +141,35 @@ function formatDate (date) { return vreme.format(new Date(date), 'March 16 2014 14:30') } -function failIfFailed (transaction) { - if (transaction.status === 'rejected') { +function renderErrorOrWarning (transaction) { + const { status, err, warning } = transaction + + // show rejected + if (status === 'rejected') { return h('span.error', ' (Rejected)') } - if (transaction.err || transaction.warning) { - const { err, warning = {} } = transaction - const errFirst = !!(( err && warning ) || err) - const message = errFirst ? err.message : warning.message - - errFirst ? err.message : warning.message + // show error + if (err) { + const message = err.message || '' + return ( + h(Tooltip, { + title: message, + position: 'bottom', + }, [ + h(`span.error`, ` (Failed)`), + ]) + ) + } + // show warning + if (warning) { + const message = warning.message return h(Tooltip, { title: message, position: 'bottom', }, [ - h(`span.${errFirst ? 'error' : 'warning'}`, - ` (${errFirst ? 'Failed' : 'Warning'})` - ), + h(`span.warning`, ` (Warning)`), ]) } } From 98641f6f6617f9c59775cb3e8ed955f154a3b8c9 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 3 Oct 2017 04:33:04 +0000 Subject: [PATCH 12/15] chore(package): update mocha to version 4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 918531f15..685d98403 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,7 @@ "karma-firefox-launcher": "^1.0.1", "karma-qunit": "^1.2.1", "lodash.assign": "^4.0.6", - "mocha": "^3.4.2", + "mocha": "^4.0.0", "mocha-eslint": "^4.0.0", "mocha-jsdom": "^1.1.0", "mocha-sinon": "^2.0.0", From 27c72ee565f02e319af2a4e2c03a885ae633ae71 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 4 Oct 2017 12:10:01 -0700 Subject: [PATCH 13/15] Revert to normal balances. --- ui/app/account-detail.js | 4 ++-- ui/app/components/pending-tx.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 90724dc3f..a844daf88 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -46,7 +46,7 @@ AccountDetailScreen.prototype.render = function () { var selected = props.address || Object.keys(props.accounts)[0] var checksumAddress = selected && ethUtil.toChecksumAddress(selected) var identity = props.identities[selected] - var account = props.computedBalances[selected] + var account = props.accounts[selected] const { network, conversionRate, currentCurrency } = props return ( @@ -181,7 +181,7 @@ AccountDetailScreen.prototype.render = function () { }, [ h(EthBalance, { - value: account && account.ethBalance, + value: account && account.balance, conversionRate, currentCurrency, style: { diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 6f8c19a3c..c3350fcc1 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -33,7 +33,7 @@ function PendingTx () { PendingTx.prototype.render = function () { const props = this.props - const { currentCurrency, blockGasLimit, computedBalances } = props + const { currentCurrency, blockGasLimit } = props const conversionRate = props.conversionRate const txMeta = this.gatherTxMeta() @@ -42,8 +42,8 @@ PendingTx.prototype.render = function () { // Account Details const address = txParams.from || props.selectedAddress const identity = props.identities[address] || { address: address } - const account = computedBalances[address] - const balance = account ? account.ethBalance : '0x0' + const account = props.accounts[address] + const balance = account ? account.balance : '0x0' // recipient check const isValidAddress = !txParams.to || util.isValidAddress(txParams.to) From 23bc92a8f11bd6e3ed3f5e87b36654d178177208 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 4 Oct 2017 13:33:50 -0700 Subject: [PATCH 14/15] deps - bump eth-json-rpc-filters for log filter fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 30079e1d5..03d095228 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "eth-block-tracker": "^2.2.0", "eth-contract-metadata": "^1.1.4", "eth-hd-keyring": "^1.1.1", - "eth-json-rpc-filters": "^1.2.1", + "eth-json-rpc-filters": "^1.2.2", "eth-keyring-controller": "^2.0.0", "eth-phishing-detect": "^1.1.4", "eth-query": "^2.1.2", From 88686a39681ef84f2b503f25b94607d96657a190 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 4 Oct 2017 15:35:46 -0700 Subject: [PATCH 15/15] Enforce 0x prefix on accounts with new hd keyring --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 03d095228..298691588 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "eth-bin-to-ops": "^1.0.1", "eth-block-tracker": "^2.2.0", "eth-contract-metadata": "^1.1.4", - "eth-hd-keyring": "^1.1.1", + "eth-hd-keyring": "^1.2.1", "eth-json-rpc-filters": "^1.2.2", "eth-keyring-controller": "^2.0.0", "eth-phishing-detect": "^1.1.4",