aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNickyg <nicky.gurbani@gmail.com>2017-04-26 04:10:33 +0800
committerNickyg <nicky.gurbani@gmail.com>2017-04-26 04:10:33 +0800
commite9aa37b699a105019384cbde88a114965ff1e2cd (patch)
treefb1421b92ea1d13163c2f6fa64528d94727b2165
parentafbe6f5e5fa18b663cfe68c40a05bcacda73e3ac (diff)
downloadtangerine-wallet-browser-e9aa37b699a105019384cbde88a114965ff1e2cd.tar
tangerine-wallet-browser-e9aa37b699a105019384cbde88a114965ff1e2cd.tar.gz
tangerine-wallet-browser-e9aa37b699a105019384cbde88a114965ff1e2cd.tar.bz2
tangerine-wallet-browser-e9aa37b699a105019384cbde88a114965ff1e2cd.tar.lz
tangerine-wallet-browser-e9aa37b699a105019384cbde88a114965ff1e2cd.tar.xz
tangerine-wallet-browser-e9aa37b699a105019384cbde88a114965ff1e2cd.tar.zst
tangerine-wallet-browser-e9aa37b699a105019384cbde88a114965ff1e2cd.zip
add rinkeby network
-rw-r--r--app/scripts/config.js2
-rw-r--r--app/scripts/lib/config-manager.js5
-rw-r--r--ui/app/app.js9
-rw-r--r--ui/app/components/drop-menu-item.js3
-rw-r--r--ui/app/components/network.js5
-rw-r--r--ui/app/config.js5
6 files changed, 28 insertions, 1 deletions
diff --git a/app/scripts/config.js b/app/scripts/config.js
index ec421744d..4f62268e1 100644
--- a/app/scripts/config.js
+++ b/app/scripts/config.js
@@ -1,6 +1,7 @@
const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask'
const TESTNET_RPC_URL = 'https://ropsten.infura.io/metamask'
const KOVAN_RPC_URL = 'https://kovan.infura.io/metamask'
+const RINKEBY_RPC_URL = 'https://rinkeby.infura.io'
const DEFAULT_RPC_URL = TESTNET_RPC_URL
global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
@@ -12,5 +13,6 @@ module.exports = {
testnet: TESTNET_RPC_URL,
morden: TESTNET_RPC_URL,
kovan: KOVAN_RPC_URL,
+ rinkeby: RINKEBY_RPC_URL,
},
}
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index e31cb45ed..340ad4292 100644
--- a/app/scripts/lib/config-manager.js
+++ b/app/scripts/lib/config-manager.js
@@ -6,6 +6,8 @@ const TESTNET_RPC = MetamaskConfig.network.testnet
const MAINNET_RPC = MetamaskConfig.network.mainnet
const MORDEN_RPC = MetamaskConfig.network.morden
const KOVAN_RPC = MetamaskConfig.network.kovan
+const RINKEBY_RPC = MetamaskConfig.network.rinkeby
+
/* The config-manager is a convenience object
* wrapping a pojo-migrator.
@@ -153,6 +155,9 @@ ConfigManager.prototype.getCurrentRpcAddress = function () {
case 'kovan':
return KOVAN_RPC
+
+ case 'rinkeby':
+ return RINKEBY_RPC
default:
return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC
diff --git a/ui/app/app.js b/ui/app/app.js
index 5a7596aca..4ae40b659 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -264,6 +264,15 @@ App.prototype.renderNetworkDropdown = function () {
provider: props.provider,
}),
+ h(DropMenuItem, {
+ label: 'Rinkeby Test Network',
+ closeMenu: () => this.setState({ isNetworkMenuOpen: false}),
+ action: () => props.dispatch(actions.setProviderType('rinkeby')),
+ icon: h('.menu-icon.hollow-diamond'),
+ activeNetworkRender: props.network,
+ provider: props.provider,
+ }),
+
h(DropMenuItem, {
label: 'Localhost 8545',
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
diff --git a/ui/app/components/drop-menu-item.js b/ui/app/components/drop-menu-item.js
index 3eb6ec876..bd9d8f597 100644
--- a/ui/app/components/drop-menu-item.js
+++ b/ui/app/components/drop-menu-item.js
@@ -47,6 +47,9 @@ DropMenuItem.prototype.activeNetworkRender = function () {
case 'Kovan Test Network':
if (providerType === 'kovan') return h('.check', '✓')
break
+ case 'Rinkeby Test Network':
+ if (providerType === 'rinkeby') return h('.check', '✓')
+ break
case 'Localhost 8545':
if (activeNetwork === 'http://localhost:8545') return h('.check', '✓')
break
diff --git a/ui/app/components/network.js b/ui/app/components/network.js
index d9045167f..f0fc14454 100644
--- a/ui/app/components/network.js
+++ b/ui/app/components/network.js
@@ -43,7 +43,10 @@ Network.prototype.render = function () {
} else if (providerName === 'kovan') {
hoverText = 'Kovan Test Network'
iconName = 'kovan-test-network'
- } else {
+ } else if (providerName === 'rinkeby') {
+ hoverText = 'Rinkeby Test Network'
+ iconName = 'unknown-private-network'
+ }else {
hoverText = 'Unknown Private Network'
iconName = 'unknown-private-network'
}
diff --git a/ui/app/config.js b/ui/app/config.js
index 444365de2..26cfe663f 100644
--- a/ui/app/config.js
+++ b/ui/app/config.js
@@ -166,6 +166,11 @@ function currentProviderDisplay (metamaskState) {
value = 'Kovan Test Network'
break
+ case 'rinkeby':
+ title = 'Current Network'
+ value = 'Rinkeby Test Network'
+ break
+
default:
title = 'Current RPC'
value = metamaskState.provider.rpcTarget