Skip to content

Commit

Permalink
refactor: naming
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 8, 2024
1 parent 0e2038b commit ed37a0b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/deploy-script-support/src/writeCoreEvalParts.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @ts-check
import fs from 'fs';
import { E } from '@endo/far';
import { deeplyFulfilled } from '@endo/marshal';

import { createBundles } from '@agoric/internal/src/node/createBundles.js';
import { deeplyFulfilledObject } from '@agoric/internal';
import { defangAndTrim, mergePermits, stringify } from './code-gen.js';
import {
makeCoreProposalBehavior,
Expand All @@ -26,7 +26,10 @@ import {
/**
*
* @param {*} homeP
* @param {*} endowments
* @param {{
* bundleSource: (path: string) => Promise<NodeModule>,
* pathResolve: (path: string) => string,
* }} endowments
* @param {{
* getBundlerMaker: () => Promise<import('./getBundlerMaker.js').BundleMaker>,
* getBundleSpec: (...args: *) => Promise<import('./externalTypes.js').ManifestBundleRef>,
Expand Down Expand Up @@ -69,10 +72,10 @@ export const makeWriteCoreEval = (
getManifestCall: [manifestGetterName, ...manifestGetterArgs],
} = coreEval;

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

// We only care about the manifest, not any restoreRef calls.
const { manifest } = await moduleRecord[manifestGetterName](
const { manifest } = await moduleNamespace[manifestGetterName](
harden({ restoreRef: x => `restoreRef:${x}` }),
...manifestGetterArgs,
);
Expand Down Expand Up @@ -146,15 +149,15 @@ export const makeWriteCoreEval = (
};

// Create the eval structure.
const evalParts = await deeplyFulfilled(
const evalDescriptor = await deeplyFulfilledObject(
harden(builder({ publishRef, install })),
);
const { sourceSpec, getManifestCall } = evalParts;
const { sourceSpec, getManifestCall } = evalDescriptor;
// console.log('created', { filePrefix, sourceSpec, getManifestCall });

// Extract the top-level permit.
const { permits: evalPermits, manifest: customManifest } =
await mergeEvalPermit(evalParts, defaultPermits);
await mergeEvalPermit(evalDescriptor, defaultPermits);

// Get an install
const manifestBundleRef = await publishRef(install(sourceSpec));
Expand Down

0 comments on commit ed37a0b

Please sign in to comment.