Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Add background Redux slice as proxy for unflattened background state #29694

Draft
wants to merge 101 commits into
base: jongsun/refactor/redux/250221-unflattening-types
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
52e818a
Remove `getFlatState` method from `ComposableObservableStore`
MajorLift Nov 6, 2024
2a1fee2
Define types for metamask controller store fields
MajorLift Nov 6, 2024
3beda4d
Refactor `MetamaskController` `store`, `memStore` fields so that they…
MajorLift Dec 6, 2024
7143084
Update `PatchStore` class to conform with new state types
MajorLift Nov 11, 2024
28ca845
Fix errors in `MetamaskController` store objects and types
MajorLift Nov 27, 2024
1f65a9f
Fix import paths
MajorLift Nov 27, 2024
899d855
Simply `PatchStore._generatePatches`
MajorLift Nov 27, 2024
0eb33d7
Update `App{State,Metadata}Controller` entries in store objects/types…
MajorLift Dec 4, 2024
cb7eecd
Move `metamask-controllers` types to `shared` directory
MajorLift Dec 4, 2024
55fe737
Remove `NotificationController` from `MetamaskController` and store
MajorLift Dec 2, 2024
eea4c34
Define `BackgroundStateProxy` type and replace `MemStoreControllersCo…
MajorLift Dec 4, 2024
e3be201
Add `eslint-disable` for `no-restricted-paths` in types file
MajorLift Dec 4, 2024
601ce9e
Optimize `PatchStore` to utilize `controllerKey` payload from `stateC…
MajorLift Dec 4, 2024
6e54d6a
Fix `sanitizeUIState` with `in` property checks
MajorLift Dec 4, 2024
5f88de6
Update and fix `store`, `memStore`
MajorLift Dec 5, 2024
2fc248a
Fix broken import for `BalancesControllerState`
MajorLift Dec 9, 2024
622a096
Convert `ComposableObservableStore` to TypeScript
MajorLift Dec 9, 2024
81e7756
Fix all type errors in `ComposableObservableStore`
MajorLift Dec 9, 2024
f94f6a2
Allow `PatchStore` to handle top-level keys that aren't controllerKey…
MajorLift Dec 9, 2024
474efaa
Fix implicit `any` in institutional store types
MajorLift Dec 10, 2024
1ccda39
refactor: `ComposableObservableStore` takes a controller map as input…
MajorLift Dec 10, 2024
11831bc
Fix `BridgeControllerState` import path
MajorLift Dec 11, 2024
df7fa87
Remove `ui/selectors/institutional/selectors.ts` from diff
MajorLift Dec 11, 2024
b74b346
Refactor `sanitizeUIState` so it can handle both the entire backgroun…
MajorLift Dec 12, 2024
d954084
Fix `PatchStore` to handle individual controller state only and not u…
MajorLift Dec 12, 2024
578a736
Fix Redux store actions `updateMetamaskState`, `applyPatches` to ensu…
MajorLift Dec 12, 2024
1b62855
Handle more edge cases in null check for `controller.store.subscribe`
MajorLift Dec 12, 2024
50ba81a
Add variable assignment
MajorLift Dec 12, 2024
398bc7c
Convert `ComposableObservableStore.test.{j,t}s`
MajorLift Dec 13, 2024
25cc18f
Remove incorrect return type on `sanitizeUIState`
MajorLift Dec 13, 2024
1eb1d70
Fix tests for `PatchStore`, `sanitizeUiState`
MajorLift Dec 13, 2024
d93a318
Fix tests for `ComposableObservableStore`
MajorLift Dec 13, 2024
bd57b45
Linter fixes
MajorLift Jan 6, 2025
83316a5
Temporary adjustment for `Bridge{,Status}ControllerState` types
MajorLift Jan 6, 2025
312898f
Move `initialMetamaskState` into `ui/ducks/metamask/constants.ts`
MajorLift Dec 11, 2024
46d9d90
Remove `TemporaryBackgroundState` type and merge into `initialMetamas…
MajorLift Jan 6, 2025
42607b3
Merge `MetamaskState` defined in `metametrics-controller` into `initi…
MajorLift Dec 2, 2024
ad32360
Convert to TypeScript: `combineReducer`, `metamask` slice
MajorLift Dec 2, 2024
161b882
Unflatten `metamask` slice and convert to TypeScript
MajorLift Dec 11, 2024
d05b4ec
Replace `CombinedBackgroundAndReduxState` type with fixed `MetaMaskRe…
MajorLift Dec 4, 2024
fdcc097
Remove unused import
MajorLift Dec 4, 2024
6b66633
Unflatten `SENTRY_UI_STATE` object
MajorLift Dec 5, 2024
cce8b65
Add missing `PreferencesController.preferences` properties to `SENTRY…
MajorLift Dec 7, 2024
578ccb6
Reduce diffs
MajorLift Dec 11, 2024
a06e900
Rename `MetamaskSliceState` to `MetaMaskSliceState`
MajorLift Dec 11, 2024
5f65555
Unflatten `metametrics-controller`
MajorLift Dec 11, 2024
7af2f6a
Update type in `updateMetamaskState`
MajorLift Dec 12, 2024
4a427ab
Rename: `shared/types/{metamask,background}.ts`
MajorLift Jan 14, 2025
ee4ef64
Revert `metamask` slice to flattened shape and create new unflattened…
MajorLift Jan 16, 2025
f1c8bf5
Define `FlattenedBackgroundStateProxy` to type `metamask` slice
MajorLift Jan 26, 2025
d7f3f66
Adjust `updateMetamaskState`, `applyPatches` methods to align with ne…
MajorLift Jan 26, 2025
0b007ee
Merge branch 'main' into jongsun/perf/redux/2501141-add-background-re…
MajorLift Jan 26, 2025
f62532a
Update background store,state types to align with new controller init…
MajorLift Jan 27, 2025
a8b5552
Revert flattening operations to be applied in later prs
MajorLift Jan 27, 2025
5fe95fd
Remove `build-mmi` feature flag-wrapped code
MajorLift Jan 29, 2025
a5e24f6
Remove `ObservableStore`, `BaseControllerV1` input handling logic fro…
MajorLift Jan 30, 2025
f651e8d
Merge branch 'main' into jongsun/perf/redux/2501141-add-background-re…
MajorLift Jan 30, 2025
21109fb
Remove unused import statements
MajorLift Jan 30, 2025
67dbeac
Linter fixes
MajorLift Jan 30, 2025
d934ba7
Merge branch 'main' into jongsun/perf/redux/2501141-add-background-re…
MajorLift Jan 31, 2025
7fe1094
Merge branch 'main' into jongsun/perf/redux/2501141-add-background-re…
MajorLift Feb 3, 2025
53679c8
Remove mmi code
MajorLift Feb 19, 2025
838efc3
Unflatten `MetaMetricsController`
MajorLift Feb 19, 2025
16336a5
Remove all properties from `background` slice
MajorLift Feb 19, 2025
ffdbdb0
Merge branch 'main' into jongsun/perf/redux/2501141-add-background-re…
MajorLift Feb 20, 2025
f5a14d6
Resolve merge conflict
MajorLift Feb 20, 2025
edc1d7a
Revert "Remove mmi code"
MajorLift Feb 20, 2025
ae30ef2
Update background types to include new store, memStore controllers
MajorLift Feb 20, 2025
f5dc3e0
Restore mmi code
MajorLift Feb 21, 2025
2defe65
Add `background` Redux slice with types, constants
MajorLift Feb 21, 2025
df46da8
Merge branch 'jongsun/refactor/redux/250221-unflattening-types' into …
MajorLift Feb 24, 2025
38802e0
Import `BackgroundStateProxy` as type to avoid detection as circular …
MajorLift Feb 27, 2025
1f4bc6c
Add `background` Redux slice with types, constants
MajorLift Feb 21, 2025
a6eefab
Add feature flag guards to controller-list types
MajorLift Feb 25, 2025
fe7b54f
Update background types to use modular controller init types
MajorLift Feb 25, 2025
8f4c6a7
Merge branch 'jongsun/refactor/redux/250221-unflattening-types' into …
MajorLift Feb 27, 2025
39bfb80
Fix incorrectly resolved merge conflicts
MajorLift Feb 27, 2025
5f3c8ff
Assert mock object types
MajorLift Feb 27, 2025
2bee0cf
Fix `MetaMetricsController` unit tests, unflatten mock objects
MajorLift Feb 27, 2025
4f30567
Unflatten references to fix `MetamaskController` unit tests
MajorLift Feb 27, 2025
cf3648b
Add `background` Redux slice with types, constants
MajorLift Feb 21, 2025
e850da5
Add feature flag guards to controller-list types
MajorLift Feb 25, 2025
9428487
Update background types to use modular controller init types
MajorLift Feb 25, 2025
070e5b1
Fix and rename
MajorLift Feb 27, 2025
098428b
Merge branch 'jongsun/refactor/redux/250221-unflattening-types' into …
MajorLift Feb 27, 2025
64c431b
Remove unused ts-expect-error
MajorLift Feb 27, 2025
6103d68
Remove references to stores in `ComposableObservableStore` jsdoc comm…
MajorLift Feb 27, 2025
183c911
Add `background` Redux slice with types, constants
MajorLift Feb 21, 2025
6e044eb
Add feature flag guards to controller-list types
MajorLift Feb 25, 2025
bbcc0db
Update background types to use modular controller init types
MajorLift Feb 25, 2025
abcfbe6
Fix and rename
MajorLift Feb 27, 2025
eebb3fc
Update NetworkState property name
MajorLift Feb 27, 2025
1ea073a
Add `background` Redux slice with types, constants
MajorLift Feb 27, 2025
65b08b7
Update background types to use modular controller init types
MajorLift Feb 25, 2025
b71ebd2
Fix and rename
MajorLift Feb 27, 2025
13825e1
Update NetworkState property name
MajorLift Feb 27, 2025
16d2d39
Merge branch 'jongsun/refactor/redux/250221-unflattening-types' into …
MajorLift Feb 27, 2025
3aaf44c
Create temporary `getFlatState` method in `MetamaskController` for in…
MajorLift Feb 27, 2025
aa2d510
Merge branch 'jongsun/refactor/redux/250221-unflattening-types' into …
MajorLift Feb 28, 2025
16b1a76
Resolve merge conflict
MajorLift Feb 28, 2025
370f502
Merge branch 'jongsun/refactor/redux/250221-unflattening-types' into …
MajorLift Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Define FlattenedBackgroundStateProxy to type metamask slice
MajorLift committed Jan 26, 2025
commit f1c8bf5a5d90701d8efd4946c641a0fe8dbfa17b
214 changes: 212 additions & 2 deletions shared/types/background.ts
Original file line number Diff line number Diff line change
@@ -164,8 +164,14 @@ import AppMetadataController, {
} from '../../app/scripts/controllers/app-metadata';
import { SwapsControllerState } from '../../app/scripts/controllers/swaps/swaps.types';

import { BridgeControllerState as BridgeState } from './bridge';
import { BridgeStatusControllerState as BridgeStatusState } from './bridge-status';
import {
BridgeControllerState,
BridgeControllerState as BridgeState,
} from './bridge';
import {
BridgeStatusControllerState,
BridgeStatusControllerState as BridgeStatusState,
} from './bridge-status';
import {
CustodyControllerState,
InstitutionalFeaturesControllerState,
@@ -325,3 +331,207 @@ export type MemStoreControllersComposedState = Omit<
export type BackgroundStateProxy = {
isInitialized: boolean;
} & MemStoreControllersComposedState;

export type FlattenedBackgroundStateProxy = {
isInitialized: boolean;
internalAccounts: AccountsControllerState['internalAccounts'];
accounts: AccountTrackerControllerState['accounts'];
accountsByChainId: AccountTrackerControllerState['accountsByChainId'];
currentBlockGasLimit: AccountTrackerControllerState['currentBlockGasLimit'];
currentBlockGasLimitByChainId: AccountTrackerControllerState['currentBlockGasLimitByChainId'];
addressBook: AddressBookControllerState['addressBook'];
alertEnabledness: AlertControllerState['alertEnabledness'];
unconnectedAccountAlertShownOrigins: AlertControllerState['unconnectedAccountAlertShownOrigins'];
web3ShimUsageOrigins: AlertControllerState['web3ShimUsageOrigins'];
announcements: AnnouncementControllerState['announcements'];
isSignedIn: AuthenticationController.AuthenticationControllerState['isSignedIn'];
orderedNetworkList: NetworkOrderControllerState['orderedNetworkList'];
pinnedAccountList: AccountOrderControllerState['pinnedAccountList'];
hiddenAccountList: AccountOrderControllerState['hiddenAccountList'];
currentAppVersion: AppMetadataControllerState['currentAppVersion'];
currentMigrationVersion: AppMetadataControllerState['currentMigrationVersion'];
previousAppVersion: AppMetadataControllerState['previousAppVersion'];
previousMigrationVersion: AppMetadataControllerState['previousMigrationVersion'];
approvalFlows: ApprovalControllerState['approvalFlows'];
pendingApprovals: ApprovalControllerState['pendingApprovals'];
pendingApprovalCount: ApprovalControllerState['pendingApprovalCount'];
browserEnvironment: AppStateControllerState['browserEnvironment'];
connectedStatusPopoverHasBeenShown: AppStateControllerState['connectedStatusPopoverHasBeenShown'];
currentPopupId: AppStateControllerState['currentPopupId'];
onboardingDate: AppStateControllerState['onboardingDate'];
currentExtensionPopupId: AppStateControllerState['currentExtensionPopupId'];
defaultHomeActiveTabName: AppStateControllerState['defaultHomeActiveTabName'];
fullScreenGasPollTokens: AppStateControllerState['fullScreenGasPollTokens'];
hadAdvancedGasFeesSetPriorToMigration92_3: AppStateControllerState['hadAdvancedGasFeesSetPriorToMigration92_3'];
nftsDetectionNoticeDismissed: AppStateControllerState['nftsDetectionNoticeDismissed'];
nftsDropdownState: AppStateControllerState['nftsDropdownState'];
notificationGasPollTokens: AppStateControllerState['notificationGasPollTokens'];
outdatedBrowserWarningLastShown: AppStateControllerState['outdatedBrowserWarningLastShown'];
popupGasPollTokens: AppStateControllerState['popupGasPollTokens'];
qrHardware: AppStateControllerState['qrHardware'];
recoveryPhraseReminderHasBeenShown: AppStateControllerState['recoveryPhraseReminderHasBeenShown'];
recoveryPhraseReminderLastShown: AppStateControllerState['recoveryPhraseReminderLastShown'];
signatureSecurityAlertResponses: AppStateControllerState['signatureSecurityAlertResponses'];
showBetaHeader: AppStateControllerState['showBetaHeader'];
showPermissionsTour: AppStateControllerState['showPermissionsTour'];
showNetworkBanner: AppStateControllerState['showNetworkBanner'];
showAccountBanner: AppStateControllerState['showAccountBanner'];
switchedNetworkDetails: AppStateControllerState['switchedNetworkDetails'];
switchedNetworkNeverShowMessage: AppStateControllerState['switchedNetworkNeverShowMessage'];
showTestnetMessageInDropdown: AppStateControllerState['showTestnetMessageInDropdown'];
surveyLinkLastClickedOrClosed: AppStateControllerState['surveyLinkLastClickedOrClosed'];
snapsInstallPrivacyWarningShown: AppStateControllerState['snapsInstallPrivacyWarningShown'];
termsOfUseLastAgreed: AppStateControllerState['termsOfUseLastAgreed'];
timeoutMinutes: AppStateControllerState['timeoutMinutes'];
trezorModel: AppStateControllerState['trezorModel'];
newPrivacyPolicyToastClickedOrClosed: AppStateControllerState['newPrivacyPolicyToastClickedOrClosed'];
newPrivacyPolicyToastShownDate: AppStateControllerState['newPrivacyPolicyToastShownDate'];
balances: BalancesControllerState['balances'];
bridgeState: BridgeControllerState;
bridgeStatusState: BridgeStatusControllerState;
jobs: CronjobControllerState['jobs'];
currentCurrency: CurrencyRateState['currentCurrency'];
currencyRates: CurrencyRateState['currencyRates'];
unapprovedDecryptMsgs: DecryptMessageControllerState['unapprovedDecryptMsgs'];
unapprovedDecryptMsgCount: DecryptMessageControllerState['unapprovedDecryptMsgCount'];
unapprovedEncryptionPublicKeyMsgs: EncryptionPublicKeyControllerState['unapprovedEncryptionPublicKeyMsgs'];
unapprovedEncryptionPublicKeyMsgCount: EncryptionPublicKeyControllerState['unapprovedEncryptionPublicKeyMsgCount'];
ensResolutionsByAddress: EnsControllerState['ensResolutionsByAddress'];
ensEntries: EnsControllerState['ensEntries'];
estimatedGasFeeTimeBounds: GasFeeState['estimatedGasFeeTimeBounds'];
gasEstimateType: GasFeeState['gasEstimateType'];
gasFeeEstimates: GasFeeState['gasFeeEstimates'];
gasFeeEstimatesByChainId: GasFeeState['gasFeeEstimatesByChainId'];
nonRPCGasFeeApisDisabled: GasFeeState['nonRPCGasFeeApisDisabled'];
isUnlocked: KeyringControllerState['isUnlocked'];
keyrings: KeyringControllerState['keyrings'];
logs: LoggingControllerState['logs'];
subscriptionAccountsSeen: NotificationServicesController.NotificationServicesControllerState['subscriptionAccountsSeen'];
isMetamaskNotificationsFeatureSeen: NotificationServicesController.NotificationServicesControllerState['isMetamaskNotificationsFeatureSeen'];
isNotificationServicesEnabled: NotificationServicesController.NotificationServicesControllerState['isNotificationServicesEnabled'];
isFeatureAnnouncementsEnabled: NotificationServicesController.NotificationServicesControllerState['isFeatureAnnouncementsEnabled'];
metamaskNotificationsList: NotificationServicesController.NotificationServicesControllerState['metamaskNotificationsList'];
metamaskNotificationsReadList: NotificationServicesController.NotificationServicesControllerState['metamaskNotificationsReadList'];
isCheckingAccountsPresence: NotificationServicesController.NotificationServicesControllerState['isCheckingAccountsPresence'];
isFetchingMetamaskNotifications: NotificationServicesController.NotificationServicesControllerState['isFetchingMetamaskNotifications'];
isUpdatingMetamaskNotifications: NotificationServicesController.NotificationServicesControllerState['isUpdatingMetamaskNotifications'];
isUpdatingMetamaskNotificationsAccount: NotificationServicesController.NotificationServicesControllerState['isUpdatingMetamaskNotificationsAccount'];
eventsBeforeMetricsOptIn: MetaMetricsControllerState['eventsBeforeMetricsOptIn'];
fragments: MetaMetricsControllerState['fragments'];
metaMetricsId: MetaMetricsControllerState['metaMetricsId'];
participateInMetaMetrics: MetaMetricsControllerState['participateInMetaMetrics'];
previousUserTraits: MetaMetricsControllerState['previousUserTraits'];
segmentApiCalls: MetaMetricsControllerState['segmentApiCalls'];
traits: MetaMetricsControllerState['traits'];
dataCollectionForMarketing: MetaMetricsControllerState['dataCollectionForMarketing'];
marketingCampaignCookieId: MetaMetricsControllerState['marketingCampaignCookieId'];
latestNonAnonymousEventTimestamp: MetaMetricsControllerState['latestNonAnonymousEventTimestamp'];
metaMetricsDataDeletionId: MetaMetricsDataDeletionState['metaMetricsDataDeletionId'];
metaMetricsDataDeletionTimestamp: MetaMetricsDataDeletionState['metaMetricsDataDeletionTimestamp'];
names: NameControllerState['names'];
nameSources: NameControllerState['nameSources'];
// networkConfigurations: NetworkState['networkConfigurations'];
networksMetadata: NetworkState['networksMetadata'];
selectedNetworkClientId: NetworkState['selectedNetworkClientId'];
allNftContracts: NftControllerState['allNftContracts'];
allNfts: NftControllerState['allNfts'];
ignoredNfts: NftControllerState['ignoredNfts'];
completedOnboarding: OnboardingControllerState['completedOnboarding'];
firstTimeFlowType: OnboardingControllerState['firstTimeFlowType'];
onboardingTabs: OnboardingControllerState['onboardingTabs'];
seedPhraseBackedUp: OnboardingControllerState['seedPhraseBackedUp'];
storageMetadata: PPOMState['storageMetadata'];
versionInfo: PPOMState['versionInfo'];
subjects: PermissionControllerState<PermissionConstraint>['subjects'];
permissionActivityLog: PermissionLogControllerState['permissionActivityLog'];
permissionHistory: PermissionLogControllerState['permissionHistory'];
advancedGasFee: PreferencesControllerState['advancedGasFee'];
currentLocale: PreferencesControllerState['currentLocale'];
dismissSeedBackUpReminder: PreferencesControllerState['dismissSeedBackUpReminder'];
overrideContentSecurityPolicyHeader: PreferencesControllerState['overrideContentSecurityPolicyHeader'];
featureFlags: PreferencesControllerState['featureFlags'];
forgottenPassword: PreferencesControllerState['forgottenPassword'];
identities: PreferencesControllerState['identities'];
incomingTransactionsPreferences: PreferencesControllerState['incomingTransactionsPreferences'];
isIpfsGatewayEnabled: PreferencesControllerState['isIpfsGatewayEnabled'];
ipfsGateway: PreferencesControllerState['ipfsGateway'];
knownMethodData: PreferencesControllerState['knownMethodData'];
ledgerTransportType: PreferencesControllerState['ledgerTransportType'];
lostIdentities: PreferencesControllerState['lostIdentities'];
openSeaEnabled: PreferencesControllerState['openSeaEnabled'];
preferences: PreferencesControllerState['preferences'];
useExternalServices: PreferencesControllerState['useExternalServices'];
securityAlertsEnabled: PreferencesControllerState['securityAlertsEnabled'];
selectedAddress: PreferencesControllerState['selectedAddress'];
snapRegistryList: PreferencesControllerState['snapRegistryList'];
theme: PreferencesControllerState['theme'];
use4ByteResolution: PreferencesControllerState['use4ByteResolution'];
useAddressBarEnsResolution: PreferencesControllerState['useAddressBarEnsResolution'];
useBlockie: PreferencesControllerState['useBlockie'];
useCurrencyRateCheck: PreferencesControllerState['useCurrencyRateCheck'];
useExternalNameSources: PreferencesControllerState['useExternalNameSources'];
useMultiAccountBalanceChecker: PreferencesControllerState['useMultiAccountBalanceChecker'];
useNftDetection: PreferencesControllerState['useNftDetection'];
useNonceField: PreferencesControllerState['useNonceField'];
usePhishDetect: PreferencesControllerState['usePhishDetect'];
useTokenDetection: PreferencesControllerState['useTokenDetection'];
// useRequestQueue: PreferencesControllerState['useRequestQueue'];
useTransactionSimulations: PreferencesControllerState['useTransactionSimulations'];
enableMV3TimestampSave: PreferencesControllerState['enableMV3TimestampSave'];
useSafeChainsListValidation: PreferencesControllerState['useSafeChainsListValidation'];
watchEthereumAccountEnabled: PreferencesControllerState['watchEthereumAccountEnabled'];
bitcoinSupportEnabled: PreferencesControllerState['bitcoinSupportEnabled'];
bitcoinTestnetSupportEnabled: PreferencesControllerState['bitcoinTestnetSupportEnabled'];
addSnapAccountEnabled: PreferencesControllerState['addSnapAccountEnabled'];
snapsAddSnapAccountModalDismissed: PreferencesControllerState['snapsAddSnapAccountModalDismissed'];
remoteFeatureFlags: RemoteFeatureFlagControllerState['remoteFeatureFlags'];
cacheTimestamp: RemoteFeatureFlagControllerState['cacheTimestamp'];
fcmToken: NotificationServicesPushController.NotificationServicesPushControllerState['fcmToken'];
fiatCurrency: RatesControllerState['fiatCurrency'];
rates: RatesControllerState['rates'];
cryptocurrencies: RatesControllerState['cryptocurrencies'];
queuedRequestCount: QueuedRequestControllerState['queuedRequestCount'];
domains: SelectedNetworkControllerState['domains'];
unapprovedPersonalMsgCount: SignatureControllerState['unapprovedPersonalMsgCount'];
unapprovedPersonalMsgs: SignatureControllerState['unapprovedPersonalMsgs'];
unapprovedTypedMessages: SignatureControllerState['unapprovedTypedMessages'];
unapprovedTypedMessagesCount: SignatureControllerState['unapprovedTypedMessagesCount'];
smartTransactionsState: SmartTransactionsControllerState['smartTransactionsState'];
snaps: SnapControllerState['snaps'];
interfaces: SnapInterfaceControllerState['interfaces'];
insights: SnapInsightsControllerState['insights'];
database: SnapsRegistryState['database'];
lastUpdated: SnapsRegistryState['lastUpdated'];
databaseUnavailable: SnapsRegistryState['databaseUnavailable'];
subjectMetadata: SubjectMetadataControllerState['subjectMetadata'];
swapsState: SwapsControllerState['swapsState'];
tokenBalances: TokenBalancesControllerState['tokenBalances'];
allDetectedTokens: TokensControllerState['allDetectedTokens'];
allIgnoredTokens: TokensControllerState['allIgnoredTokens'];
allTokens: TokensControllerState['allTokens'];
detectedTokens: TokensControllerState['detectedTokens'];
ignoredTokens: TokensControllerState['ignoredTokens'];
tokens: TokensControllerState['tokens'];
preventPollingOnNetworkRestart: TokenListState['preventPollingOnNetworkRestart'];
tokenList: TokenListState['tokenList'];
tokensChainsCache: TokenListState['tokensChainsCache'];
marketData: TokenRatesControllerState['marketData'];
lastFetchedBlockNumbers: TransactionControllerState['lastFetchedBlockNumbers'];
methodData: TransactionControllerState['methodData'];
transactions: TransactionControllerState['transactions'];
userOperations: UserOperationControllerState['userOperations'];
isProfileSyncingEnabled: UserStorageController.UserStorageControllerState['isProfileSyncingEnabled'];
isProfileSyncingUpdateLoading: UserStorageController.UserStorageControllerState['isProfileSyncingUpdateLoading'];
hasAccountSyncingSyncedAtLeastOnce: UserStorageController.UserStorageControllerState['hasAccountSyncingSyncedAtLeastOnce'];
isAccountSyncingReadyToBeDispatched: UserStorageController.UserStorageControllerState['isAccountSyncingReadyToBeDispatched'];
///: BEGIN:ONLY_INCLUDE_IF(build-mmi)
custodyAccountDetails: CustodyControllerState['custodyAccountDetails'];
apiRequestLogs: CustodyControllerState['apiRequestLogs'];
custodianConnectRequest: CustodyControllerState['custodianConnectRequest'];
custodyStatusMaps: CustodyControllerState['custodyStatusMaps'];
custodianSupportedChains: CustodyControllerState['custodianSupportedChains'];
waitForConfirmDeepLinkDialog: CustodyControllerState['waitForConfirmDeepLinkDialog'];
institutionalFeatures: InstitutionalFeaturesControllerState['institutionalFeatures'];
mmiConfiguration: MmiConfigurationControllerState['mmiConfiguration'];
///: END:ONLY_INCLUDE_IF
};
6 changes: 4 additions & 2 deletions ui/store/store.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@ import { configureStore as baseConfigureStore } from '@reduxjs/toolkit';
import devtoolsEnhancer from 'remote-redux-devtools';
import rootReducer from '../ducks';
import { AppSliceState } from '../ducks/app/app';
import { MetaMaskSliceState } from '../ducks/metamask/metamask';
import { BackgroundSliceState } from '../ducks/background/background';
import { FlattenedBackgroundStateProxy } from '../../shared/types/background';

/**
* This interface is temporary and is copied from the message-manager.js file
@@ -45,7 +46,8 @@ type ReduxState = {
activeTab: {
origin: string;
};
metamask: MetaMaskSliceState['metamask'];
metamask: FlattenedBackgroundStateProxy;
background: BackgroundSliceState['background'];
appState: AppSliceState['appState'];
} & Omit<RootReducerReturnType, 'activeTab' | 'metamask' | 'appState'>;


Unchanged files with check annotations Beta

// TODO: Re think how to test this without exposing internal state
// it('should replace ethers instance when called with a different chainId than was current when the controller was instantiated', async function () {

Check warning on line 1265 in app/scripts/controllers/swaps/swaps.test.ts

GitHub Actions / Test lint / Test lint

Some tests seem to be commented
// fetchTradesInfoStub.mockReset();
// const _swapsController = getSwapsController();
// expect(currentEthersInstance).not.toStrictEqual(newEthersInstance);
// });
// it('should not replace ethers instance when called with the same chainId that was current when the controller was instantiated', async function () {

Check warning on line 1286 in app/scripts/controllers/swaps/swaps.test.ts

GitHub Actions / Test lint / Test lint

Some tests seem to be commented
// const _swapsController = new SwapsController({
// getBufferedGasLimit: MOCK_GET_BUFFERED_GAS_LIMIT,
// provider,
// expect(currentEthersInstance).toStrictEqual(newEthersInstance);
// });
// it('should replace ethers instance, and _ethersProviderChainId, twice when called twice with two different chainIds, and successfully set the _ethersProviderChainId when returning to the original chain', async function () {

Check warning on line 1306 in app/scripts/controllers/swaps/swaps.test.ts

GitHub Actions / Test lint / Test lint

Some tests seem to be commented
// const _swapsController = new SwapsController({
// getBufferedGasLimit: MOCK_GET_BUFFERED_GAS_LIMIT,
// provider,
});
});
// it('clears polling timeout', function () {

Check warning on line 1390 in app/scripts/controllers/swaps/swaps.test.ts

GitHub Actions / Test lint / Test lint

Some tests seem to be commented
// swapsController._pollingTimeout = setTimeout(() => {
// throw new Error('Polling timeout not cleared');
// }, POLLING_TIMEOUT);
describe('stopPollingForQuotes', function () {
// TODO: Re think how to test this without exposing internal state
// it('clears polling timeout', function () {

Check warning on line 1406 in app/scripts/controllers/swaps/swaps.test.ts

GitHub Actions / Test lint / Test lint

Some tests seem to be commented
// swapsController._pollingTimeout = setTimeout(() => {
// throw new Error('Polling timeout not cleared');
// }, POLLING_TIMEOUT);
describe('resetPostFetchState', function () {
// TODO: Re think how to test this without exposing internal state
// it('clears polling timeout', function () {

Check warning on line 1429 in app/scripts/controllers/swaps/swaps.test.ts

GitHub Actions / Test lint / Test lint

Some tests seem to be commented
// swapsController._pollingTimeout = setTimeout(() => {
// throw new Error('Polling timeout not cleared');
// }, POLLING_TIMEOUT);
};
setTokensListDetected(newTokensList());
}, [

Check warning on line 117 in ui/components/app/detected-token/detected-token.js

GitHub Actions / Test lint / Test lint

React Hook useEffect has a missing dependency: 'tokensListDetected'. Either include it or remove the dependency array
isTokenNetworkFilterEqualCurrentNetwork,
detectedTokensMultichain,
detectedTokens,
* No name has been saved for the value and type.
*/
export const NoSavedName = {
name: 'No Saved Name',

Check warning on line 129 in ui/components/app/name/name.stories.tsx

GitHub Actions / Test lint / Test lint

Named exports should not use the name annotation if it is redundant to the name that would be generated by the export name
args: {
value: ADDRESS_MOCK,
type: NameType.ETHEREUM_ADDRESS,
useEffect(() => {
return () => interfaceId && dispatch(deleteInterface(interfaceId));
}, [interfaceId]);

Check warning on line 49 in ui/components/app/snaps/snap-home-page/snap-home-renderer.js

GitHub Actions / Test lint / Test lint

React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array
useEffect(() => {
// Snaps are allowed to redirect to their own pending confirmations (templated or not)
} else if (snapApproval) {
history.push(`${CONFIRM_TRANSACTION_ROUTE}/${snapApproval.id}`);
}
}, [unapprovedTemplatedConfirmations, unapprovedConfirmations, history]);

Check warning on line 65 in ui/components/app/snaps/snap-home-page/snap-home-renderer.js

GitHub Actions / Test lint / Test lint

React Hook useEffect has a missing dependency: 'snapId'. Either include it or remove the dependency array
return (
<Box
import { initialBackgroundState } from './constants';
export type BackgroundSliceState = {
background: BackgroundStateProxy

Check failure on line 38 in ui/ducks/background/background.ts

GitHub Actions / Test lint / Test lint

Insert `;`
};
/**