Skip to content

Commit

Permalink
feat(swingset-tools): [replay] Option to load snapshots through config
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Jan 12, 2023
1 parent 703b421 commit 9a9ea0b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/SwingSet/misc-tools/replay-transcript.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ const argv = yargsParser(process.argv.slice(2), {
recordXsnapTrace: false,
useXsnapDebug: false,
},
config: {
config: true,
},
configuration: {
'duplicate-arguments-array': false,
'flatten-duplicate-arrays': false,
Expand Down Expand Up @@ -978,6 +981,23 @@ async function replay(transcriptFile) {
);
}
}

const loadSnapshots = [].concat(
argv.loadSnapshots?.[transcriptNum] || [],
);
for (const snapshotID of loadSnapshots) {
// eslint-disable-next-line no-await-in-loop
await loadSnapshot(
{
snapshotID,
vatID,
},
argv.keepWorkerExplicitLoad ||
(argv.keepWorkerHashDifference &&
(loadSnapshots.length > 1 ||
!uniqueSnapshotIDs.includes(snapshotID))),
);
}
}
}
} finally {
Expand Down

0 comments on commit 9a9ea0b

Please sign in to comment.