From 7d38c4ccb657409f123bde6709ddff6418c90c89 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:11:55 -0800 Subject: [PATCH 1/7] Add ropsten link support --- ui/lib/account-link.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/lib/account-link.js b/ui/lib/account-link.js index a6b120c63..a77422142 100644 --- a/ui/lib/account-link.js +++ b/ui/lib/account-link.js @@ -7,10 +7,10 @@ module.exports = function(address, network) { link = `http://etherscan.io/address/${address}` break case 2: // morden test net - link = `http://testnet.etherscan.io/address/${address}` + link = '' break case 3: // ropsten test net - link = '' + link = `http://testnet.etherscan.io/address/${address}` break default: link = '' From aefc346a655320da57ab9d63ec920cc21550ddd8 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:14:22 -0800 Subject: [PATCH 2/7] Bump changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 165562ad9..481130201 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Make Ropsten transactions link to etherscan correctly. + ## 2.13.9 2016-11-21 - Add support for the new, default Ropsten Test Network. From daec4d5c3639f7a97862ba87df749fbcd9a46c17 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:19:34 -0800 Subject: [PATCH 3/7] Fix ropsten link test --- test/unit/account-link-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/account-link-test.js b/test/unit/account-link-test.js index 39889b6be..08d190f71 100644 --- a/test/unit/account-link-test.js +++ b/test/unit/account-link-test.js @@ -3,8 +3,8 @@ var linkGen = require('../../ui/lib/account-link') describe('account-link', function() { - it('adds testnet prefix to morden test network', function() { - var result = linkGen('account', '2') + it('adds testnet prefix to ropsten test network', function() { + var result = linkGen('account', '3') assert.notEqual(result.indexOf('testnet'), -1, 'testnet injected') assert.notEqual(result.indexOf('account'), -1, 'account included') }) From 694f34ae9a11dbe0ea6f484defe2d8f9e55da82a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:43:59 -0800 Subject: [PATCH 4/7] Add temporary morden explorer link support --- test/unit/account-link-test.js | 6 ++++++ ui/lib/account-link.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/unit/account-link-test.js b/test/unit/account-link-test.js index 08d190f71..5036f8f5d 100644 --- a/test/unit/account-link-test.js +++ b/test/unit/account-link-test.js @@ -3,6 +3,12 @@ var linkGen = require('../../ui/lib/account-link') describe('account-link', function() { + it('adds morden prefix to morden test network', function() { + var result = linkGen('account', '2') + assert.notEqual(result.indexOf('morden'), -1, 'testnet injected') + assert.notEqual(result.indexOf('account'), -1, 'account included') + }) + it('adds testnet prefix to ropsten test network', function() { var result = linkGen('account', '3') assert.notEqual(result.indexOf('testnet'), -1, 'testnet injected') diff --git a/ui/lib/account-link.js b/ui/lib/account-link.js index a77422142..ff52d9c54 100644 --- a/ui/lib/account-link.js +++ b/ui/lib/account-link.js @@ -7,7 +7,7 @@ module.exports = function(address, network) { link = `http://etherscan.io/address/${address}` break case 2: // morden test net - link = '' + link = `http://morden.etherscan.io/address/${address}` break case 3: // ropsten test net link = `http://testnet.etherscan.io/address/${address}` From e2a9e1cd4ab6329df3de94d136ccb7e912945c48 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:45:05 -0800 Subject: [PATCH 5/7] Unify test wording --- test/unit/account-link-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/account-link-test.js b/test/unit/account-link-test.js index 5036f8f5d..4ea12e002 100644 --- a/test/unit/account-link-test.js +++ b/test/unit/account-link-test.js @@ -5,13 +5,13 @@ describe('account-link', function() { it('adds morden prefix to morden test network', function() { var result = linkGen('account', '2') - assert.notEqual(result.indexOf('morden'), -1, 'testnet injected') + assert.notEqual(result.indexOf('morden'), -1, 'testnet included') assert.notEqual(result.indexOf('account'), -1, 'account included') }) it('adds testnet prefix to ropsten test network', function() { var result = linkGen('account', '3') - assert.notEqual(result.indexOf('testnet'), -1, 'testnet injected') + assert.notEqual(result.indexOf('testnet'), -1, 'testnet included') assert.notEqual(result.indexOf('account'), -1, 'account included') }) From 88ed1f191f26849b8451c652d30b81fc6d561a27 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 22 Nov 2016 09:45:28 -0800 Subject: [PATCH 6/7] Add to changelog. --- CHANGELOG.md | 1 + app/scripts/metamask-controller.js | 2 +- ui/app/components/buy-button-subview.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 165562ad9..69764748f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Current Master +- Ropsten networks now properly point to the faucet when attempting to buy ether. ## 2.13.9 2016-11-21 diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 5e76c5ebd..82ad8f9c4 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -364,7 +364,7 @@ module.exports = class MetamaskController { var network = this.idStore._currentState.network var url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH` - if (network === '2') { + if ((network === '2') || (network === '3')) { url = 'https://faucet.metamask.io/' } diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js index b564733b1..ad1967616 100644 --- a/ui/app/components/buy-button-subview.js +++ b/ui/app/components/buy-button-subview.js @@ -115,7 +115,7 @@ BuyButtonSubview.prototype.formVersionSubview = function () { }, }, 'In order to access this feature please switch to the Main Network'), h('h3.text-transform-uppercase', 'or:'), - this.props.network === '2' ? h('button.text-transform-uppercase', { + (this.props.network === '2' || this.props.network === '3') ? h('button.text-transform-uppercase', { onClick: () => this.props.dispatch(actions.buyEth()), style: { marginTop: '15px', From 8d2afccdc0e355c2cf5425de5c21042b08989393 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 22 Nov 2016 10:13:57 -0800 Subject: [PATCH 7/7] Ropsten has sole access to the faucet. --- app/scripts/metamask-controller.js | 2 +- ui/app/components/buy-button-subview.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 82ad8f9c4..631411bed 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -364,7 +364,7 @@ module.exports = class MetamaskController { var network = this.idStore._currentState.network var url = `https://buy.coinbase.com/?code=9ec56d01-7e81-5017-930c-513daa27bb6a&amount=${amount}&address=${address}&crypto_currency=ETH` - if ((network === '2') || (network === '3')) { + if (network === '3') { url = 'https://faucet.metamask.io/' } diff --git a/ui/app/components/buy-button-subview.js b/ui/app/components/buy-button-subview.js index ad1967616..35eda647e 100644 --- a/ui/app/components/buy-button-subview.js +++ b/ui/app/components/buy-button-subview.js @@ -113,9 +113,9 @@ BuyButtonSubview.prototype.formVersionSubview = function () { style: { width: '225px', }, - }, 'In order to access this feature please switch to the Main Network'), - h('h3.text-transform-uppercase', 'or:'), - (this.props.network === '2' || this.props.network === '3') ? h('button.text-transform-uppercase', { + }, 'In order to access this feature, please switch to the Main Network'), + (this.props.network === '3') ? h('h3.text-transform-uppercase', 'or:') : null, + (this.props.network === '3') ? h('button.text-transform-uppercase', { onClick: () => this.props.dispatch(actions.buyEth()), style: { marginTop: '15px',