mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
setActiveNetwork captures network config ID (#19404)
In the core version of NetworkController, when the `setActiveNetwork` method updates the provider configuration object, it will capture the ID of the network configuration used to do so within the provider config itself. In the same way, `setProviderType` clears any ID that was previously set from the provider config. This commit updates this version of NetworkController to be consistent and updates tests to match.
This commit is contained in:
parent
2b95d7b242
commit
db45a0aef4
@ -2383,6 +2383,7 @@ describe('NetworkController', () => {
|
||||
ticker,
|
||||
nickname: undefined,
|
||||
rpcPrefs: { blockExplorerUrl },
|
||||
id: undefined,
|
||||
});
|
||||
},
|
||||
);
|
||||
@ -3287,6 +3288,7 @@ describe('NetworkController', () => {
|
||||
rpcPrefs: {
|
||||
blockExplorerUrl: 'https://goerli.etherscan.io',
|
||||
},
|
||||
id: undefined,
|
||||
});
|
||||
|
||||
await waitForLookupNetworkToComplete({
|
||||
|
@ -181,6 +181,10 @@ export type ProviderConfiguration = {
|
||||
rpcPrefs?: {
|
||||
blockExplorerUrl?: string;
|
||||
};
|
||||
/**
|
||||
* The ID of the network configuration used to build this provider config.
|
||||
*/
|
||||
id?: NetworkConfigurationId;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -725,6 +729,7 @@ export class NetworkController extends EventEmitter {
|
||||
ticker: 'ticker' in network ? network.ticker : 'ETH',
|
||||
nickname: undefined,
|
||||
rpcPrefs: { blockExplorerUrl: network.blockExplorerUrl },
|
||||
id: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user