1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00

add rinkeby network

This commit is contained in:
Nickyg 2017-04-26 01:40:33 +05:30
parent afbe6f5e5f
commit e9aa37b699
6 changed files with 28 additions and 1 deletions

View File

@ -1,6 +1,7 @@
const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask' const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask'
const TESTNET_RPC_URL = 'https://ropsten.infura.io/metamask' const TESTNET_RPC_URL = 'https://ropsten.infura.io/metamask'
const KOVAN_RPC_URL = 'https://kovan.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 const DEFAULT_RPC_URL = TESTNET_RPC_URL
global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG' global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
@ -12,5 +13,6 @@ module.exports = {
testnet: TESTNET_RPC_URL, testnet: TESTNET_RPC_URL,
morden: TESTNET_RPC_URL, morden: TESTNET_RPC_URL,
kovan: KOVAN_RPC_URL, kovan: KOVAN_RPC_URL,
rinkeby: RINKEBY_RPC_URL,
}, },
} }

View File

@ -6,6 +6,8 @@ const TESTNET_RPC = MetamaskConfig.network.testnet
const MAINNET_RPC = MetamaskConfig.network.mainnet const MAINNET_RPC = MetamaskConfig.network.mainnet
const MORDEN_RPC = MetamaskConfig.network.morden const MORDEN_RPC = MetamaskConfig.network.morden
const KOVAN_RPC = MetamaskConfig.network.kovan const KOVAN_RPC = MetamaskConfig.network.kovan
const RINKEBY_RPC = MetamaskConfig.network.rinkeby
/* The config-manager is a convenience object /* The config-manager is a convenience object
* wrapping a pojo-migrator. * wrapping a pojo-migrator.
@ -154,6 +156,9 @@ ConfigManager.prototype.getCurrentRpcAddress = function () {
case 'kovan': case 'kovan':
return KOVAN_RPC return KOVAN_RPC
case 'rinkeby':
return RINKEBY_RPC
default: default:
return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC
} }

View File

@ -264,6 +264,15 @@ App.prototype.renderNetworkDropdown = function () {
provider: props.provider, 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, { h(DropMenuItem, {
label: 'Localhost 8545', label: 'Localhost 8545',
closeMenu: () => this.setState({ isNetworkMenuOpen: false }), closeMenu: () => this.setState({ isNetworkMenuOpen: false }),

View File

@ -47,6 +47,9 @@ DropMenuItem.prototype.activeNetworkRender = function () {
case 'Kovan Test Network': case 'Kovan Test Network':
if (providerType === 'kovan') return h('.check', '✓') if (providerType === 'kovan') return h('.check', '✓')
break break
case 'Rinkeby Test Network':
if (providerType === 'rinkeby') return h('.check', '✓')
break
case 'Localhost 8545': case 'Localhost 8545':
if (activeNetwork === 'http://localhost:8545') return h('.check', '✓') if (activeNetwork === 'http://localhost:8545') return h('.check', '✓')
break break

View File

@ -43,7 +43,10 @@ Network.prototype.render = function () {
} else if (providerName === 'kovan') { } else if (providerName === 'kovan') {
hoverText = 'Kovan Test Network' hoverText = 'Kovan Test Network'
iconName = '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' hoverText = 'Unknown Private Network'
iconName = 'unknown-private-network' iconName = 'unknown-private-network'
} }

View File

@ -166,6 +166,11 @@ function currentProviderDisplay (metamaskState) {
value = 'Kovan Test Network' value = 'Kovan Test Network'
break break
case 'rinkeby':
title = 'Current Network'
value = 'Rinkeby Test Network'
break
default: default:
title = 'Current RPC' title = 'Current RPC'
value = metamaskState.provider.rpcTarget value = metamaskState.provider.rpcTarget