1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Sync default value of networkDetails w/ core (#19407)

In the core version of NetworkController, the `networkDetails` property
is initialized to `{ EIPS: {} }`. It is also reset to this
representation when `refreshNetwork` is called.

In this version of NetworkController, however, the default
representation of `networkDetails` is `{ EIPS: { 1559: undefined } }`.
From a consumer's perspective this doesn't make a difference — it's
practically the same. It does make a slight difference in tests,
however.

With that in mind, this commit changes the default representation to `{
EIPS: {} }`. This makes it easier to visually compare differences in the
NetworkController unit tests between core and this repo.
This commit is contained in:
Elliot Winkler 2023-06-02 14:35:08 -06:00 committed by GitHub
parent 931b126831
commit 63c402155d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 15 deletions

View File

@ -173,9 +173,7 @@ describe('NetworkController', () => {
{
"networkConfigurations": {},
"networkDetails": {
"EIPS": {
"1559": undefined,
},
"EIPS": {},
},
"networkId": null,
"networkStatus": "unknown",
@ -2804,9 +2802,7 @@ describe('NetworkController', () => {
expect(
controller.store.getState().networkDetails,
).toStrictEqual({
EIPS: {
1559: undefined,
},
EIPS: {},
});
},
});
@ -3519,9 +3515,7 @@ describe('NetworkController', () => {
expect(
controller.store.getState().networkDetails,
).toStrictEqual({
EIPS: {
1559: undefined,
},
EIPS: {},
});
},
});
@ -4788,9 +4782,7 @@ function refreshNetworkTests({
});
expect(controller.store.getState().networkDetails).toStrictEqual({
EIPS: {
1559: undefined,
},
EIPS: {},
});
},
);

View File

@ -357,9 +357,7 @@ function buildDefaultNetworkStatusState(): NetworkStatus {
*/
function buildDefaultNetworkDetailsState(): NetworkDetails {
return {
EIPS: {
1559: undefined,
},
EIPS: {},
};
}