Skip to content

Commit

Permalink
chore: revert to start; handle missing storageNode; install probe
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Jul 28, 2023
1 parent 5b37aab commit 4c5ea0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/vats/test/bootstrapTests/test-zcf-upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ test('run restart-vats proposal', async t => {
const source = `${dirname}/${ZCF_PROBE_SRC}`;

const zcfProbeBundle = await bundleSource(source);
await controller.validateAndInstallBundle(zcfProbeBundle);
// This test self-sufficiently builds all the artifacts it needs. The test in
// .../packages/deployment/upgradeTest/upgradeTest-scripts/agoric-upgrade-11/zoe-upgrade/
// needs a bundled copy of ./zcfProbe.js as of the final commit that will be
Expand Down
14 changes: 11 additions & 3 deletions packages/vats/test/bootstrapTests/zcfProbe.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@agoric/zoe/exported.js';

import { makeTracer } from '@agoric/internal';
import { E } from '@endo/far';
import {
Expand All @@ -17,17 +19,21 @@ const ZcfProbeI = M.interface('ZCF Probe', {
makeFaucetInvitation: M.call().returns(M.promise()),
});

// /** @type {ContractMeta} */
// export const meta = { upgradability: 'canUpgrade' };
// harden(meta);

/**
* @param {ZCF} zcf
* @param {{ storageNode: StorageNode }} privateArgs
* @param {import('@agoric/vat-data').Baggage} baggage
*/
export const prepare = async (zcf, privateArgs, baggage) => {
export const start = async (zcf, privateArgs, baggage) => {
const { probeMint } = await provideAll(baggage, {
probeMint: () => zcf.makeZCFMint('Ducats'),
});

const { storageNode } = privateArgs;
const storageNode = privateArgs?.storageNode;
const makeZcfProbe = await prepareExoClass(
baggage,
'zcfProbe',
Expand Down Expand Up @@ -77,7 +83,9 @@ export const prepare = async (zcf, privateArgs, baggage) => {

trace('Intrinsics', result);
// write to vstorage so a test can detect it.
void E(storageNode).setValue(`${result}`);
if (storageNode) {
void E(storageNode).setValue(`${result}`);
}

return result;
};
Expand Down

0 comments on commit 4c5ea0e

Please sign in to comment.