Skip to content

Commit

Permalink
chore(SwingSet): Use TotalMap to avoid TypeScript complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Jul 31, 2024
1 parent fde19d0 commit ae923d7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/SwingSet/src/kernel/gc-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Fail } from '@endo/errors';
import { insistKernelType } from './parseKernelSlots.js';
import { insistVatID } from '../lib/id.js';

/** @import {TotalMap} from '@agoric/internal'; */

/**
* @typedef {`v${number}`} VatID
* @typedef {`ko${number}`} KOID
Expand All @@ -19,14 +21,15 @@ const actionTypePriorities = ['dropExport', 'retireExport', 'retireImport'];

/**
* A mapping of GC action type to queue event type.
*
* @type {Map<GCActionType, GCQueueEventType>}
*/
const queueTypeFromActionType = new Map([
['dropExport', 'dropExports'],
['retireExport', 'retireExports'],
['retireImport', 'retireImports'],
]);
const queueTypeFromActionType =
/** @type {TotalMap<GCActionType, GCQueueEventType>} */ (
new Map([
['dropExport', 'dropExports'],
['retireExport', 'retireExports'],
['retireImport', 'retireImports'],
])
);

/**
* @param {GCActionString} s
Expand Down Expand Up @@ -138,7 +141,7 @@ export function processGCActionSet(kernelKeeper) {
return krefs;
}

/** @type {Map<VatID, Map<GCActionType, GCActionString[]>>} */
/** @type {TotalMap<VatID, TotalMap<GCActionType, GCActionString[]>>} */
const actionsByVat = new Map();
for (const action of allActionsSet) {
const { vatID, type } = parseAction(action);
Expand Down

0 comments on commit ae923d7

Please sign in to comment.