Skip to content

Commit

Permalink
move transcript types to types-internal.js
Browse files Browse the repository at this point in the history
These didn't need to be exposed in types-external.js
  • Loading branch information
warner committed Apr 26, 2023
1 parent bd8e060 commit b16e746
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/SwingSet/src/kernel/state/vatKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { enumeratePrefixedKeys } from './storageHelper.js';
* @typedef { import('../../types-external.js').TranscriptStore } TranscriptStore
* @typedef { import('../../types-internal.js').VatManager } VatManager
* @typedef { import('../../types-internal.js').RecordedVatOptions } RecordedVatOptions
* @typedef { import('../../types-external.js').TranscriptEntry } TranscriptEntry
* @typedef { import('../../types-internal.js').TranscriptEntry } TranscriptEntry
*/

// makeVatKeeper is a pure function: all state is kept in the argument object
Expand Down
6 changes: 4 additions & 2 deletions packages/SwingSet/src/kernel/vat-warehouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import djson from '../lib/djson.js';
* @typedef {import('@agoric/swingset-liveslots').VatSyscallResult} VatSyscallResult
* @typedef {import('@agoric/swingset-liveslots').VatSyscallHandler} VatSyscallHandler
* @typedef {import('../types-internal.js').VatManager} VatManager
* @typedef {import('../types-internal.js').TranscriptDeliveryResults} TranscriptDeliveryResults
* @typedef {import('../types-internal.js').TranscriptEntry} TranscriptEntry
* @typedef {{ body: string, slots: unknown[] }} Capdata
* @typedef { [unknown, ...unknown[]] } Tagged
* @typedef { { moduleFormat: string }} Bundle
Expand Down Expand Up @@ -49,7 +51,7 @@ function recordSyscalls(origHandler) {
* @param {*} kernelSlog
* @param {string} vatID
* @param {number} deliveryNum
* @param {import('../types-external.js').TranscriptEntry} transcriptEntry
* @param {TranscriptEntry} transcriptEntry
* @returns { {
* syscallHandler: (vso: VatSyscallObject) => VatSyscallResult,
* finishSimulation: () => void,
Expand Down Expand Up @@ -489,7 +491,7 @@ export function makeVatWarehouse({
// destroy the vat, change what we do with the transcript here.
if (options.useTranscript) {
// record transcript entry
/** @type { import('../types-external.js').TranscriptDeliveryResults} */
/** @type {TranscriptDeliveryResults} */
const tdr = { status: deliveryResult[0] };
const transcriptEntry = { d: vd, sc: getTranscriptSyscalls(), r: tdr };
vatKeeper.addToTranscript(transcriptEntry);
Expand Down
1 change: 0 additions & 1 deletion packages/SwingSet/src/types-ambient.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
* @typedef { import('./types-external.js').DeviceInvocationResultError } DeviceInvocationResultError
* @typedef { import('./types-external.js').DeviceInvocationResult } DeviceInvocationResult
*
* @typedef { import('./types-external.js').TranscriptEntry } TranscriptEntry
* @typedef { import('./types-external.js').VatStats } VatStats
* @typedef { import('./types-external.js').VatKeeper } VatKeeper
* @typedef { import('./types-external.js').KernelKeeper } KernelKeeper
Expand Down
3 changes: 0 additions & 3 deletions packages/SwingSet/src/types-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ export {};
* @typedef {[tag: 'error', problem: string]} DeviceInvocationResultError
* @typedef { DeviceInvocationResultOk | DeviceInvocationResultError } DeviceInvocationResult
*
* @typedef { { s: VatSyscallObject, r: VatSyscallResult } } TranscriptSyscall
* @typedef { { status: string } } TranscriptDeliveryResults
* @typedef { { d: VatDeliveryObject, sc: TranscriptSyscall[], r: TranscriptDeliveryResults } } TranscriptEntry
* @typedef { { transcriptCount: number } } VatStats
* @typedef { ReturnType<typeof import('./kernel/state/vatKeeper').makeVatKeeper> } VatKeeper
* @typedef { ReturnType<typeof import('./kernel/state/kernelKeeper').default> } KernelKeeper
Expand Down
8 changes: 8 additions & 0 deletions packages/SwingSet/src/types-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export {};
* @typedef { import('./types-external.js').OptManagerType } OptManagerType
* @typedef { import('@agoric/swingset-liveslots').VatDeliveryObject } VatDeliveryObject
* @typedef { import('@agoric/swingset-liveslots').VatDeliveryResult } VatDeliveryResult
* @typedef { import('@agoric/swingset-liveslots').VatSyscallObject } VatSyscallObject
* @typedef { import('@agoric/swingset-liveslots').VatSyscallResult } VatSyscallResult
* @typedef { import('@agoric/swingset-liveslots').VatSyscallHandler } VatSyscallHandler
*
* // used by vatKeeper.setSourceAndOptions(source, RecordedVatOptions)
Expand Down Expand Up @@ -94,3 +96,9 @@ export {};
* RunQueueEventNegatedGCAction | RunQueueEventBringOutYourDead
* } RunQueueEvent
*/

/**
* @typedef { { s: VatSyscallObject, r: VatSyscallResult } } TranscriptSyscall
* @typedef { { status: string } } TranscriptDeliveryResults
* @typedef { { d: VatDeliveryObject, sc: TranscriptSyscall[], r: TranscriptDeliveryResults } } TranscriptEntry
*/

0 comments on commit b16e746

Please sign in to comment.