Skip to content

Commit

Permalink
fix: add passStyleOf to VatData global
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Aug 22, 2023
1 parent 61b6c39 commit 6a0a373
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@endo/marshal": "^0.8.6",
"@endo/nat": "^4.1.28",
"@endo/patterns": "^0.2.3",
"@endo/pass-style": "^0.1.4",
"@endo/promise-kit": "^0.2.57",
"@endo/ses-ava": "^0.2.41",
"@endo/zip": "^0.2.32",
Expand Down
1 change: 1 addition & 0 deletions packages/SwingSet/test/test-vat-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ async function testForExpectedGlobals(t, workerType) {
'VatData.makeScalarBigWeakMapStore: function',
'VatData.makeScalarBigSetStore: function',
'VatData.makeScalarBigWeakSetStore: function',
'VatData.passStyleOf: function',
]);
}

Expand Down
1 change: 1 addition & 0 deletions packages/swingset-liveslots/src/liveslots.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,7 @@ function build(
makeScalarBigWeakMapStore: collectionManager.makeScalarBigWeakMapStore,
makeScalarBigSetStore: collectionManager.makeScalarBigSetStore,
makeScalarBigWeakSetStore: collectionManager.makeScalarBigWeakSetStore,
passStyleOf,
},
});

Expand Down
1 change: 1 addition & 0 deletions packages/swingset-liveslots/src/vatDataTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export type VatData = {
options?: StoreOptions,
) => WeakSetStore<K>;
canBeDurable: (specimen: unknown) => boolean;
passStyleOf: (specimen: unknown) => string;
};

// The JSDoc is repeated here and at the function definition so it appears
Expand Down
2 changes: 2 additions & 0 deletions packages/swingset-liveslots/tools/setup-vat-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This file produces the globalThis.VatData property outside of a running
// SwingSet so that it can be used by '@agoric/vat-data' (which only *consumes*
// `globalThis.VatData`) in code under test.
import { passStyleOf } from '@endo/pass-style';
import { makeFakeVirtualStuff } from './fakeVirtualSupport.js';

const { WeakMap, WeakSet } = globalThis;
Expand All @@ -29,6 +30,7 @@ globalThis.VatData = harden({
fakeVomKit.cm.makeScalarBigSetStore(...args),
makeScalarBigWeakSetStore: (...args) =>
fakeVomKit.cm.makeScalarBigWeakSetStore(...args),
passStyleOf,
});

export const reincarnate = (options = {}) => {
Expand Down
1 change: 1 addition & 0 deletions packages/vat-data/src/vat-data-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if ('VatData' in globalThis) {
makeScalarBigSetStore: unvailable,
makeScalarBigWeakSetStore: unvailable,
canBeDurable: unvailable,
passStyleOf: unvailable, // not exported from here in any case
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/vats/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@endo/import-bundle": "^0.3.5",
"@endo/marshal": "^0.8.6",
"@endo/nat": "^4.1.28",
"@endo/pass-style": "^0.1.4",
"@endo/promise-kit": "^0.2.57",
"import-meta-resolve": "^2.2.1",
"jessie.js": "^0.3.2"
Expand Down

0 comments on commit 6a0a373

Please sign in to comment.