Skip to content

Commit fc15a1c

Browse files
authored
refactor(multichain-account-service): remove old unused event (MetaMask#8752)
## Explanation I forgot to remove this event in my previous PR: - MetaMask#8715 ## References N/A ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk cleanup that only tightens messenger event typings/delegations and updates related lint suppression/changelog entries; behavioral impact should be limited to consumers that still attempted to delegate/subscribe to `KeyringController:stateChange`. > > **Overview** > Removes the unused `KeyringController:stateChange` subscription from `multichain-account-service` by dropping it from the test messenger delegation list and from the service’s `AllowedEvents` type. > > Updates supporting metadata: deletes the now-unneeded ESLint suppression for `src/tests/messenger.ts` and tweaks the changelog entry to reflect that `KeyringController:stateChange` is no longer required (and references the follow-up PR). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c7eb0e9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 59194e1 commit fc15a1c

4 files changed

Lines changed: 3 additions & 11 deletions

File tree

eslint-suppressions.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,11 +1304,6 @@
13041304
"count": 7
13051305
}
13061306
},
1307-
"packages/multichain-account-service/src/tests/messenger.ts": {
1308-
"no-restricted-syntax": {
1309-
"count": 1
1310-
}
1311-
},
13121307
"packages/multichain-api-middleware/src/handlers/types.ts": {
13131308
"@typescript-eslint/naming-convention": {
13141309
"count": 2

packages/multichain-account-service/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
- **BREAKING:** The service messenger now requires the `SnapAccountService:ensureReady` action to be declared ([#8715](https://github.com/MetaMask/core/pull/8715))
13-
- **BREAKING:** Delegate Snap platform readiness to `@metamask/snap-account-service` ([#8715](https://github.com/MetaMask/core/pull/8715))
13+
- **BREAKING:** Delegate Snap platform readiness to `@metamask/snap-account-service` ([#8715](https://github.com/MetaMask/core/pull/8715)), ([#8752](https://github.com/MetaMask/core/pull/8752))
1414
- Removed `MultichainAccountService.ensureCanUseSnapPlatform()` method and the corresponding `MultichainAccountService:ensureCanUseSnapPlatform` messenger action.
1515
- Removed the `MultichainAccountServiceEnsureCanUseSnapPlatformAction` type export.
1616
- Removed `MultichainAccountServiceOptions.ensureOnboardingComplete`. Configure it via `SnapAccountService`'s `config.snapPlatformWatcher.ensureOnboardingComplete` instead.
1717
- Removed `MultichainAccountServiceConfig.snapPlatformWatcher` and the `SnapPlatformWatcherConfig` type export. Configure the keyring-wait timeout via `SnapAccountService`'s `config.snapPlatformWatcher.snapKeyringWaitTimeoutMs` instead.
18-
- The service messenger no longer needs `SnapController:getState` or `SnapController:stateChange`.
18+
- The service messenger no longer needs `SnapController:getState`, `SnapController:stateChange` or `KeyringController:stateChange`.
1919
- **BREAKING:** Rename `SnapAccountProvider.ensureCanUseSnapPlatform()` to `ensureReady()` ([#8715](https://github.com/MetaMask/core/pull/8715))
2020

2121
## [9.0.0]

packages/multichain-account-service/src/tests/messenger.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export function getMultichainAccountServiceMessenger(
7878
...(extra?.actions ?? []),
7979
],
8080
events: [
81-
'KeyringController:stateChange',
8281
'AccountsController:accountAdded',
8382
'AccountsController:accountRemoved',
8483
...(extra?.events ?? []),

packages/multichain-account-service/src/types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import type {
2121
KeyringControllerGetKeyringsByTypeAction,
2222
KeyringControllerGetStateAction,
2323
KeyringControllerRemoveAccountAction,
24-
KeyringControllerStateChangeEvent,
2524
KeyringControllerWithKeyringAction,
2625
KeyringControllerWithKeyringV2Action,
2726
} from '@metamask/keyring-controller';
@@ -95,8 +94,7 @@ type AllowedActions =
9594
*/
9695
type AllowedEvents =
9796
| AccountsControllerAccountAddedEvent
98-
| AccountsControllerAccountRemovedEvent
99-
| KeyringControllerStateChangeEvent;
97+
| AccountsControllerAccountRemovedEvent;
10098

10199
/**
102100
* The messenger restricted to actions and events that

0 commit comments

Comments
 (0)