From 63c402155d53b0575b23ef7bd8458116867dc722 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Fri, 2 Jun 2023 14:35:08 -0600 Subject: [PATCH] Sync default value of networkDetails w/ core (#19407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../network/network-controller.test.ts | 16 ++++------------ .../controllers/network/network-controller.ts | 4 +--- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/app/scripts/controllers/network/network-controller.test.ts b/app/scripts/controllers/network/network-controller.test.ts index b438896a0..563bd3df9 100644 --- a/app/scripts/controllers/network/network-controller.test.ts +++ b/app/scripts/controllers/network/network-controller.test.ts @@ -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: {}, }); }, ); diff --git a/app/scripts/controllers/network/network-controller.ts b/app/scripts/controllers/network/network-controller.ts index ac0193d88..06d9a66d1 100644 --- a/app/scripts/controllers/network/network-controller.ts +++ b/app/scripts/controllers/network/network-controller.ts @@ -357,9 +357,7 @@ function buildDefaultNetworkStatusState(): NetworkStatus { */ function buildDefaultNetworkDetailsState(): NetworkDetails { return { - EIPS: { - 1559: undefined, - }, + EIPS: {}, }; }