mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
Remove unused parameters from setProviderType
(#11270)
Only the first parameter, `type`, was ever passed in. The others are superfluous. The defaults have been set directly instead. It's a bit silly to set the `rpcUrl` and `nickname` to an empty string, but to make this more sensible would take much more effort. This at least is simpler and guaranteed to be equivalent.
This commit is contained in:
parent
432d6508ba
commit
e5a050b36f
@ -205,7 +205,7 @@ export default class NetworkController extends EventEmitter {
|
||||
});
|
||||
}
|
||||
|
||||
async setProviderType(type, rpcUrl = '', ticker = 'ETH', nickname = '') {
|
||||
async setProviderType(type) {
|
||||
assert.notStrictEqual(
|
||||
type,
|
||||
NETWORK_TYPE_RPC,
|
||||
@ -216,7 +216,13 @@ export default class NetworkController extends EventEmitter {
|
||||
`Unknown Infura provider type "${type}".`,
|
||||
);
|
||||
const { chainId } = NETWORK_TYPE_TO_ID_MAP[type];
|
||||
this.setProviderConfig({ type, rpcUrl, chainId, ticker, nickname });
|
||||
this.setProviderConfig({
|
||||
type,
|
||||
rpcUrl: '',
|
||||
chainId,
|
||||
ticker: 'ETH',
|
||||
nickname: '',
|
||||
});
|
||||
}
|
||||
|
||||
resetConnection() {
|
||||
|
Loading…
Reference in New Issue
Block a user