From 373b31f1b63a9e5b01cc4a42bcfbdeeed1e93f09 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Wed, 8 Nov 2023 11:36:00 -0800 Subject: [PATCH] refactor: upgrade-zoe proposal name it's not necessarily null. it's whatever the version is that's built. --- .../boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts | 2 +- packages/builders/package.json | 3 +-- packages/builders/scripts/vats/upgrade-zoe.js | 4 ++-- .../{null-upgrade-zoe-proposal.js => upgrade-zoe-proposal.js} | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) rename packages/vats/src/proposals/{null-upgrade-zoe-proposal.js => upgrade-zoe-proposal.js} (93%) diff --git a/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts b/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts index 910234eedd9f..30bd4092dd2e 100644 --- a/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts +++ b/packages/boot/test/bootstrapTests/test-walletSurvivesZoeRestart.ts @@ -288,7 +288,7 @@ const checkFlow1 = async ( // restart Zoe // /////// Upgrading //////////////////////////////// await buildAndExecuteProposal( - '@agoric/builders/scripts/vats/null-upgrade-zoe-proposal.js', + '@agoric/builders/scripts/vats/upgrade-zoe-proposal.js', ); await buyer.tryExitOffer(`${collateralBrandKey}-bid3`); diff --git a/packages/builders/package.json b/packages/builders/package.json index 5b603d062f2d..d771ca784ab1 100644 --- a/packages/builders/package.json +++ b/packages/builders/package.json @@ -8,9 +8,8 @@ "scripts": { "build": "exit 0", "build:add-STARS-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/inter-protocol/add-STARS.js", - "build:restart-vats-proposal": "echo echo This command has been deprecated. Please run this instead: agoric run scripts/vats/restart-vats.js", + "build:restart-vats-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/vats/restart-vats.js", "build:zcf-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/vats/replace-zoe.js", - "build:null-upgrade-zoe-proposal": "echo This command has been deprecated. Please run this instead: agoric run scripts/vats/replace-zoe.js", "prepack": "tsc --build tsconfig.build.json", "postpack": "git clean -f '*.d.ts*'", "test": "ava", diff --git a/packages/builders/scripts/vats/upgrade-zoe.js b/packages/builders/scripts/vats/upgrade-zoe.js index a9ea1fdec9eb..e7503efbb13c 100644 --- a/packages/builders/scripts/vats/upgrade-zoe.js +++ b/packages/builders/scripts/vats/upgrade-zoe.js @@ -3,7 +3,7 @@ import { makeHelpers } from '@agoric/deploy-script-support'; /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').ProposalBuilder} */ export const defaultProposalBuilder = async ({ publishRef, install }) => harden({ - sourceSpec: '@agoric/vats/src/proposals/null-upgrade-zoe-proposal.js', + sourceSpec: '@agoric/vats/src/proposals/upgrade-zoe-proposal.js', getManifestCall: [ 'getManifestForUpgradingZoe', { @@ -14,5 +14,5 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => export default async (homeP, endowments) => { const { writeCoreProposal } = await makeHelpers(homeP, endowments); - await writeCoreProposal('null-upgrade-zoe', defaultProposalBuilder); + await writeCoreProposal('upgrade-zoe', defaultProposalBuilder); }; diff --git a/packages/vats/src/proposals/null-upgrade-zoe-proposal.js b/packages/vats/src/proposals/upgrade-zoe-proposal.js similarity index 93% rename from packages/vats/src/proposals/null-upgrade-zoe-proposal.js rename to packages/vats/src/proposals/upgrade-zoe-proposal.js index 0de111654205..6ae75e32088a 100644 --- a/packages/vats/src/proposals/null-upgrade-zoe-proposal.js +++ b/packages/vats/src/proposals/upgrade-zoe-proposal.js @@ -13,7 +13,7 @@ import { E } from '@endo/far'; * @param {object} options * @param {{ zoeRef: VatSourceRef; zcfRef: VatSourceRef }} options.options */ -export const nullUpgradeZoe = async ( +export const upgradeZoe = async ( { consume: { vatAdminSvc, vatStore } }, options, ) => { @@ -30,7 +30,7 @@ export const nullUpgradeZoe = async ( export const getManifestForUpgradingZoe = (_powers, { zoeRef }) => ({ manifest: { - [nullUpgradeZoe.name]: { + [upgradeZoe.name]: { consume: { vatAdminSvc: 'vatAdminSvc', vatStore: 'vatStore',