1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +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:
Mark Stacey 2021-06-10 13:54:18 -02:30 committed by GitHub
parent 432d6508ba
commit e5a050b36f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {