Skip to content

Commit

Permalink
AccountTrackerController: Remove ref to providerConfig (#4306)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
mcmire authored Jun 4, 2024
1 parent 1cbef7d commit d5c6ca8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/assets-controllers/src/AccountTrackerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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'];

Expand Down Expand Up @@ -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<AccountTrackerConfig>,
Expand Down

0 comments on commit d5c6ca8

Please sign in to comment.