@agoric/swingset-liveslots 0.10.3-other-dev-3eb1a1d.0 → 0.10.3-other-dev-fbe72e7.0.fbe72e7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/package.json +26 -26
  2. package/src/boyd-gc.d.ts +12 -0
  3. package/src/boyd-gc.d.ts.map +1 -0
  4. package/src/cache.d.ts +71 -0
  5. package/src/cache.d.ts.map +1 -0
  6. package/src/capdata.d.ts +16 -0
  7. package/src/capdata.d.ts.map +1 -0
  8. package/src/capdata.js +16 -8
  9. package/src/collectionManager.d.ts +47 -0
  10. package/src/collectionManager.d.ts.map +1 -0
  11. package/src/collectionManager.js +1 -0
  12. package/src/facetiousness.d.ts +25 -0
  13. package/src/facetiousness.d.ts.map +1 -0
  14. package/src/index.d.ts +4 -0
  15. package/src/index.d.ts.map +1 -0
  16. package/src/kdebug.d.ts +7 -0
  17. package/src/kdebug.d.ts.map +1 -0
  18. package/src/liveslots.d.ts +42 -0
  19. package/src/liveslots.d.ts.map +1 -0
  20. package/src/liveslots.js +6 -4
  21. package/src/message.d.ts +49 -0
  22. package/src/message.d.ts.map +1 -0
  23. package/src/message.js +7 -3
  24. package/src/parseVatSlots.d.ts +125 -0
  25. package/src/parseVatSlots.d.ts.map +1 -0
  26. package/src/types.d.ts +81 -0
  27. package/src/types.d.ts.map +1 -0
  28. package/src/types.js +6 -5
  29. package/src/vatDataTypes.d.ts +170 -0
  30. package/src/vatDataTypes.d.ts.map +1 -0
  31. package/src/vatDataTypes.ts +272 -0
  32. package/src/vatstore-iterators.d.ts +4 -0
  33. package/src/vatstore-iterators.d.ts.map +1 -0
  34. package/src/vatstore-usage.md +198 -0
  35. package/src/virtualObjectManager.d.ts +44 -0
  36. package/src/virtualObjectManager.d.ts.map +1 -0
  37. package/src/virtualObjectManager.js +70 -14
  38. package/src/virtualReferences.d.ts +61 -0
  39. package/src/virtualReferences.d.ts.map +1 -0
  40. package/src/vpid-tracking.md +92 -0
  41. package/src/watchedPromises.d.ts +31 -0
  42. package/src/watchedPromises.d.ts.map +1 -0
  43. package/src/watchedPromises.js +19 -12
  44. package/test/collections.test.js +25 -4
  45. package/test/dummyMeterControl.d.ts +2 -0
  46. package/test/dummyMeterControl.d.ts.map +1 -0
  47. package/test/engine-gc.d.ts +3 -0
  48. package/test/engine-gc.d.ts.map +1 -0
  49. package/test/gc-and-finalize.d.ts +5 -0
  50. package/test/gc-and-finalize.d.ts.map +1 -0
  51. package/test/gc-helpers.js +2 -2
  52. package/test/handled-promises.test.js +529 -163
  53. package/test/initial-vrefs.test.js +12 -18
  54. package/test/liveslots-helpers.d.ts +64 -0
  55. package/test/liveslots-helpers.d.ts.map +1 -0
  56. package/test/liveslots-helpers.js +1 -0
  57. package/test/liveslots-real-gc.test.js +11 -9
  58. package/test/liveslots.test.js +3 -3
  59. package/test/storeGC/lifecycle.test.js +13 -12
  60. package/test/util.d.ts +25 -0
  61. package/test/util.d.ts.map +1 -0
  62. package/test/util.js +2 -2
  63. package/test/vat-util.d.ts +9 -0
  64. package/test/vat-util.d.ts.map +1 -0
  65. package/test/virtual-objects/state-shape.test.js +312 -221
  66. package/test/virtual-objects/virtualObjectGC.test.js +37 -36
  67. package/test/virtual-objects/virtualObjectManager.test.js +41 -63
  68. package/test/vo-test-harness.test.js +13 -9
  69. package/test/waitUntilQuiescent.d.ts +3 -0
  70. package/test/waitUntilQuiescent.d.ts.map +1 -0
  71. package/tools/fakeCollectionManager.d.ts +14 -0
  72. package/tools/fakeCollectionManager.d.ts.map +1 -0
  73. package/tools/fakeVirtualObjectManager.d.ts +32 -0
  74. package/tools/fakeVirtualObjectManager.d.ts.map +1 -0
  75. package/tools/fakeVirtualSupport.d.ts +278 -0
  76. package/tools/fakeVirtualSupport.d.ts.map +1 -0
  77. package/tools/prepare-strict-test-env.d.ts +37 -0
  78. package/tools/prepare-strict-test-env.d.ts.map +1 -0
  79. package/tools/prepare-test-env.d.ts +2 -0
  80. package/tools/prepare-test-env.d.ts.map +1 -0
  81. package/tools/setup-vat-data.d.ts +9 -0
  82. package/tools/setup-vat-data.d.ts.map +1 -0
  83. package/tools/setup-vat-data.js +0 -1
  84. package/tools/vo-test-harness.d.ts +33 -0
  85. package/tools/vo-test-harness.d.ts.map +1 -0
  86. package/tools/vo-test-harness.js +21 -0
@@ -70,34 +70,28 @@ test('initial vatstore contents', async t => {
70
70
  t.deepEqual(kunser(JSON.parse(get(`vc.1.|schemata`))), stringSchema);
71
71
 
72
72
  // then three tables for the promise watcher (one virtual, two durable)
73
- t.is(getLabel(`vc.3.|schemata`), 'promiseWatcherByKind'); // durable
74
- t.is(getLabel(`vc.4.|schemata`), 'watchedPromises'); // durable
75
- // the promiseRegistrations table is not durable, and only gets vc.2
76
- // on the first incarnation: it will get a new ID on subsequent
77
- // incarnations
78
- t.is(getLabel(`vc.2.|schemata`), `promiseRegistrations`); // virtual
73
+ t.is(getLabel(`vc.2.|schemata`), 'promiseWatcherByKind'); // durable
74
+ t.is(getLabel(`vc.3.|schemata`), 'watchedPromises'); // durable
79
75
 
80
76
  const watcherTableVref = get('watcherTableID');
81
77
  const watchedPromiseTableVref = get('watchedPromiseTableID');
82
- t.is(watcherTableVref, `${dmsBase}/3`);
83
- t.is(watchedPromiseTableVref, `${dmsBase}/4`);
78
+ t.is(watcherTableVref, `${dmsBase}/2`);
79
+ t.is(watchedPromiseTableVref, `${dmsBase}/3`);
84
80
 
85
81
  // baggage and the two durable promise-watcher tables are pinned
86
82
  t.is(get(`vom.rc.${baggageVref}`), '1');
87
83
  t.is(get(`vom.rc.${watcherTableVref}`), '1');
88
84
  t.is(get(`vom.rc.${watchedPromiseTableVref}`), '1');
89
85
 
90
- // promiseRegistrations and promiseWatcherByKind arbitrary scalars as keys
91
- const scalarSchema2 = { label: 'promiseRegistrations', keyShape: M.scalar() };
86
+ // promiseWatcherByKind arbitrary scalars as keys
92
87
  const scalarSchema3 = { label: 'promiseWatcherByKind', keyShape: M.scalar() };
93
- t.deepEqual(kunser(JSON.parse(get(`vc.2.|schemata`))), scalarSchema2);
94
- t.deepEqual(kunser(JSON.parse(get(`vc.3.|schemata`))), scalarSchema3);
88
+ t.deepEqual(kunser(JSON.parse(get(`vc.2.|schemata`))), scalarSchema3);
95
89
  // watchedPromises uses vref (string) keys
96
90
  const scalarStringSchema = {
97
91
  label: 'watchedPromises',
98
92
  keyShape: M.and(M.scalar(), M.string()),
99
93
  };
100
- t.deepEqual(kunser(JSON.parse(get(`vc.4.|schemata`))), scalarStringSchema);
94
+ t.deepEqual(kunser(JSON.parse(get(`vc.3.|schemata`))), scalarStringSchema);
101
95
  });
102
96
 
103
97
  test('vrefs', async t => {
@@ -141,11 +135,11 @@ test('vrefs', async t => {
141
135
  const dh2Vref = (await run('getDinstance2')).slots[0];
142
136
  t.is(dh2Vref, expectedDH2Vref);
143
137
 
144
- // the liveslots-created collections consume vc.1 through vc.4,
145
- // leaving vc.5 for the first user-created collection
146
- t.is(getLabel('vc.5.|schemata'), 'store1');
147
- const expectedStore1Vref = `o+v${initialKindIDs.scalarMapStore}/5`;
138
+ // the liveslots-created collections consume vc.1 through vc.3,
139
+ // leaving vc.4 for the first user-created collection
140
+ t.is(getLabel('vc.4.|schemata'), 'store1');
141
+ const expectedStore1Vref = `o+v${initialKindIDs.scalarMapStore}/4`;
148
142
  const store1Vref = (await run('getStore1')).slots[0];
149
143
  t.is(store1Vref, expectedStore1Vref);
150
- t.is(kunser(JSON.parse(fakestore.get(`vc.5.s${'key'}`))), 'value');
144
+ t.is(kunser(JSON.parse(fakestore.get(`vc.4.s${'key'}`))), 'value');
151
145
  });
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @param {object} [options]
3
+ * @param {boolean} [options.skipLogging]
4
+ * @param {Map<string, string>} [options.kvStore]
5
+ */
6
+ export function buildSyscall(options?: {
7
+ skipLogging?: boolean | undefined;
8
+ kvStore?: Map<string, string> | undefined;
9
+ }): {
10
+ syscall: {
11
+ send(targetSlot: any, methargs: any, resultSlot: any): void;
12
+ subscribe(target: any): void;
13
+ resolve(resolutions: any): void;
14
+ dropImports(slots: any): void;
15
+ retireImports(slots: any): void;
16
+ retireExports(slots: any): void;
17
+ exit(isFailure: any, info: any): void;
18
+ vatstoreGet(key: any): any;
19
+ vatstoreGetNextKey(priorKey: any): any;
20
+ vatstoreSet(key: any, value: any): void;
21
+ vatstoreDelete(key: any): void;
22
+ };
23
+ fakestore: Map<any, any>;
24
+ log: any[];
25
+ };
26
+ export function makeDispatch(syscall: any, build: any, vatID?: string, liveSlotsOptions?: {}, vatParameters?: undefined): Promise<{
27
+ dispatch: any;
28
+ testHooks: any;
29
+ }>;
30
+ /**
31
+ * @param {import('ava').ExecutionContext} t
32
+ * @param {Function} buildRootObject
33
+ * @param {string} vatName
34
+ * @param {object} [options]
35
+ * @param {boolean} [options.forceGC]
36
+ * @param {Map<string, string>} [options.kvStore]
37
+ * @param {number} [options.nextPromiseImportNumber]
38
+ * @param {boolean} [options.skipLogging]
39
+ * @param {any} [options.vatParameters]
40
+ */
41
+ export function setupTestLiveslots(t: import("ava").ExecutionContext, buildRootObject: Function, vatName: string, options?: {
42
+ forceGC?: boolean | undefined;
43
+ kvStore?: Map<string, string> | undefined;
44
+ nextPromiseImportNumber?: number | undefined;
45
+ skipLogging?: boolean | undefined;
46
+ vatParameters?: any;
47
+ }): Promise<{
48
+ v: {
49
+ t: import("ava").ExecutionContext<unknown>;
50
+ log: any[];
51
+ fakestore: Map<any, any>;
52
+ dumpFakestore: () => void;
53
+ };
54
+ dispatch: any;
55
+ dispatchMessage: (message: any, ...args: any[]) => Promise<string>;
56
+ dispatchMessageSuccessfully: (message: any, ...args: any[]) => Promise<any>;
57
+ dispatchDropExports: (...vrefs: any[]) => Promise<void>;
58
+ dispatchRetireExports: (...vrefs: any[]) => Promise<void>;
59
+ dispatchRetireImports: (...vrefs: any[]) => Promise<void>;
60
+ nextPImport: () => string;
61
+ testHooks: any;
62
+ }>;
63
+ export function findSyscallsByType(log: any, type: any): any;
64
+ //# sourceMappingURL=liveslots-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveslots-helpers.d.ts","sourceRoot":"","sources":["liveslots-helpers.js"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,uCAHG;IAA0B,WAAW;IACC,OAAO;CAAC;;;;;;;;;;;;;;;;EA2GhD;AAED;;;GA2BC;AAUD;;;;;;;;;;GAUG;AACH,sCAVW,OAAO,KAAK,EAAE,gBAAgB,sCAE9B,MAAM,YAEd;IAA0B,OAAO;IACK,OAAO;IACpB,uBAAuB;IACtB,WAAW;IACf,aAAa,GAA3B,GAAG;CAAyB;;;;;;;;;;;;;;;GA6GtC;AAED,6DAEC"}
@@ -278,6 +278,7 @@ export async function setupTestLiveslots(
278
278
  dispatchDropExports,
279
279
  dispatchRetireExports,
280
280
  dispatchRetireImports,
281
+ nextPImport: nextRP,
281
282
  testHooks,
282
283
  };
283
284
  }
@@ -5,6 +5,7 @@ import test from 'ava';
5
5
  import { Far } from '@endo/marshal';
6
6
  import { makePromiseKit } from '@endo/promise-kit';
7
7
  import { kslot, kser } from '@agoric/kmarshal';
8
+ import { avaRetry } from '@agoric/internal/tools/avaRetry.js';
8
9
  import engineGC from './engine-gc.js';
9
10
  import { watchCollected, makeGcAndFinalize } from './gc-and-finalize.js';
10
11
  import { buildSyscall, makeDispatch } from './liveslots-helpers.js';
@@ -26,7 +27,7 @@ const gcAndFinalize = makeGcAndFinalize(engineGC);
26
27
  // inconsistent GC behavior under Node.js and AVA with tests running
27
28
  // in parallel, so we mark them all with test.serial()
28
29
 
29
- test.serial('liveslots retains pending exported promise', async t => {
30
+ avaRetry(test.serial, 'liveslots retains pending exported promise', async t => {
30
31
  const { log, syscall } = buildSyscall();
31
32
  let collected;
32
33
  const success = [];
@@ -64,7 +65,7 @@ test.serial('liveslots retains pending exported promise', async t => {
64
65
  t.deepEqual(success, ['yes']);
65
66
  });
66
67
 
67
- test.serial('liveslots retains device nodes', async t => {
68
+ avaRetry(test.serial, 'liveslots retains device nodes', async t => {
68
69
  const { syscall } = buildSyscall();
69
70
  let collected;
70
71
  const recognize = new WeakSet(); // real WeakSet
@@ -92,7 +93,7 @@ test.serial('liveslots retains device nodes', async t => {
92
93
  t.deepEqual(success, [true]);
93
94
  });
94
95
 
95
- test.serial('GC syscall.dropImports', async t => {
96
+ avaRetry(test.serial, 'GC syscall.dropImports', async t => {
96
97
  const { log, syscall } = buildSyscall();
97
98
  let collected;
98
99
  function build(_vatPowers) {
@@ -177,7 +178,7 @@ test.serial('GC syscall.dropImports', async t => {
177
178
  t.deepEqual(log, []);
178
179
  });
179
180
 
180
- test.serial('GC dispatch.retireImports', async t => {
181
+ avaRetry(test.serial, 'GC dispatch.retireImports', async t => {
181
182
  const { log, syscall } = buildSyscall();
182
183
  function build(_vatPowers) {
183
184
  // eslint-disable-next-line no-unused-vars
@@ -210,7 +211,7 @@ test.serial('GC dispatch.retireImports', async t => {
210
211
  // when we implement VOM.vrefIsRecognizable, this test might do more
211
212
  });
212
213
 
213
- test.serial('GC dispatch.retireExports', async t => {
214
+ avaRetry(test.serial, 'GC dispatch.retireExports', async t => {
214
215
  const { log, syscall } = buildSyscall();
215
216
  function build(_vatPowers) {
216
217
  const ex1 = Far('export', {});
@@ -253,7 +254,7 @@ test.serial('GC dispatch.retireExports', async t => {
253
254
  t.deepEqual(log, []);
254
255
  });
255
256
 
256
- test.serial('GC dispatch.dropExports', async t => {
257
+ avaRetry(test.serial, 'GC dispatch.dropExports', async t => {
257
258
  const { log, syscall } = buildSyscall();
258
259
  let collected;
259
260
  function build(_vatPowers) {
@@ -288,7 +289,7 @@ test.serial('GC dispatch.dropExports', async t => {
288
289
  t.deepEqual(log.shift(), {
289
290
  type: 'vatstoreSet',
290
291
  key: 'idCounters',
291
- value: '{"exportID":11,"collectionID":5,"promiseID":5}',
292
+ value: '{"exportID":11,"collectionID":4,"promiseID":5}',
292
293
  });
293
294
  t.deepEqual(log, []);
294
295
 
@@ -326,7 +327,8 @@ test.serial('GC dispatch.dropExports', async t => {
326
327
  t.deepEqual(log, []);
327
328
  });
328
329
 
329
- test.serial(
330
+ avaRetry(
331
+ test.serial,
330
332
  'GC dispatch.retireExports inhibits syscall.retireExports',
331
333
  async t => {
332
334
  const { log, syscall } = buildSyscall();
@@ -367,7 +369,7 @@ test.serial(
367
369
  t.deepEqual(log.shift(), {
368
370
  type: 'vatstoreSet',
369
371
  key: 'idCounters',
370
- value: '{"exportID":11,"collectionID":5,"promiseID":5}',
372
+ value: '{"exportID":11,"collectionID":4,"promiseID":5}',
371
373
  });
372
374
  t.deepEqual(log, []);
373
375
 
@@ -713,7 +713,7 @@ test('capdata size limit on syscalls', async t => {
713
713
  const label = 'test';
714
714
  t.deepEqual(log.shift(), {
715
715
  type: 'vatstoreGet',
716
- key: 'vc.5.|schemata',
716
+ key: 'vc.4.|schemata',
717
717
  result: JSON.stringify(kser({ label, keyShape: M.scalar() })),
718
718
  });
719
719
  };
@@ -723,7 +723,7 @@ test('capdata size limit on syscalls', async t => {
723
723
  gotSchema();
724
724
  t.deepEqual(log.shift(), {
725
725
  type: 'vatstoreGet',
726
- key: 'vc.5.skey',
726
+ key: 'vc.4.skey',
727
727
  result: undefined,
728
728
  });
729
729
  expectFail();
@@ -735,7 +735,7 @@ test('capdata size limit on syscalls', async t => {
735
735
  gotSchema();
736
736
  t.deepEqual(log.shift(), {
737
737
  type: 'vatstoreGet',
738
- key: 'vc.5.skey',
738
+ key: 'vc.4.skey',
739
739
  result: undefined,
740
740
  });
741
741
  expectFail();
@@ -1,5 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import test from 'ava';
3
+ import { avaRetry } from '@agoric/internal/tools/avaRetry.js';
3
4
 
4
5
  import { kslot, kunser } from '@agoric/kmarshal';
5
6
  import {
@@ -14,12 +15,12 @@ import { parseVatSlot } from '../../src/parseVatSlots.js';
14
15
 
15
16
  function getLastCollection(v) {
16
17
  // makeAndHold() uses makeScalarBigMapStore, and since we call it
17
- // early, it always gets "store #6", in vref o+2/6 (o+2 means
18
- // scalarMapStore, non-durable, and /6 means collectionID=6)
19
- const vref = 'o+v2/6';
18
+ // early, it always gets "store #5", in vref o+2/5 (o+2 means
19
+ // scalarMapStore, non-durable, and /5 means collectionID=5)
20
+ const vref = 'o+v2/5';
20
21
  // double-check that at least the collectionID is right
21
22
  const { t, fakestore } = v;
22
- t.is(JSON.parse(fakestore.get('idCounters')).collectionID, 7); // last was 6
23
+ t.is(JSON.parse(fakestore.get('idCounters')).collectionID, 6); // last was 5
23
24
  return vref;
24
25
  }
25
26
 
@@ -66,7 +67,7 @@ function assertState(v, vref, reachable, erv) {
66
67
  // different test.
67
68
 
68
69
  // test 1: lerv -> Lerv -> LerV -> Lerv -> lerv
69
- test.serial('store lifecycle 1', async t => {
70
+ avaRetry(test.serial, 'store lifecycle 1', async t => {
70
71
  const { v, dispatchMessageSuccessfully } = await setupTestLiveslots(
71
72
  t,
72
73
  buildRootObject,
@@ -94,7 +95,7 @@ test.serial('store lifecycle 1', async t => {
94
95
 
95
96
  // test 2: lerv -> Lerv -> LerV -> lerV -> LerV -> LERV -> lERV -> LERV ->
96
97
  // lERV -> LERV -> lERV -> leRV -> LeRV -> leRV -> LeRV -> LerV
97
- test.serial('store lifecycle 2', async t => {
98
+ avaRetry(test.serial, 'store lifecycle 2', async t => {
98
99
  const {
99
100
  v,
100
101
  dispatchMessageSuccessfully,
@@ -170,7 +171,7 @@ test.serial('store lifecycle 2', async t => {
170
171
  });
171
172
 
172
173
  // test 3: lerv -> Lerv -> LerV -> LERV -> LeRV -> leRV -> lerV -> lerv
173
- test.serial('store lifecycle 3', async t => {
174
+ avaRetry(test.serial, 'store lifecycle 3', async t => {
174
175
  const {
175
176
  v,
176
177
  dispatchMessageSuccessfully,
@@ -211,7 +212,7 @@ test.serial('store lifecycle 3', async t => {
211
212
  });
212
213
 
213
214
  // test 4: lerv -> Lerv -> LERv -> LeRv -> lerv
214
- test.serial('store lifecycle 4', async t => {
215
+ avaRetry(test.serial, 'store lifecycle 4', async t => {
215
216
  const { v, dispatchMessageSuccessfully, dispatchDropExports } =
216
217
  await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
217
218
 
@@ -239,7 +240,7 @@ test.serial('store lifecycle 4', async t => {
239
240
  });
240
241
 
241
242
  // test 5: lerv -> Lerv -> LERv -> LeRv -> Lerv -> lerv
242
- test.serial('store lifecycle 5', async t => {
243
+ avaRetry(test.serial, 'store lifecycle 5', async t => {
243
244
  const {
244
245
  v,
245
246
  dispatchMessageSuccessfully,
@@ -277,7 +278,7 @@ test.serial('store lifecycle 5', async t => {
277
278
  });
278
279
 
279
280
  // test 6: lerv -> Lerv -> LERv -> LeRv -> LeRV -> LeRv -> LeRV -> leRV -> lerv
280
- test.serial('store lifecycle 6', async t => {
281
+ avaRetry(test.serial, 'store lifecycle 6', async t => {
281
282
  const { v, dispatchMessageSuccessfully, dispatchDropExports } =
282
283
  await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
283
284
 
@@ -322,7 +323,7 @@ test.serial('store lifecycle 6', async t => {
322
323
  });
323
324
 
324
325
  // test 7: lerv -> Lerv -> LERv -> lERv -> LERv -> lERv -> lerv
325
- test.serial('store lifecycle 7', async t => {
326
+ avaRetry(test.serial, 'store lifecycle 7', async t => {
326
327
  const { v, dispatchMessageSuccessfully, dispatchDropExports } =
327
328
  await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
328
329
 
@@ -361,7 +362,7 @@ test.serial('store lifecycle 7', async t => {
361
362
  });
362
363
 
363
364
  // test 8: lerv -> Lerv -> LERv -> LERV -> LERv -> LERV -> lERV -> lERv -> lerv
364
- test.serial('store lifecycle 8', async t => {
365
+ avaRetry(test.serial, 'store lifecycle 8', async t => {
365
366
  const { v, dispatchMessageSuccessfully, dispatchDropExports } =
366
367
  await setupTestLiveslots(t, buildRootObject, 'bob', { forceGC: true });
367
368
 
package/test/util.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @param {(d: unknown) => void} [onDispatchCallback ]
3
+ */
4
+ export function buildDispatch(onDispatchCallback?: (d: unknown) => void): {
5
+ log: any[];
6
+ dispatch: (vatDeliverObject: any) => void;
7
+ };
8
+ /**
9
+ * @param {unknown} target
10
+ * @param {string | symbol} method
11
+ * @param {any[]} args
12
+ * @param {unknown} result
13
+ */
14
+ export function makeMessage(target: unknown, method: string | symbol, args?: any[], result?: unknown): unknown[];
15
+ export function makeStartVat(vatParametersCapData?: import("@endo/marshal").CapData<string>): (string | import("@endo/marshal").CapData<string>)[];
16
+ export function makeBringOutYourDead(): string[];
17
+ export function makeResolutions(resolutions: any): any[];
18
+ export function makeResolve(target: any, result: any): any[];
19
+ export function makeReject(target: any, result: any): (string | any[][])[];
20
+ export function makeDropExports(...vrefs: any[]): (string | any[])[];
21
+ export function makeRetireExports(...vrefs: any[]): (string | any[])[];
22
+ export function makeRetireImports(...vrefs: any[]): (string | any[])[];
23
+ export { vstr };
24
+ import { vstr } from './vat-util.js';
25
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["util.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,mDAFW,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI;;;EAwC9B;AAED;;;;;GAKG;AACH,oCALW,OAAO,UACP,MAAM,GAAG,MAAM,SACf,GAAG,EAAE,WACL,OAAO,aAOjB;AAED,mJAEC;AAED,iDAEC;AAED,yDAGC;AAED,6DAGC;AAED,2EAIC;AAED,qEAGC;AAED,uEAGC;AAED,uEAGC;;qBAjGoB,eAAe"}
package/test/util.js CHANGED
@@ -59,8 +59,8 @@ export function makeMessage(target, method, args = [], result = null) {
59
59
  return vatDeliverObject;
60
60
  }
61
61
 
62
- export function makeStartVat(vatParameters) {
63
- return harden(['startVat', vatParameters]);
62
+ export function makeStartVat(vatParametersCapData = kser(undefined)) {
63
+ return harden(['startVat', vatParametersCapData]);
64
64
  }
65
65
 
66
66
  export function makeBringOutYourDead() {
@@ -0,0 +1,9 @@
1
+ export function extractMessage(vatDeliverObject: any): {
2
+ facetID: any;
3
+ method: any;
4
+ args: import("@endo/marshal").CapData<string>;
5
+ result: any;
6
+ };
7
+ export function ignore(p: any): void;
8
+ export function vstr(v: any): string;
9
+ //# sourceMappingURL=vat-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vat-util.d.ts","sourceRoot":"","sources":["vat-util.js"],"names":[],"mappings":"AAMA;;;;;EAQC;AAED,qCAKC;AAEM,qCAAyC"}