Skip to content

Commit

Permalink
refactor: rename writeCoreEvalParts for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 9, 2024
1 parent f6b46c5 commit 5c93775
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/deploy-script-support/src/coreProposalBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const t = 'makeCoreProposalBehavior';
* They are merged with all of the manifest getter's permits to produce the
* total permits needed by the resulting core proposal (such as might be---and
* generally are---written into a *-permit.json file).
* @see {@link ./writeCoreProposal.js}
* @see {@link ./writeCoreEvalParts.js}
*/
export const permits = {
consume: { agoricNamesAdmin: t, vatAdminSvc: t, zoe: t },
Expand Down Expand Up @@ -106,7 +106,7 @@ export const makeCoreProposalBehavior = ({
// HOWEVER, do note that this function is invoked with at least the *union* of powers
// required by individual moduleBehaviors declared by the manifest getter, which is
// necessary so it can use `runModuleBehaviors` to provide the appropriate subset to
// each one (see ./writeCoreProposal.js).
// each one (see ./writeCoreEvalParts.js).
// Handle `powers` with the requisite care.
const {
consume: { vatAdminSvc, zoe, agoricNamesAdmin },
Expand Down
4 changes: 2 additions & 2 deletions packages/deploy-script-support/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { makeSaveIssuer } from './saveIssuer.js';
import { makeGetBundlerMaker } from './getBundlerMaker.js';
import { assertOfferResult } from './assertOfferResult.js';
import { installInPieces } from './installInPieces.js';
import { makeWriteCoreEval } from './writeCoreProposal.js';
import { makeWriteCoreEval } from './writeCoreEvalParts.js';

export * from '@agoric/internal/src/node/createBundles.js';

Expand Down Expand Up @@ -137,7 +137,7 @@ export const makeHelpers = async (homePromise, endowments) => {
get getBundlerMaker() {
return makeGetBundlerMaker(homePromise, { bundleSource, lookup });
},
/** @returns {import('./writeCoreProposal.js').WriteCoreEval} */
/** @returns {import('./writeCoreEvalParts.js').WriteCoreEval} */
get writeCoreEval() {
return makeWriteCoreEval(homePromise, endowments, {
getBundleSpec: deps.cacheAndGetBundleSpec,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {
} from './coreProposalBehavior.js';

/**
* @callback WriteCoreEval write to disk the files needed for a CoreEval (permits, code, and the bundles the code loads)
* @callback WriteCoreEval write to disk the files needed for a CoreEval (js code to`${filePrefix}.js`, permits to `${filePrefix}-permit.json`, an overall
* summary to `${filePrefix}-plan.json), plus whatever bundles bundles the code loads)
* see CoreEval in {@link '/golang/cosmos/x/swingset/types/swingset.pb.go'}
* @param {string} filePrefix - name on disk
* @param {string} filePrefix name on disk
* @param {import('./externalTypes.js').CoreEvalBuilder} builder
* @returns {Promise<void>}
*/
Expand Down Expand Up @@ -59,10 +60,10 @@ export const makeWriteCoreEval = (
getManifestCall: [manifestGetterName, ...manifestGetterArgs],
} = coreEval;

const evalNS = await import(pathResolve(sourceSpec));
const moduleRecord = await import(pathResolve(sourceSpec));

// We only care about the manifest, not any restoreRef calls.
const { manifest } = await evalNS[manifestGetterName](
const { manifest } = await moduleRecord[manifestGetterName](
harden({ restoreRef: x => `restoreRef:${x}` }),
...manifestGetterArgs,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@agoric/vats/src/core/utils.js';
import { makeCoreProposalBehavior } from '../../src/coreProposalBehavior.js';

// TODO: we need to rewrite writeCoreProposal.js to produce BundleIDs,
// TODO: we need to rewrite writeCoreEvalParts.js to produce BundleIDs,
// although this test doesn't exercise that.

test('coreProposalBehavior', async t => {
Expand Down

0 comments on commit 5c93775

Please sign in to comment.