Skip to content

Commit a4af36a

Browse files
committed
feat: responding to PR comments
1 parent 2f3eaf3 commit a4af36a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/earn-controller/src/EarnController.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ const setupController = async ({
725725
addTransactionFn,
726726
});
727727

728-
controller.init();
728+
await controller.init();
729729

730730
// Wait for fire-and-forget async operations started by init() to settle.
731731
await new Promise((resolve) => setTimeout(resolve, 0));
@@ -867,7 +867,7 @@ describe('EarnController', () => {
867867
const { controller } = await setupController();
868868

869869
// init() was already called once inside setupController; call it again.
870-
controller.init();
870+
await controller.init();
871871
await new Promise((resolve) => setTimeout(resolve, 0));
872872

873873
// EarnSdk.create and data-fetch calls should not have increased beyond

packages/earn-controller/src/EarnController.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,14 +466,12 @@ export class EarnController extends BaseController<
466466
this.refreshLendingData().catch(console.error);
467467
}
468468

469-
init(): void {
469+
async init(): Promise<void> {
470470
if (this.#initialized) {
471471
return;
472472
}
473473

474-
this.#initializeSDK(this.#getSelectedNetworkClientId()).catch(
475-
console.error,
476-
);
474+
await this.#initializeSDK(this.#getSelectedNetworkClientId());
477475

478476
const address = this.#getSelectedEvmAccountAddress();
479477
if (address) {

0 commit comments

Comments
 (0)