Skip to content

Commit

Permalink
Remove ETC additions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfranko committed Aug 23, 2018
1 parent f9f4414 commit 089e84e
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 146 deletions.
3 changes: 0 additions & 3 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,6 @@
"ropsten": {
"message": "Ropsten Test Network"
},
"classic": {
"message": "Ethereum Classic Network"
},
"rpc": {
"message": "Custom RPC"
},
Expand Down
6 changes: 0 additions & 6 deletions app/scripts/controllers/network/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,29 @@ const RINKEBY = 'rinkeby'
const KOVAN = 'kovan'
const MAINNET = 'mainnet'
const LOCALHOST = 'localhost'
const CLASSIC = 'classic'

const MAINNET_CODE = 1
const ROPSTEN_CODE = 3
const RINKEYBY_CODE = 4
const KOVAN_CODE = 42
const CLASSIC_CODE = 61

const ROPSTEN_DISPLAY_NAME = 'Ropsten'
const RINKEBY_DISPLAY_NAME = 'Rinkeby'
const KOVAN_DISPLAY_NAME = 'Kovan'
const MAINNET_DISPLAY_NAME = 'Main Ethereum Network'
const CLASSIC_DISPLAY_NAME = 'Ethereum Classic'

module.exports = {
ROPSTEN,
RINKEBY,
KOVAN,
MAINNET,
CLASSIC,
LOCALHOST,
MAINNET_CODE,
ROPSTEN_CODE,
RINKEYBY_CODE,
KOVAN_CODE,
CLASSIC_CODE,
ROPSTEN_DISPLAY_NAME,
RINKEBY_DISPLAY_NAME,
KOVAN_DISPLAY_NAME,
MAINNET_DISPLAY_NAME,
CLASSIC_DISPLAY_NAME,
}
20 changes: 1 addition & 19 deletions app/scripts/controllers/network/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ const createInfuraClient = require('./createInfuraClient')
const createJsonRpcClient = require('./createJsonRpcClient')
const createLocalhostClient = require('./createLocalhostClient')
const { createSwappableProxy, createEventEmitterProxy } = require('swappable-obj-proxy')
const networks = require('./networks')
const extend = require('xtend')

const {
ROPSTEN,
RINKEBY,
KOVAN,
MAINNET,
CLASSIC,
LOCALHOST,
} = require('./enums')
const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET]
const ALL_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET, CLASSIC]
const ALL_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET]

const env = process.env.METAMASK_ENV
const METAMASK_DEBUG = process.env.METAMASK_DEBUG
Expand Down Expand Up @@ -161,9 +159,6 @@ module.exports = class NetworkController extends EventEmitter {
const isInfura = INFURA_PROVIDER_TYPES.includes(type)
if (isInfura) {
this._configureInfuraProvider(opts)
// other predefined endpoints
} else if (ALL_PROVIDER_TYPES.includes(type)){
this._configurePredefinedProvider(opts)
// other type-based rpc endpoints
} else if (type === LOCALHOST) {
this._configureLocalhostProvider()
Expand Down Expand Up @@ -192,19 +187,6 @@ module.exports = class NetworkController extends EventEmitter {
this._setNetworkClient(networkClient)
}

_configurePredefinedProvider ({ type }) {
log.info('NetworkController - configurePredefinedProvider', type)
// setup networkConfig
var settings = {
network: networks.networkList[type].chainId,
}
settings = extend(settings, networks.networkList[type])
const rpcUrl = networks.networkList[type].rpcUrl
const networkClient = createJsonRpcClient({ rpcUrl })
this.networkConfig.putState(settings)
this._setNetworkClient(networkClient)
}

_configureStandardProvider ({ rpcUrl, chainId }) {
log.info('NetworkController - configureStandardProvider', rpcUrl)
const networkClient = createJsonRpcClient({ rpcUrl })
Expand Down
23 changes: 0 additions & 23 deletions app/scripts/controllers/network/networks.js

This file was deleted.

5 changes: 0 additions & 5 deletions app/scripts/controllers/network/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,23 @@ const {
RINKEBY,
KOVAN,
MAINNET,
CLASSIC,
ROPSTEN_CODE,
RINKEYBY_CODE,
KOVAN_CODE,
CLASSIC_CODE,
ROPSTEN_DISPLAY_NAME,
RINKEBY_DISPLAY_NAME,
KOVAN_DISPLAY_NAME,
MAINNET_DISPLAY_NAME,
CLASSIC_DISPLAY_NAME,
} = require('./enums')

const networkToNameMap = {
[ROPSTEN]: ROPSTEN_DISPLAY_NAME,
[RINKEBY]: RINKEBY_DISPLAY_NAME,
[KOVAN]: KOVAN_DISPLAY_NAME,
[MAINNET]: MAINNET_DISPLAY_NAME,
[CLASSIC]: CLASSIC_DISPLAY_NAME,
[ROPSTEN_CODE]: ROPSTEN_DISPLAY_NAME,
[RINKEYBY_CODE]: RINKEBY_DISPLAY_NAME,
[KOVAN_CODE]: KOVAN_DISPLAY_NAME,
[CLASSIC_CODE]: CLASSIC_DISPLAY_NAME,
}

const getNetworkDisplayName = key => networkToNameMap[key]
Expand Down
2 changes: 0 additions & 2 deletions old-ui/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ App.prototype.getNetworkName = function () {
name = 'Kovan Test Network'
} else if (providerName === 'rinkeby') {
name = 'Rinkeby Test Network'
} else if (providerName === 'classic') {
name = 'Ethereum Classic Network'
} else {
name = 'Unknown Private Network'
}
Expand Down
14 changes: 0 additions & 14 deletions old-ui/app/components/app-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,20 +287,6 @@ module.exports = class AppBar extends Component {
? h('.check', '✓')
: null,
]),
h(DropdownMenuItem, {
key: 'classic',
closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }),
onClick: () => dispatch(actions.setProviderType('classic')),
style: {
fontSize: '18px',
},
}, [
h('.menu-icon.diamond'),
'Ethereum Classic Network',
providerType === 'classic'
? h('.check', '✓')
: null,
]),
h(DropdownMenuItem, {
key: 'default',
closeMenu: () => this.setState({ isNetworkMenuOpen: !isOpen }),
Expand Down
13 changes: 0 additions & 13 deletions old-ui/app/components/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ Network.prototype.render = function () {
} else if (providerName === 'rinkeby') {
hoverText = 'Rinkeby Test Network'
iconName = 'rinkeby-test-network'
} else if (providerName === 'classic') {
hoverText = 'Ethereum Classic'
iconName = 'ethereum-classic-network'
} else {
hoverText = 'Unknown Private Network'
iconName = 'unknown-private-network'
Expand Down Expand Up @@ -111,16 +108,6 @@ Network.prototype.render = function () {
'Rinkeby Test Net'),
props.onClick && h('i.fa.fa-caret-down.fa-lg'),
])
case 'ethereum-classic-network':
return h('.network-indicator', [
h('.menu-icon.diamond'),
h('.network-name', {
style: {
color: '#267f00',
}},
'Ethereum Classic Network'),
props.onClick && h('i.fa.fa-caret-down.fa-lg'),
])
default:
return h('.network-indicator', [
h('i.fa.fa-question-circle.fa-lg', {
Expand Down
5 changes: 0 additions & 5 deletions old-ui/app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,6 @@ function currentProviderDisplay (metamaskState) {
value = 'Rinkeby Test Network'
break

case 'classic':
title = 'Current Network'
value = 'Ethereum Classic Network'
break

default:
title = 'Current RPC'
value = metamaskState.provider.rpcTarget
Expand Down
6 changes: 0 additions & 6 deletions test/unit/app/controllers/network-contoller-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ describe('Network utils', () => {
}, {
input: 42,
expected: 'Kovan',
}, {
input: 61,
expected: 'Ethereum Classic',
}, {
input: 'ropsten',
expected: 'Ropsten',
Expand All @@ -92,9 +89,6 @@ describe('Network utils', () => {
}, {
input: 'kovan',
expected: 'Kovan',
}, {
input: 'classic',
expected: 'Ethereum Classic',
}, {
input: 'mainnet',
expected: 'Main Ethereum Network',
Expand Down
4 changes: 0 additions & 4 deletions ui/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ class App extends Component {
name = this.context.t('connectingToRopsten')
} else if (providerName === 'rinkeby') {
name = this.context.t('connectingToRinkeby')
} else if (providerName === 'classic') {
name = this.context.t('connectingToClassic')
} else {
name = this.context.t('connectingToUnknown')
}
Expand All @@ -251,8 +249,6 @@ class App extends Component {
name = this.context.t('kovan')
} else if (providerName === 'rinkeby') {
name = this.context.t('rinkeby')
} else if (providerName === 'classic') {
name = this.context.t('classic')
} else {
name = this.context.t('unknownNetwork')
}
Expand Down
24 changes: 0 additions & 24 deletions ui/app/components/dropdowns/network-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,28 +200,6 @@ NetworkDropdown.prototype.render = function () {
]
),

h(
DropdownMenuItem,
{
key: 'classic',
closeMenu: () => this.props.hideNetworkDropdown(),
onClick: () => props.setProviderType('classic'),
style: dropdownMenuItemStyle,
},
[
providerType === 'classic' ? h('i.fa.fa-check') : h('.network-check__transparent', '✓'),
h(NetworkDropdownIcon, {
backgroundColor: '#228B22', // forest green
isSelected: providerType === 'classic',
}),
h('span.network-name-item', {
style: {
color: providerType === 'classic' ? '#ffffff' : '#9b9b9b',
},
}, this.context.t('classic')),
]
),

h(
DropdownMenuItem,
{
Expand Down Expand Up @@ -286,8 +264,6 @@ NetworkDropdown.prototype.getNetworkName = function () {
name = this.context.t('kovan')
} else if (providerName === 'rinkeby') {
name = this.context.t('rinkeby')
} else if (providerName === 'classic') {
name = this.context.t('classic')
} else {
name = this.context.t('unknownNetwork')
}
Expand Down
7 changes: 0 additions & 7 deletions ui/app/components/network-display/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
background-color: lighten($tulip-tree, 35%);
}

&--classic {
background-color: lighten($java, 45%);
}
}

&__name {
Expand Down Expand Up @@ -54,9 +51,5 @@
&--rinkeby {
background-color: $tulip-tree;
}

&--classic {
background-color: $java;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import {
ROPSTEN_CODE,
RINKEYBY_CODE,
KOVAN_CODE,
CLASSIC_CODE,
} from '../../../../app/scripts/controllers/network/enums'

const networkToClassHash = {
[MAINNET_CODE]: 'mainnet',
[ROPSTEN_CODE]: 'ropsten',
[RINKEYBY_CODE]: 'rinkeby',
[KOVAN_CODE]: 'kovan',
[CLASSIC_CODE]: 'classic',
}

export default class NetworkDisplay extends Component {
Expand Down
13 changes: 0 additions & 13 deletions ui/app/components/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ Network.prototype.render = function () {
} else if (providerName === 'rinkeby') {
hoverText = context.t('rinkeby')
iconName = 'rinkeby-test-network'
} else if (providerName === 'classic') {
hoverText = context.t('classic')
iconName = 'ethereum-classic-network'
} else {
hoverText = context.t('unknownNetwork')
iconName = 'unknown-private-network'
Expand All @@ -79,7 +76,6 @@ Network.prototype.render = function () {
'ropsten-test-network': providerName === 'ropsten' || parseInt(networkNumber) === 3,
'kovan-test-network': providerName === 'kovan',
'rinkeby-test-network': providerName === 'rinkeby',
'ethereum-classic-network': providerName === 'classic',
}),
title: hoverText,
onClick: (event) => {
Expand Down Expand Up @@ -126,15 +122,6 @@ Network.prototype.render = function () {
h('.network-name', context.t('rinkeby')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
])
case 'ethereum-classic-network':
return h('.network-indicator', [
h(NetworkDropdownIcon, {
backgroundColor: '#228B22', // green
nonSelectBackgroundColor: '#46893D',
}),
h('.network-name', context.t('classic')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'),
])
default:
return h('.network-indicator', [
h('i.fa.fa-question-circle.fa-lg', {
Expand Down

0 comments on commit 089e84e

Please sign in to comment.