diff --git a/golang/cosmos/app/upgrade.go b/golang/cosmos/app/upgrade.go index 818c1fd63ce..1f6e8b2f57a 100644 --- a/golang/cosmos/app/upgrade.go +++ b/golang/cosmos/app/upgrade.go @@ -212,6 +212,12 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte // Upgrade to include a cleanup from https://github.com/Agoric/agoric-sdk/pull/10319 "@agoric/builders/scripts/smart-wallet/build-wallet-factory2-upgrade.js", ), + vm.CoreProposalStepForModules( + "@agoric/builders/scripts/vats/upgrade-provisionPool.js", + ), + vm.CoreProposalStepForModules( + "@agoric/builders/scripts/vats/upgrade-bank.js", + ), ) // CoreProposals for Upgrade 19 diff --git a/packages/vats/src/proposals/upgrade-provisionPool-proposal.js b/packages/vats/src/proposals/upgrade-provisionPool-proposal.js index 9d31c752607..4dd74af9c69 100644 --- a/packages/vats/src/proposals/upgrade-provisionPool-proposal.js +++ b/packages/vats/src/proposals/upgrade-provisionPool-proposal.js @@ -16,6 +16,10 @@ export const upgradeProvisionPool = async ( economicCommitteeCreatorFacet: electorateCreatorFacet, instancePrivateArgs: instancePrivateArgsP, provisionPoolStartResult: provisionPoolStartResultP, + bankManager, + namesByAddressAdmin: namesByAddressAdminP, + walletFactoryStartResult: walletFactoryStartResultP, + provisionWalletBridgeManager: provisionWalletBridgeManagerP, }, }, options, @@ -25,11 +29,25 @@ export const upgradeProvisionPool = async ( assert(provisionPoolRef.bundleID); console.log(`PROVISION POOL BUNDLE ID: `, provisionPoolRef.bundleID); - const [provisionPoolStartResult, instancePrivateArgs] = await Promise.all([ + const [ + provisionPoolStartResult, + instancePrivateArgs, + namesByAddressAdmin, + walletFactoryStartResult, + provisionWalletBridgeManager, + ] = await Promise.all([ provisionPoolStartResultP, instancePrivateArgsP, + namesByAddressAdminP, + walletFactoryStartResultP, + provisionWalletBridgeManagerP, ]); - const { adminFacet, instance } = provisionPoolStartResult; + const { + adminFacet, + instance, + creatorFacet: ppCreatorFacet, + } = provisionPoolStartResult; + const { creatorFacet: wfCreatorFacet } = walletFactoryStartResult; const [originalPrivateArgs, poserInvitation] = await Promise.all([ // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -49,6 +67,24 @@ export const upgradeProvisionPool = async ( ); console.log('ProvisionPool upgraded: ', upgradeResult); + + const references = { + bankManager, + namesByAddressAdmin, + walletFactory: wfCreatorFacet, + }; + + console.log('Calling setReferences with: ', references); + await E(ppCreatorFacet).setReferences(references); + + console.log('Creating bridgeHandler...'); + const bridgeHandler = await E(ppCreatorFacet).makeHandler(); + + console.log('Setting new bridgeHandler...'); + // @ts-expect-error casting + await E(provisionWalletBridgeManager).setHandler(bridgeHandler); + + console.log('Done.'); }; export const getManifestForUpgradingProvisionPool = ( @@ -61,6 +97,10 @@ export const getManifestForUpgradingProvisionPool = ( economicCommitteeCreatorFacet: true, instancePrivateArgs: true, provisionPoolStartResult: true, + bankManager: true, + namesByAddressAdmin: true, + walletFactoryStartResult: true, + provisionWalletBridgeManager: true, }, produce: {}, },