Skip to content

Commit b7e8c9c

Browse files
committed
Change init to sync function
1 parent 76a0464 commit b7e8c9c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/snaps-controllers/src/snaps/SnapController.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9932,7 +9932,7 @@ describe('SnapController', () => {
99329932
);
99339933

99349934
const call = jest.spyOn(messenger, 'call');
9935-
await messenger.call('SnapController:init');
9935+
messenger.call('SnapController:init');
99369936
await sleep(10);
99379937

99389938
expect(call).toHaveBeenNthCalledWith(
@@ -9999,7 +9999,7 @@ describe('SnapController', () => {
99999999
}),
1000010000
);
1000110001

10002-
await messenger.call('SnapController:init');
10002+
messenger.call('SnapController:init');
1000310003
await sleep(10);
1000410004

1000510005
expect(consoleErrorSpy).toHaveBeenCalledWith(

packages/snaps-controllers/src/snaps/SnapController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ export class SnapController extends BaseController<
11721172
#registerMessageHandlers(): void {
11731173
this.messagingSystem.registerActionHandler(
11741174
`${controllerName}:init`,
1175-
async (...args) => this.init(...args),
1175+
(...args) => this.init(...args),
11761176
);
11771177

11781178
this.messagingSystem.registerActionHandler(
@@ -1287,7 +1287,7 @@ export class SnapController extends BaseController<
12871287
* Currently this method calls the `onStart` lifecycle hook for all
12881288
* installed Snaps.
12891289
*/
1290-
async init() {
1290+
init() {
12911291
const snaps = this.getAllSnaps();
12921292
for (const { id } of snaps) {
12931293
const hasLifecycleHooksEndowment = this.messagingSystem.call(

0 commit comments

Comments
 (0)