From 603464c5056e94aee8305796da60c339b4b60497 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Wed, 22 May 2024 11:23:37 -0600 Subject: [PATCH] AccountTrackerController: Remove ref to providerConfig The `providerConfig` state property is being removed from NetworkController. Currently this property is used in AccountTrackerController to access the type of the `chainId` property, but we know that this type is `Hex`, so we can simply use it directly. This commit makes that change so that we can fully drop `providerConfig`. --- packages/assets-controllers/src/AccountTrackerController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/assets-controllers/src/AccountTrackerController.ts b/packages/assets-controllers/src/AccountTrackerController.ts index 6c8479dc2b..7e4a5cffe6 100644 --- a/packages/assets-controllers/src/AccountTrackerController.ts +++ b/packages/assets-controllers/src/AccountTrackerController.ts @@ -5,10 +5,10 @@ import type { Provider } from '@metamask/eth-query'; import type { NetworkClientId, NetworkController, - NetworkState, } from '@metamask/network-controller'; import { StaticIntervalPollingControllerV1 } from '@metamask/polling-controller'; import type { PreferencesState } from '@metamask/preferences-controller'; +import type { Hex } from '@metamask/utils'; import { assert } from '@metamask/utils'; import { Mutex } from 'async-mutex'; import { cloneDeep } from 'lodash'; @@ -120,7 +120,7 @@ export class AccountTrackerController extends StaticIntervalPollingControllerV1< private readonly getMultiAccountBalancesEnabled: () => PreferencesState['isMultiAccountBalancesEnabled']; - private readonly getCurrentChainId: () => NetworkState['providerConfig']['chainId']; + private readonly getCurrentChainId: () => Hex; private readonly getNetworkClientById: NetworkController['getNetworkClientById']; @@ -152,7 +152,7 @@ export class AccountTrackerController extends StaticIntervalPollingControllerV1< getIdentities: () => PreferencesState['identities']; getSelectedAddress: () => PreferencesState['selectedAddress']; getMultiAccountBalancesEnabled: () => PreferencesState['isMultiAccountBalancesEnabled']; - getCurrentChainId: () => NetworkState['providerConfig']['chainId']; + getCurrentChainId: () => Hex; getNetworkClientById: NetworkController['getNetworkClientById']; }, config?: Partial,