@agoric/base-zone 0.1.1-dev-eb7e9eb.0 → 0.1.1-dev-3ce0599.0
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 +6 -3
- package/test/prepare-test-env-ava.js +0 -1
- package/tools/greeter.js +8 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/base-zone",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-3ce0599.0+3ce0599",
|
|
4
4
|
"description": "Allocation zone abstraction library and heap implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/Agoric/agoric-sdk",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"author": "Agoric",
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@agoric/store": "0.9.3-dev-
|
|
29
|
+
"@agoric/store": "0.9.3-dev-3ce0599.0+3ce0599",
|
|
30
30
|
"@endo/exo": "^0.2.3",
|
|
31
31
|
"@endo/far": "^0.2.19",
|
|
32
32
|
"@endo/pass-style": "^0.1.4",
|
|
@@ -46,8 +46,11 @@
|
|
|
46
46
|
"files": [
|
|
47
47
|
"test/**/test-*.js"
|
|
48
48
|
],
|
|
49
|
+
"require": [
|
|
50
|
+
"@endo/init/debug.js"
|
|
51
|
+
],
|
|
49
52
|
"timeout": "20m",
|
|
50
53
|
"workerThreads": false
|
|
51
54
|
},
|
|
52
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "3ce0599d5173b802598b5bedf57d3c30f016f789"
|
|
53
56
|
}
|
package/tools/greeter.js
CHANGED
|
@@ -5,7 +5,7 @@ export const bindAllMethodsTo = (obj, that = obj) =>
|
|
|
5
5
|
Object.entries(obj).map(([name, fn]) => [name, fn.bind(that)]),
|
|
6
6
|
);
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const GreeterI = M.interface('Greeter', {
|
|
9
9
|
greet: M.call().optional(M.string()).returns(M.string()),
|
|
10
10
|
});
|
|
11
11
|
export const greetFacet = {
|
|
@@ -14,7 +14,7 @@ export const greetFacet = {
|
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export const
|
|
17
|
+
export const GreeterAdminI = M.interface('GreeterAdmin', {
|
|
18
18
|
setNick: M.call(M.string()).returns(),
|
|
19
19
|
});
|
|
20
20
|
export const adminFacet = {
|
|
@@ -23,21 +23,21 @@ export const adminFacet = {
|
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export const
|
|
27
|
-
...
|
|
28
|
-
...
|
|
26
|
+
export const GreeterWithAdminI = M.interface('GreeterWithAdmin', {
|
|
27
|
+
...GreeterI.methodGuards,
|
|
28
|
+
...GreeterAdminI.methodGuards,
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
export const prepareGreeterSingleton = (zone, label, nick) => {
|
|
32
32
|
const myThis = Object.freeze({ state: { nick } });
|
|
33
|
-
return zone.exo(label,
|
|
33
|
+
return zone.exo(label, GreeterWithAdminI, {
|
|
34
34
|
...bindAllMethodsTo(greetFacet, myThis),
|
|
35
35
|
...bindAllMethodsTo(adminFacet, myThis),
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export const prepareGreeter = zone =>
|
|
40
|
-
zone.exoClass('Greeter',
|
|
40
|
+
zone.exoClass('Greeter', GreeterWithAdminI, nick => ({ nick }), {
|
|
41
41
|
...greetFacet,
|
|
42
42
|
...adminFacet,
|
|
43
43
|
});
|
|
@@ -45,7 +45,7 @@ export const prepareGreeter = zone =>
|
|
|
45
45
|
export const prepareGreeterKit = zone =>
|
|
46
46
|
zone.exoClassKit(
|
|
47
47
|
'GreeterKit',
|
|
48
|
-
{ greeter:
|
|
48
|
+
{ greeter: GreeterI, admin: GreeterAdminI },
|
|
49
49
|
nick => ({ nick }),
|
|
50
50
|
{
|
|
51
51
|
greeter: greetFacet,
|