Skip to content

Commit 5bf6fc4

Browse files
committed
fix(evm-wallet-experiment): re-register SDK environment on vat reconstitution
1 parent 8235ad9 commit 5bf6fc4

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/evm-wallet-experiment/src/vats/coordinator-vat.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,13 @@ export function buildRootObject(
384384
chainId: number;
385385
usePaymaster?: boolean;
386386
sponsorshipPolicyId?: string;
387+
environment?: {
388+
EntryPoint: Hex;
389+
DelegationManager: Hex;
390+
SimpleFactory: Hex;
391+
implementations: Record<string, Hex>;
392+
caveatEnforcers: Record<string, Hex>;
393+
};
387394
}
388395
| undefined;
389396

@@ -422,6 +429,9 @@ export function buildRootObject(
422429
peerWallet = restoreFromBaggage<PeerWalletFacet>('peerWallet');
423430
externalSigner = restoreFromBaggage<ExternalSignerFacet>('externalSigner');
424431
bundlerConfig = restoreFromBaggage<typeof bundlerConfig>('bundlerConfig');
432+
if (bundlerConfig?.environment) {
433+
registerEnvironment(bundlerConfig.chainId, bundlerConfig.environment);
434+
}
425435
smartAccountConfig =
426436
restoreFromBaggage<SmartAccountConfig>('smartAccountConfig');
427437
awayWallet = restoreFromBaggage<AwayWalletFacet>('awayWallet');
@@ -1586,6 +1596,7 @@ export function buildRootObject(
15861596
chainId: config.chainId,
15871597
usePaymaster: config.usePaymaster,
15881598
sponsorshipPolicyId: config.sponsorshipPolicyId,
1599+
environment: config.environment,
15891600
});
15901601
persistBaggage('bundlerConfig', bundlerConfig);
15911602
logger.info('bundler configured', {

0 commit comments

Comments
 (0)