Skip to content

Commit

Permalink
Rename AccountsMessenger to AccountsControllerMessenger
Browse files Browse the repository at this point in the history
This removes the only functional change in this PR
  • Loading branch information
Gudahtt committed Jan 9, 2025
1 parent 400548f commit 3763cd3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 0 additions & 2 deletions packages/accounts-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
6 changes: 3 additions & 3 deletions packages/accounts-controller/src/AccountsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,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: [
Expand Down Expand Up @@ -309,10 +309,10 @@ 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 };
Expand Down
6 changes: 3 additions & 3 deletions packages/accounts-controller/src/AccountsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export type AccountsControllerEvents =
| AccountsControllerAccountRemovedEvent
| AccountsControllerAccountRenamedEvent;

export type AccountsMessenger = RestrictedMessenger<
export type AccountsControllerMessenger = RestrictedMessenger<
typeof controllerName,
AccountsControllerActions | AllowedActions,
AccountsControllerEvents | AllowedEvents,
Expand Down Expand Up @@ -223,7 +223,7 @@ export const EMPTY_ACCOUNT = {
export class AccountsController extends BaseController<
typeof controllerName,
AccountsControllerState,
AccountsMessenger
AccountsControllerMessenger
> {
/**
* Constructor for AccountsController.
Expand All @@ -236,7 +236,7 @@ export class AccountsController extends BaseController<
messenger,
state,
}: {
messenger: AccountsMessenger;
messenger: AccountsControllerMessenger;
state: AccountsControllerState;
}) {
super({
Expand Down
3 changes: 1 addition & 2 deletions packages/accounts-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 3763cd3

Please sign in to comment.