From 6e676ae45489deaaad46cc9d07dd0686df77bdd2 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 9 Jan 2025 20:28:50 -0330 Subject: [PATCH] Rename `AccountsMessenger` to `AccountsControllerMessenger` This removes the only functional change in this PR --- packages/accounts-controller/CHANGELOG.md | 2 -- .../accounts-controller/src/AccountsController.test.ts | 7 ++++--- packages/accounts-controller/src/AccountsController.ts | 6 +++--- packages/accounts-controller/src/index.ts | 3 +-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/accounts-controller/CHANGELOG.md b/packages/accounts-controller/CHANGELOG.md index ca2b8ef0a0f..00ae70db7f3 100644 --- a/packages/accounts-controller/CHANGELOG.md +++ b/packages/accounts-controller/CHANGELOG.md @@ -10,8 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Bump `@metamask/base-controller` from `^7.0.0` to `^7.1.0` ([#5079](https://github.com/MetaMask/core/pull/5079)) -- Rename `AccountsControllerMessenger` to `AccountsMessenger` ([#5090](https://github.com/MetaMask/core/pull/5090)) - - The old name is preserved as an alias, so this is not a breaking change. ## [20.0.2] diff --git a/packages/accounts-controller/src/AccountsController.test.ts b/packages/accounts-controller/src/AccountsController.test.ts index 989dd7da0bf..4afab752bfc 100644 --- a/packages/accounts-controller/src/AccountsController.test.ts +++ b/packages/accounts-controller/src/AccountsController.test.ts @@ -284,7 +284,7 @@ function buildMessenger() { * @param messenger - The messenger to restrict. * @returns The restricted messenger. */ -function buildAccountsMessenger(messenger = buildMessenger()) { +function buildAccountsControllerMessenger(messenger = buildMessenger()) { return messenger.getRestricted({ name: 'AccountsController', allowedEvents: [ @@ -323,10 +323,11 @@ function setupAccountsController({ AccountsControllerEvents | AllowedEvents >; } { - const accountsMessenger = buildAccountsMessenger(messenger); + const accountsControllerMessenger = + buildAccountsControllerMessenger(messenger); const accountsController = new AccountsController({ - messenger: accountsMessenger, + messenger: accountsControllerMessenger, state: { ...defaultState, ...initialState }, }); return { accountsController, messenger }; diff --git a/packages/accounts-controller/src/AccountsController.ts b/packages/accounts-controller/src/AccountsController.ts index a89b048bc00..f7ce14e9a37 100644 --- a/packages/accounts-controller/src/AccountsController.ts +++ b/packages/accounts-controller/src/AccountsController.ts @@ -171,7 +171,7 @@ export type AccountsControllerEvents = | AccountsControllerAccountRemovedEvent | AccountsControllerAccountRenamedEvent; -export type AccountsMessenger = RestrictedMessenger< +export type AccountsControllerMessenger = RestrictedMessenger< typeof controllerName, AccountsControllerActions | AllowedActions, AccountsControllerEvents | AllowedEvents, @@ -225,7 +225,7 @@ export const EMPTY_ACCOUNT = { export class AccountsController extends BaseController< typeof controllerName, AccountsControllerState, - AccountsMessenger + AccountsControllerMessenger > { /** * Constructor for AccountsController. @@ -238,7 +238,7 @@ export class AccountsController extends BaseController< messenger, state, }: { - messenger: AccountsMessenger; + messenger: AccountsControllerMessenger; state: AccountsControllerState; }) { super({ diff --git a/packages/accounts-controller/src/index.ts b/packages/accounts-controller/src/index.ts index a87022576b0..2ac23b5a258 100644 --- a/packages/accounts-controller/src/index.ts +++ b/packages/accounts-controller/src/index.ts @@ -20,8 +20,7 @@ export type { AccountsControllerAccountRemovedEvent, AccountsControllerAccountRenamedEvent, AccountsControllerEvents, - AccountsMessenger, - AccountsMessenger as AccountsControllerMessenger, + AccountsControllerMessenger, } from './AccountsController'; export { AccountsController } from './AccountsController'; export { keyringTypeToName, getUUIDFromAddressOfNormalAccount } from './utils';