1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Merge branch 'master' into i1234-HardGasLimits-BrowserForm

This commit is contained in:
Dan Finlay 2017-03-22 16:00:11 -07:00 committed by GitHub
commit 86f9be06eb
14 changed files with 53 additions and 17 deletions

View File

@ -12,6 +12,7 @@
- Enforce minimum values for gas price and gas limit. - Enforce minimum values for gas price and gas limit.
- Fix bug where total gas was sometimes not live-updated. - Fix bug where total gas was sometimes not live-updated.
- Fix bug where editing gas value could have some abrupt behaviors (#1233) - Fix bug where editing gas value could have some abrupt behaviors (#1233)
- Add Kovan as an option on our network list.
## 3.4.0 2017-3-8 ## 3.4.0 2017-3-8

View File

@ -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://ropsten.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 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 = {
mainnet: MAINET_RPC_URL, mainnet: MAINET_RPC_URL,
testnet: TESTNET_RPC_URL, testnet: TESTNET_RPC_URL,
morden: TESTNET_RPC_URL, morden: TESTNET_RPC_URL,
kovan: KOVAN_RPC_URL,
}, },
} }

View File

@ -69,14 +69,10 @@ function shouldInjectWeb3 () {
} }
function isAllowedSuffix (testCase) { function isAllowedSuffix (testCase) {
var prohibitedTypes = ['xml', 'pdf'] const doctype = window.document.doctype
var currentUrl = window.location.href if (doctype) {
var currentRegex return doctype.name === 'html'
for (let i = 0; i < prohibitedTypes.length; i++) { } else {
currentRegex = new RegExp(`\.${prohibitedTypes[i]}$`) return false
if (currentRegex.test(currentUrl)) {
return false
}
} }
return true
} }

View File

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

View File

@ -60,7 +60,7 @@ JsonImportSubview.prototype.render = function () {
}, },
}, 'Import'), }, 'Import'),
error ? h('span.warning', error) : null, error ? h('span.error', error) : null,
]) ])
) )
} }
@ -95,4 +95,3 @@ JsonImportSubview.prototype.createNewKeychain = function () {
this.props.dispatch(actions.importNewAccount('JSON File', [ fileContents, password ])) this.props.dispatch(actions.importNewAccount('JSON File', [ fileContents, password ]))
} }

View File

@ -48,7 +48,7 @@ PrivateKeyImportView.prototype.render = function () {
}, },
}, 'Import'), }, 'Import'),
error ? h('span.warning', error) : null, error ? h('span.error', error) : null,
]) ])
) )
} }
@ -65,4 +65,3 @@ PrivateKeyImportView.prototype.createNewKeychain = function () {
const privateKey = input.value const privateKey = input.value
this.props.dispatch(actions.importNewAccount('Private Key', [ privateKey ])) this.props.dispatch(actions.importNewAccount('Private Key', [ privateKey ]))
} }

View File

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

View File

@ -52,6 +52,7 @@ ExportAccountView.prototype.render = function () {
}, [ }, [
h('p.error', warning), h('p.error', warning),
h('input#exportAccount.sizing-input', { h('input#exportAccount.sizing-input', {
type: 'password',
placeholder: 'confirm password', placeholder: 'confirm password',
onKeyPress: this.onExportKeyPress.bind(this), onKeyPress: this.onExportKeyPress.bind(this),
style: { style: {

View File

@ -42,7 +42,10 @@ DropMenuItem.prototype.activeNetworkRender = function () {
if (providerType === 'mainnet') return h('.check', '✓') if (providerType === 'mainnet') return h('.check', '✓')
break break
case 'Ropsten Test Network': 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 break
case 'Localhost 8545': case 'Localhost 8545':
if (activeNetwork === 'http://localhost:8545') return h('.check', '✓') if (activeNetwork === 'http://localhost:8545') return h('.check', '✓')

View File

@ -40,6 +40,9 @@ Network.prototype.render = function () {
} else if (parseInt(networkNumber) === 3) { } else if (parseInt(networkNumber) === 3) {
hoverText = 'Ropsten Test Network' hoverText = 'Ropsten Test Network'
iconName = 'ropsten-test-network' iconName = 'ropsten-test-network'
} else if (providerName === 'kovan') {
hoverText = 'Kovan Test Network'
iconName = 'kovan-test-network'
} else { } else {
hoverText = 'Unknown Private Network' hoverText = 'Unknown Private Network'
iconName = 'unknown-private-network' iconName = 'unknown-private-network'
@ -70,6 +73,15 @@ Network.prototype.render = function () {
}}, }},
'Ropsten Test Net'), '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: default:
return h('.network-indicator', [ return h('.network-indicator', [
h('i.fa.fa-question-circle.fa-lg', { h('i.fa.fa-question-circle.fa-lg', {

View File

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

View File

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

View File

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

View File

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