mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Update NC setProviderType to clear rpcUrl/nickname (#18675)
In the core version of NetworkController, `setProviderType` sets `rpcTarget` (its name for `rpcUrl`) and `nickname` to `undefined`. While it would be better to completely remove these properties, it would be better to follow suit so that we can make the tests between the two versions of the controllers more alike.
This commit is contained in:
parent
f9f628690c
commit
73b9c1095a
@ -5006,10 +5006,10 @@ describe('NetworkController', () => {
|
||||
|
||||
expect(controller.store.getState().provider).toStrictEqual({
|
||||
type: networkType,
|
||||
rpcUrl: '',
|
||||
rpcUrl: undefined,
|
||||
chainId,
|
||||
ticker,
|
||||
nickname: '',
|
||||
nickname: undefined,
|
||||
rpcPrefs: { blockExplorerUrl },
|
||||
});
|
||||
},
|
||||
@ -6975,10 +6975,10 @@ describe('NetworkController', () => {
|
||||
await controller.setProviderType('goerli');
|
||||
expect(controller.store.getState().provider).toStrictEqual({
|
||||
type: 'goerli',
|
||||
rpcUrl: '',
|
||||
rpcUrl: undefined,
|
||||
chainId: '0x5',
|
||||
ticker: 'GoerliETH',
|
||||
nickname: '',
|
||||
nickname: undefined,
|
||||
rpcPrefs: {
|
||||
blockExplorerUrl: 'https://goerli.etherscan.io',
|
||||
},
|
||||
|
@ -742,10 +742,10 @@ export class NetworkController extends EventEmitter {
|
||||
const network = BUILT_IN_INFURA_NETWORKS[type];
|
||||
await this.#setProviderConfig({
|
||||
type,
|
||||
rpcUrl: '',
|
||||
rpcUrl: undefined,
|
||||
chainId: network.chainId,
|
||||
ticker: 'ticker' in network ? network.ticker : 'ETH',
|
||||
nickname: '',
|
||||
nickname: undefined,
|
||||
rpcPrefs: { blockExplorerUrl: network.blockExplorerUrl },
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user