1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02: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": {}, "networkConfigurations": {},
"networkDetails": { "networkDetails": {
"EIPS": { "EIPS": {},
"1559": undefined,
},
}, },
"networkId": null, "networkId": null,
"networkStatus": "unknown", "networkStatus": "unknown",
@ -2804,9 +2802,7 @@ describe('NetworkController', () => {
expect( expect(
controller.store.getState().networkDetails, controller.store.getState().networkDetails,
).toStrictEqual({ ).toStrictEqual({
EIPS: { EIPS: {},
1559: undefined,
},
}); });
}, },
}); });
@ -3519,9 +3515,7 @@ describe('NetworkController', () => {
expect( expect(
controller.store.getState().networkDetails, controller.store.getState().networkDetails,
).toStrictEqual({ ).toStrictEqual({
EIPS: { EIPS: {},
1559: undefined,
},
}); });
}, },
}); });
@ -4788,9 +4782,7 @@ function refreshNetworkTests({
}); });
expect(controller.store.getState().networkDetails).toStrictEqual({ expect(controller.store.getState().networkDetails).toStrictEqual({
EIPS: { EIPS: {},
1559: undefined,
},
}); });
}, },
); );

View File

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