Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Mar 7, 2023
1 parent 085a87c commit 470c569
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const decoder = new TextDecoder();
* allVatPowers: VatPowers,
* kernelKeeper: KernelKeeper,
* kernelSlog: KernelSlog,
* startXSnap: (workerVersion: string, vatID: string, name: string, handleCommand: AsyncHandler, metered?: boolean, reload?: boolean) => Promise<XSnap>,
* startXSnap: (workerVersion: string, vatID: string, name: string,
* handleCommand: AsyncHandler, metered?: boolean,
* reload?: boolean) => Promise<XSnap>,
* testLog: (...args: unknown[]) => void,
* }} tools
* @returns {VatManagerFactory}
Expand Down
3 changes: 2 additions & 1 deletion packages/SwingSet/src/types-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export {};
* @typedef { { transcriptCount: number } } VatStats
* @typedef { ReturnType<typeof import('./kernel/state/vatKeeper').makeVatKeeper> } VatKeeper
* @typedef { ReturnType<typeof import('./kernel/state/kernelKeeper').default> } KernelKeeper
* @typedef { ReturnType<typeof import('@agoric/xsnap').xsnap> } XSnap
* @typedef { (err: {}) => string } TrapMeteringFailure
* @typedef { ReturnType<typeof import('@agoric/xsnap').xsnap> & { trapMeteringFailure: TrapMeteringFailure } } XSnap
* @typedef { (dr: VatDeliveryResult) => void } SlogFinishDelivery
* @typedef { (ksr: KernelSyscallResult, vsr: VatSyscallResult) => void } SlogFinishSyscall
* @typedef { { write: ({}) => void,
Expand Down
10 changes: 10 additions & 0 deletions packages/swingset-worker-xsnap-v1/src/make-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ import { getSupervisorBundle } from '@agoric/swingset-xsnap-supervisor';

const NETSTRING_MAX_CHUNK_SIZE = 12_000_000;

/**
* SnapStore is defined by swing-store, but we don't import that: we get it
* from swingset as an option. To avoid an inconvenient dependency graph,
* we define the salient methods locally.
*
* @typedef {<T>(vatID: string, loadRaw: (filePath: string) => Promise<T>) => Promise<T>} LoadSnapshot
* @typedef {{ loadSnapshot: LoadSnapshot }} SnapStore
*/
/**
* @param {{
* snapStore?: SnapStore,
Expand Down Expand Up @@ -83,7 +91,9 @@ export function makeStartXSnapV1(options) {
const worker = doXSnap({ handleCommand, name, ...meterOpts, ...xsnapOpts });

let bundles = [];
// eslint-disable-next-line @jessie.js/no-nested-await
bundles.push(await getLockdownBundle());
// eslint-disable-next-line @jessie.js/no-nested-await
bundles.push(await getSupervisorBundle());
if (overrideBundles) {
bundles = overrideBundles; // replace the usual bundles
Expand Down
5 changes: 3 additions & 2 deletions packages/swingset-worker-xsnap-v1/test/test-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makeMarshal } from '@endo/marshal';
import { Fail } from '@agoric/assert';
import { makeStartXSnapV1 } from '../src/index.js';

const nope = () => Fail('nope');
const nope = () => Fail`nope`;
const kmarshal = makeMarshal(nope, nope, {
serializeBodyFormat: 'smallcaps',
errorTagging: 'off',
Expand All @@ -19,8 +19,9 @@ test('basic delivery', async t => {
const fn = new URL('./vat-simple.js', import.meta.url).pathname;
const bundle = await bundleSource(fn, { dev: true });

const snapStore = /** @type {SnapStore} */ undefined;
const startXSnapV1 = makeStartXSnapV1({
snapstore: undefined, // unused by this test
snapStore, // unused by this test
spawn,
});

Expand Down

0 comments on commit 470c569

Please sign in to comment.