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 Sep 27, 2023
1 parent 4ffd2ad commit 1505dc6
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 @@ -48,6 +48,7 @@
"@endo/init": "^0.5.59",
"@endo/marshal": "^0.8.8",
"@endo/nat": "^4.1.30",
"@endo/pass-style": "^0.1.6",
"@endo/patterns": "^0.2.5",
"@endo/promise-kit": "^0.2.59",
"@endo/ses-ava": "^0.2.43",
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 @@ -190,6 +190,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.4.1",
"@endo/marshal": "^0.8.8",
"@endo/nat": "^4.1.30",
"@endo/pass-style": "^0.1.6",
"@endo/patterns": "^0.2.5",
"@endo/promise-kit": "^0.2.59",
"import-meta-resolve": "^2.2.1",
Expand Down

0 comments on commit 1505dc6

Please sign in to comment.