Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
owencraston committed Dec 20, 2024
1 parent 4c958ed commit abf729d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
1 change: 0 additions & 1 deletion app/core/Engine/controllers/AccountsController/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const createAccountsController = ({
initialState?: AccountsControllerState;
}): AccountsController => {
try {
// Add logging for AccountsController creation
if (!initialState) {
Logger.log('Creating AccountsController with default state', {
defaultState: defaultAccountsControllerState,
Expand Down
30 changes: 3 additions & 27 deletions app/core/EngineService/EngineService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export class EngineService {
tags: getTraceTags(reduxState),
});
const state = reduxState?.engine?.backgroundState || {};
const Engine = UntypedEngine;
// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Engine = UntypedEngine as any;
try {
Engine.init(state);
this.updateControllers(Engine);
Expand Down Expand Up @@ -233,32 +235,6 @@ export class EngineService {
const keyringState = await getVaultFromBackup();
const reduxState = ReduxService.store.getState();
const state = reduxState?.engine?.backgroundState || {};

// Log the state we're initializing with
Logger.log(
'Initializing Engine from backup vault',
{
hasKeyringState: !!keyringState,
hasReduxState: Object.keys(state).length > 0,
hasAccountsState: !!state.AccountsController,
},
true,
);

if (state.AccountsController) {
Logger.log(
'Initializing Engine from backup with AccountsController state',
{
hasSelectedAccount:
!!state.AccountsController.internalAccounts?.selectedAccount,
accountsCount: Object.keys(
state.AccountsController.internalAccounts?.accounts || {},
).length,
},
true,
);
}

// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Engine = UntypedEngine as any;
Expand Down

0 comments on commit abf729d

Please sign in to comment.