Merge pull request #1243 from MetaMask/i238-kovan

Add Kovan Test Net
feature/default_network_editable
Dan Finlay 8 years ago committed by GitHub
commit b9714b881a
  1. 1
      CHANGELOG.md
  2. 2
      app/scripts/config.js
  3. 4
      app/scripts/lib/config-manager.js
  4. 9
      ui/app/app.js
  5. 5
      ui/app/components/drop-menu-item.js
  6. 12
      ui/app/components/network.js
  7. 5
      ui/app/config.js
  8. 2
      ui/app/css/lib.css
  9. 4
      ui/lib/account-link.js
  10. 5
      ui/lib/explorer-link.js

@ -9,6 +9,7 @@
- Removed support for old, lightwallet based vault. Users who have not opened app in over a month will need to recover with their seed phrase. This will allow Firefox support sooner.
- Fixed bug where spinner wouldn't disappear on incorrect password submission on seed word reveal.
- Polish the private key UI.
- Add Kovan as an option on our network list.
## 3.4.0 2017-3-8

@ -1,5 +1,6 @@
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 DEFAULT_RPC_URL = TESTNET_RPC_URL
global.METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
@ -10,5 +11,6 @@ module.exports = {
mainnet: MAINET_RPC_URL,
testnet: TESTNET_RPC_URL,
morden: TESTNET_RPC_URL,
kovan: KOVAN_RPC_URL,
},
}

@ -5,6 +5,7 @@ const normalize = require('eth-sig-util').normalize
const TESTNET_RPC = MetamaskConfig.network.testnet
const MAINNET_RPC = MetamaskConfig.network.mainnet
const MORDEN_RPC = MetamaskConfig.network.morden
const KOVAN_RPC = MetamaskConfig.network.kovan
/* The config-manager is a convenience object
* wrapping a pojo-migrator.
@ -150,6 +151,9 @@ ConfigManager.prototype.getCurrentRpcAddress = function () {
case 'morden':
return MORDEN_RPC
case 'kovan':
return KOVAN_RPC
default:
return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC
}

@ -255,6 +255,15 @@ App.prototype.renderNetworkDropdown = function () {
provider: props.provider,
}),
h(DropMenuItem, {
label: 'Kovan Test Network',
closeMenu: () => this.setState({ isNetworkMenuOpen: false}),
action: () => props.dispatch(actions.setProviderType('kovan')),
icon: h('.menu-icon.hollow-diamond'),
activeNetworkRender: props.network,
provider: props.provider,
}),
h(DropMenuItem, {
label: 'Localhost 8545',
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),

@ -42,7 +42,10 @@ DropMenuItem.prototype.activeNetworkRender = function () {
if (providerType === 'mainnet') return h('.check', '✓')
break
case 'Ropsten Test Network':
if (provider.type === 'testnet') return h('.check', '✓')
if (providerType === 'testnet') return h('.check', '✓')
break
case 'Kovan Test Network':
if (providerType === 'kovan') return h('.check', '✓')
break
case 'Localhost 8545':
if (activeNetwork === 'http://localhost:8545') return h('.check', '✓')

@ -40,6 +40,9 @@ Network.prototype.render = function () {
} else if (parseInt(networkNumber) === 3) {
hoverText = 'Ropsten Test Network'
iconName = 'ropsten-test-network'
} else if (providerName === 'kovan') {
hoverText = 'Kovan Test Network'
iconName = 'kovan-test-network'
} else {
hoverText = 'Unknown Private Network'
iconName = 'unknown-private-network'
@ -70,6 +73,15 @@ Network.prototype.render = function () {
}},
'Ropsten Test Net'),
])
case 'kovan-test-network':
return h('.network-indicator', [
h('.menu-icon.hollow-diamond'),
h('.network-name', {
style: {
color: '#690496',
}},
'Kovan Test Net'),
])
default:
return h('.network-indicator', [
h('i.fa.fa-question-circle.fa-lg', {

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

@ -188,7 +188,7 @@ hr.horizontal-line {
.hollow-diamond {
transform: rotate(45deg);
border: 1px solid #038789;
border: 3px solid #690496;
}
.pending-dot {

@ -1,7 +1,6 @@
module.exports = function (address, network) {
const net = parseInt(network)
let link
switch (net) {
case 1: // main net
link = `http://etherscan.io/address/${address}`
@ -12,6 +11,9 @@ module.exports = function (address, network) {
case 3: // ropsten test net
link = `http://testnet.etherscan.io/address/${address}`
break
case 42: // kovan test net
link = `http://kovan.etherscan.io/address/${address}`
break
default:
link = ''
break

@ -5,9 +5,12 @@ module.exports = function (hash, network) {
case 1: // main net
prefix = ''
break
case 3: // morden test net
case 3: // ropsten test net
prefix = 'testnet.'
break
case 42: // kovan test net
prefix = 'kovan.'
break
default:
prefix = ''
}

Loading…
Cancel
Save