Skip to content

Commit

Permalink
fixup! feat(internal): Generalize single-level pick utility to recu…
Browse files Browse the repository at this point in the history
…rsive `attenuate`
  • Loading branch information
gibson042 committed Feb 14, 2025
1 parent d255a98 commit 090a6c7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
17 changes: 10 additions & 7 deletions packages/cosmic-swingset/src/launch-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1278,11 +1278,14 @@ export async function launchAndShareInternals({
*/
export async function launch(options) {
const launchResult = await launchAndShareInternals(options);
return attenuate(launchResult, {
blockingSend: 'pick',
shutdown: 'pick',
writeSlogObject: 'pick',
savedHeight: 'pick',
savedChainSends: 'pick',
});
return attenuate(
launchResult,
/** @type {const} */ ({
blockingSend: true,
shutdown: true,
writeSlogObject: true,
savedHeight: true,
savedChainSends: true,
}),
);
}
36 changes: 18 additions & 18 deletions packages/swing-store/src/swingStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,30 +566,30 @@ export function makeSwingStore(path, forceReset, options = {}) {
}

const transcriptStore = attenuate(transcriptStoreInternal, {
initTranscript: 'pick',
rolloverSpan: 'pick',
rolloverIncarnation: 'pick',
getCurrentSpanBounds: 'pick',
addItem: 'pick',
readSpan: 'pick',
stopUsingTranscript: 'pick',
deleteVatTranscripts: 'pick',
initTranscript: true,
rolloverSpan: true,
rolloverIncarnation: true,
getCurrentSpanBounds: true,
addItem: true,
readSpan: true,
stopUsingTranscript: true,
deleteVatTranscripts: true,
});

const snapStore = attenuate(snapStoreInternal, {
loadSnapshot: 'pick',
saveSnapshot: 'pick',
deleteAllUnusedSnapshots: 'pick',
deleteVatSnapshots: 'pick',
stopUsingLastSnapshot: 'pick',
getSnapshotInfo: 'pick',
loadSnapshot: true,
saveSnapshot: true,
deleteAllUnusedSnapshots: true,
deleteVatSnapshots: true,
stopUsingLastSnapshot: true,
getSnapshotInfo: true,
});

const bundleStore = attenuate(bundleStoreInternal, {
addBundle: 'pick',
hasBundle: 'pick',
getBundle: 'pick',
deleteBundle: 'pick',
addBundle: true,
hasBundle: true,
getBundle: true,
deleteBundle: true,
});

const kernelStorage = {
Expand Down

0 comments on commit 090a6c7

Please sign in to comment.