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

Set rpcTarget, nickname, and ticker when selecting one of the default networks

This commit is contained in:
Thomas Huang 2019-04-16 11:15:53 -06:00
parent d7a2ea9a2b
commit 33836c0463

View File

@ -140,10 +140,10 @@ module.exports = class NetworkController extends EventEmitter {
this.providerConfig = providerConfig this.providerConfig = providerConfig
} }
async setProviderType (type) { async setProviderType (type, rpcTarget = '', ticker = 'ETH', nickname = '') {
assert.notEqual(type, 'rpc', `NetworkController - cannot call "setProviderType" with type 'rpc'. use "setRpcTarget"`) assert.notEqual(type, 'rpc', `NetworkController - cannot call "setProviderType" with type 'rpc'. use "setRpcTarget"`)
assert(INFURA_PROVIDER_TYPES.includes(type) || type === LOCALHOST, `NetworkController - Unknown rpc type "${type}"`) assert(INFURA_PROVIDER_TYPES.includes(type) || type === LOCALHOST, `NetworkController - Unknown rpc type "${type}"`)
const providerConfig = { type } const providerConfig = { type, rpcTarget, ticker, nickname }
this.providerConfig = providerConfig this.providerConfig = providerConfig
} }