mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #833 from MetaMask/i831-AddRopsten-Dev
Begin adding Ropsten support to dev
This commit is contained in:
commit
db5a4eab71
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Current Master
|
## Current Master
|
||||||
|
|
||||||
|
- Add support for the new, default Ropsten Test Network.
|
||||||
- Fix bug that would cause MetaMask to occasionally lose its StreamProvider connection and drop requests.
|
- Fix bug that would cause MetaMask to occasionally lose its StreamProvider connection and drop requests.
|
||||||
|
|
||||||
## 2.13.8 2016-11-16
|
## 2.13.8 2016-11-16
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask'
|
const MAINET_RPC_URL = 'https://mainnet.infura.io/metamask'
|
||||||
const TESTNET_RPC_URL = 'https://morden.infura.io/metamask'
|
const TESTNET_RPC_URL = 'https://ropsten.infura.io/metamask'
|
||||||
|
const MORDEN_RPC_URL = 'https://morden.infura.io/metamask'
|
||||||
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'
|
||||||
@ -10,5 +11,6 @@ module.exports = {
|
|||||||
default: DEFAULT_RPC_URL,
|
default: DEFAULT_RPC_URL,
|
||||||
mainnet: MAINET_RPC_URL,
|
mainnet: MAINET_RPC_URL,
|
||||||
testnet: TESTNET_RPC_URL,
|
testnet: TESTNET_RPC_URL,
|
||||||
|
morden: MORDEN_RPC_URL,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ const ethUtil = require('ethereumjs-util')
|
|||||||
|
|
||||||
const TESTNET_RPC = MetamaskConfig.network.testnet
|
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 txLimit = 40
|
const txLimit = 40
|
||||||
|
|
||||||
/* The config-manager is a convenience object
|
/* The config-manager is a convenience object
|
||||||
@ -182,6 +183,9 @@ ConfigManager.prototype.getCurrentRpcAddress = function () {
|
|||||||
case 'testnet':
|
case 'testnet':
|
||||||
return TESTNET_RPC
|
return TESTNET_RPC
|
||||||
|
|
||||||
|
case 'morden':
|
||||||
|
return MORDEN_RPC
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC
|
return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ App.prototype.renderNetworkDropdown = function () {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
h(DropMenuItem, {
|
h(DropMenuItem, {
|
||||||
label: 'Morden Test Network',
|
label: 'Ropsten Test Network',
|
||||||
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
|
||||||
action: () => props.dispatch(actions.setProviderType('testnet')),
|
action: () => props.dispatch(actions.setProviderType('testnet')),
|
||||||
icon: h('.menu-icon.red-dot'),
|
icon: h('.menu-icon.red-dot'),
|
||||||
@ -241,6 +241,15 @@ App.prototype.renderNetworkDropdown = function () {
|
|||||||
provider: props.provider,
|
provider: props.provider,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
h(DropMenuItem, {
|
||||||
|
label: 'Morden Test Network',
|
||||||
|
closeMenu: () => this.setState({ isNetworkMenuOpen: false }),
|
||||||
|
action: () => props.dispatch(actions.setProviderType('morden')),
|
||||||
|
icon: h('.menu-icon.red-dot'),
|
||||||
|
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 }),
|
||||||
|
@ -41,9 +41,12 @@ DropMenuItem.prototype.activeNetworkRender = function () {
|
|||||||
case 'Main Ethereum Network':
|
case 'Main Ethereum Network':
|
||||||
if (providerType === 'mainnet') return h('.check', '✓')
|
if (providerType === 'mainnet') return h('.check', '✓')
|
||||||
break
|
break
|
||||||
case 'Morden Test Network':
|
case 'Ropsten Test Network':
|
||||||
if (provider.type === 'testnet') return h('.check', '✓')
|
if (provider.type === 'testnet') return h('.check', '✓')
|
||||||
break
|
break
|
||||||
|
case 'Morden Test Network':
|
||||||
|
if (provider.type === 'morden') 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
|
||||||
|
@ -35,6 +35,12 @@ Network.prototype.render = function () {
|
|||||||
hoverText = 'Main Ethereum Network'
|
hoverText = 'Main Ethereum Network'
|
||||||
iconName = 'ethereum-network'
|
iconName = 'ethereum-network'
|
||||||
} else if (providerName === 'testnet') {
|
} else if (providerName === 'testnet') {
|
||||||
|
hoverText = 'Ropsten Test Network'
|
||||||
|
iconName = 'ropsten-test-network'
|
||||||
|
} else if (parseInt(networkNumber) === 3) {
|
||||||
|
hoverText = 'Ropsten Test Network'
|
||||||
|
iconName = 'ropsten-test-network'
|
||||||
|
} else if (parseInt(networkNumber) === 2) {
|
||||||
hoverText = 'Morden Test Network'
|
hoverText = 'Morden Test Network'
|
||||||
iconName = 'morden-test-network'
|
iconName = 'morden-test-network'
|
||||||
} else {
|
} else {
|
||||||
@ -62,6 +68,15 @@ Network.prototype.render = function () {
|
|||||||
}},
|
}},
|
||||||
'Ethereum Main Net'),
|
'Ethereum Main Net'),
|
||||||
])
|
])
|
||||||
|
case 'ropsten-test-network':
|
||||||
|
return h('.network-indicator', [
|
||||||
|
h('.menu-icon.red-dot'),
|
||||||
|
h('.network-name', {
|
||||||
|
style: {
|
||||||
|
color: '#ff6666',
|
||||||
|
}},
|
||||||
|
'Ropsten Test Net'),
|
||||||
|
])
|
||||||
case 'morden-test-network':
|
case 'morden-test-network':
|
||||||
return h('.network-indicator', [
|
return h('.network-indicator', [
|
||||||
h('.menu-icon.red-dot'),
|
h('.menu-icon.red-dot'),
|
||||||
|
@ -213,7 +213,7 @@ hr.horizontal-line {
|
|||||||
background: rgb(0, 163, 68);
|
background: rgb(0, 163, 68);
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
.morden-icon {
|
.testnet-icon {
|
||||||
background: #2465E1;
|
background: #2465E1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@ module.exports = function (address, network) {
|
|||||||
case 2: // morden test net
|
case 2: // morden test net
|
||||||
link = `http://testnet.etherscan.io/address/${address}`
|
link = `http://testnet.etherscan.io/address/${address}`
|
||||||
break
|
break
|
||||||
|
case 3: // ropsten test net
|
||||||
|
link = ''
|
||||||
|
break
|
||||||
default:
|
default:
|
||||||
link = ''
|
link = ''
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user