Skip to content

Commit

Permalink
feat: readPublished in SwingsetTestKit
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Nov 11, 2024
1 parent e48c53c commit 0b383c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/boot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dependencies": {
"@endo/errors": "^1.2.7",
"@agoric/builders": "^0.1.0",
"@agoric/client-utils": "^0.1.0",
"@agoric/cosmic-proto": "^0.4.0",
"@agoric/cosmic-swingset": "^0.41.3",
"@agoric/ertp": "^0.16.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/boot/tools/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basename, join } from 'path';
import { inspect } from 'util';

import { buildSwingset } from '@agoric/cosmic-swingset/src/launch-chain.js';
import type { TypedPublished } from '@agoric/client-utils';
import {
BridgeId,
makeTracer,
Expand Down Expand Up @@ -336,6 +337,9 @@ export const makeSwingsetTestKit = async (
return data;
};

const readPublished = <T extends string>(subpath: T) =>
readLatest(`published.${subpath}`) as TypedPublished<T>;

let lastBankNonce = 0n;
let ibcSequenceNonce = 0;
let lcaSequenceNonce = 0;
Expand Down Expand Up @@ -645,6 +649,7 @@ export const makeSwingsetTestKit = async (
getCrankNumber,
jumpTimeTo,
readLatest,
readPublished,
runUtils,
shutdown,
storage,
Expand Down

0 comments on commit 0b383c9

Please sign in to comment.