@agoric/zone 0.2.3-other-dev-fbe72e7.0.fbe72e7 → 0.2.3-other-dev-d15096d.0.d15096d
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.
- package/package.json +5 -5
- package/src/durable.d.ts +2 -1
- package/src/durable.d.ts.map +1 -1
- package/src/durable.js +7 -5
- package/src/virtual.d.ts +2 -1
- package/src/virtual.d.ts.map +1 -1
- package/src/virtual.js +10 -6
- package/test/exos.test.js +5 -1
- package/test/make-once.test.js +5 -2
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/zone",
|
|
3
|
-
"version": "0.2.3-other-dev-
|
|
3
|
+
"version": "0.2.3-other-dev-d15096d.0.d15096d",
|
|
4
4
|
"description": "Allocation zone abstraction for objects on the heap, persistent stores, etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/Agoric/agoric-sdk",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"author": "Agoric",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agoric/base-zone": "0.1.1-other-dev-
|
|
31
|
-
"@agoric/vat-data": "0.5.3-other-dev-
|
|
30
|
+
"@agoric/base-zone": "0.1.1-other-dev-d15096d.0.d15096d",
|
|
31
|
+
"@agoric/vat-data": "0.5.3-other-dev-d15096d.0.d15096d",
|
|
32
32
|
"@endo/errors": "^1.2.13",
|
|
33
33
|
"@endo/far": "^1.1.14",
|
|
34
34
|
"@endo/pass-style": "^1.6.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@agoric/swingset-vat": "0.32.3-other-dev-
|
|
37
|
+
"@agoric/swingset-vat": "0.32.3-other-dev-d15096d.0.d15096d",
|
|
38
38
|
"@endo/patterns": "^1.7.0",
|
|
39
39
|
"ava": "^5.3.0"
|
|
40
40
|
},
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"typeCoverage": {
|
|
58
58
|
"atLeast": 94
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "d15096dc4ff8b96e9b6cd11954c20d3a9efbb393"
|
|
61
61
|
}
|
package/src/durable.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export function makeDurableZone(baggage:
|
|
1
|
+
export function makeDurableZone(baggage: Baggage, baseLabel?: string): Zone;
|
|
2
|
+
import type { Baggage } from '@agoric/swingset-liveslots';
|
|
2
3
|
import type { Zone } from './index.js';
|
|
3
4
|
//# sourceMappingURL=durable.d.ts.map
|
package/src/durable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable.d.ts","sourceRoot":"","sources":["durable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"durable.d.ts","sourceRoot":"","sources":["durable.js"],"names":[],"mappings":"AA+EO,yCAJI,OAAO,cACP,MAAM,GACJ,IAAI,CA+ChB;6BApGyB,4BAA4B;0BAF/B,YAAY"}
|
package/src/durable.js
CHANGED
|
@@ -21,6 +21,8 @@ import { agoricVatDataKeys as keys, makeOnceKit } from '@agoric/base-zone';
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @import {Zone} from './index.js';
|
|
24
|
+
* @import {Stores} from './index.js';
|
|
25
|
+
* @import {Baggage} from '@agoric/swingset-liveslots';
|
|
24
26
|
*/
|
|
25
27
|
|
|
26
28
|
/**
|
|
@@ -33,7 +35,7 @@ const isStorable = specimen => isPassable(specimen) && canBeDurable(specimen);
|
|
|
33
35
|
harden(isStorable);
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
|
-
* @param {() =>
|
|
38
|
+
* @param {() => Baggage} getBaggage
|
|
37
39
|
*/
|
|
38
40
|
const attachDurableStores = getBaggage => {
|
|
39
41
|
/** @type {Zone['mapStore']} */
|
|
@@ -52,7 +54,7 @@ const attachDurableStores = getBaggage => {
|
|
|
52
54
|
const weakMapStore = (label, options) =>
|
|
53
55
|
provideDurableWeakMapStore(getBaggage(), label, options);
|
|
54
56
|
|
|
55
|
-
/** @type {
|
|
57
|
+
/** @type {Stores} */
|
|
56
58
|
return Far('durableStores', {
|
|
57
59
|
detached: () => detachedDurableStores,
|
|
58
60
|
isStorable,
|
|
@@ -63,7 +65,7 @@ const attachDurableStores = getBaggage => {
|
|
|
63
65
|
});
|
|
64
66
|
};
|
|
65
67
|
|
|
66
|
-
/** @type {
|
|
68
|
+
/** @type {Stores} */
|
|
67
69
|
const detachedDurableStores = attachDurableStores(() =>
|
|
68
70
|
makeScalarMapStore('detached'),
|
|
69
71
|
);
|
|
@@ -71,7 +73,7 @@ const detachedDurableStores = attachDurableStores(() =>
|
|
|
71
73
|
/**
|
|
72
74
|
* Create a zone whose objects persist between Agoric vat upgrades.
|
|
73
75
|
*
|
|
74
|
-
* @param {
|
|
76
|
+
* @param {Baggage} baggage
|
|
75
77
|
* @param {string} [baseLabel]
|
|
76
78
|
* @returns {Zone}
|
|
77
79
|
*/
|
|
@@ -99,7 +101,7 @@ export const makeDurableZone = (baggage, baseLabel = 'durableZone') => {
|
|
|
99
101
|
|
|
100
102
|
/** @type {Zone['subZone']} */
|
|
101
103
|
const subZone = (label, options = {}) => {
|
|
102
|
-
/** @type {
|
|
104
|
+
/** @type {Baggage} */
|
|
103
105
|
const subBaggage = subZoneStore(label, options);
|
|
104
106
|
return makeDurableZone(subBaggage, `${baseLabel}.${label}`);
|
|
105
107
|
};
|
package/src/virtual.d.ts
CHANGED
package/src/virtual.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["virtual.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"virtual.d.ts","sourceRoot":"","sources":["virtual.js"],"names":[],"mappings":"AAqEO,4CAHI,MAAM,GACJ,IAAI,CA+BhB;0BA9EsB,YAAY"}
|
package/src/virtual.js
CHANGED
|
@@ -17,6 +17,12 @@ import {
|
|
|
17
17
|
watchPromise,
|
|
18
18
|
} from '@agoric/base-zone';
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @import {Zone} from './index.js';
|
|
22
|
+
* @import {DefineKindOptions} from '@agoric/vat-data';
|
|
23
|
+
* @import {Stores} from './index.js';
|
|
24
|
+
*/
|
|
25
|
+
|
|
20
26
|
const emptyRecord = harden({});
|
|
21
27
|
const initEmpty = harden(() => emptyRecord);
|
|
22
28
|
|
|
@@ -24,7 +30,7 @@ const initEmpty = harden(() => emptyRecord);
|
|
|
24
30
|
* This implementation of `defineVirtualExo` only exists to ensure there are no
|
|
25
31
|
* gaps in the virtualZone API.
|
|
26
32
|
*
|
|
27
|
-
* @type {
|
|
33
|
+
* @type {Zone['exo']}
|
|
28
34
|
*/
|
|
29
35
|
const makeVirtualExo = (
|
|
30
36
|
label,
|
|
@@ -33,9 +39,7 @@ const makeVirtualExo = (
|
|
|
33
39
|
options = undefined,
|
|
34
40
|
) => {
|
|
35
41
|
const defineKindOptions =
|
|
36
|
-
/** @type {
|
|
37
|
-
options
|
|
38
|
-
);
|
|
42
|
+
/** @type {DefineKindOptions<{ self: typeof methods }>} */ (options);
|
|
39
43
|
const makeInstance = defineVirtualExoClass(
|
|
40
44
|
label,
|
|
41
45
|
interfaceGuard,
|
|
@@ -46,7 +50,7 @@ const makeVirtualExo = (
|
|
|
46
50
|
return makeInstance();
|
|
47
51
|
};
|
|
48
52
|
|
|
49
|
-
/** @type {
|
|
53
|
+
/** @type {Stores} */
|
|
50
54
|
const detachedVirtualStores = Far('virtualStores', {
|
|
51
55
|
detached: () => detachedVirtualStores,
|
|
52
56
|
isStorable: isPassable,
|
|
@@ -61,7 +65,7 @@ const detachedVirtualStores = Far('virtualStores', {
|
|
|
61
65
|
* current vat.
|
|
62
66
|
*
|
|
63
67
|
* @param {string} [baseLabel]
|
|
64
|
-
* @returns {
|
|
68
|
+
* @returns {Zone}
|
|
65
69
|
*/
|
|
66
70
|
export const makeVirtualZone = (baseLabel = 'virtualZone') => {
|
|
67
71
|
const { makeOnce, wrapProvider } = makeOnceKit(
|
package/test/exos.test.js
CHANGED
|
@@ -22,7 +22,11 @@ import { makeHeapZone } from '../heap.js';
|
|
|
22
22
|
import { makeVirtualZone } from '../virtual.js';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* @
|
|
25
|
+
* @import {Assertions} from 'ava';
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {Assertions} t
|
|
26
30
|
* @param {MapStore} baggage
|
|
27
31
|
*/
|
|
28
32
|
const testFirstVatDataIncarnation = (t, baggage) => {
|
package/test/make-once.test.js
CHANGED
|
@@ -9,10 +9,13 @@ import { makeDurableZone } from '../durable.js';
|
|
|
9
9
|
import { makeHeapZone } from '../heap.js';
|
|
10
10
|
import { makeVirtualZone } from '../virtual.js';
|
|
11
11
|
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @import {Zone} from '../src/index.js'
|
|
14
|
+
* @import {Assertions} from 'ava';
|
|
15
|
+
*/
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
|
-
* @param {
|
|
18
|
+
* @param {Assertions} t
|
|
16
19
|
* @param {Zone} rootZone
|
|
17
20
|
*/
|
|
18
21
|
const testOnce = (t, rootZone) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./durable.js","./heap.js","./virtual.js","./src/durable.js","./src/index.js","./src/virtual.js"],"version":"5.9.
|
|
1
|
+
{"root":["./durable.js","./heap.js","./virtual.js","./src/durable.js","./src/index.js","./src/virtual.js"],"version":"5.9.3"}
|