@agoric/vats 0.15.2-dev-fbea810.0 → 0.15.2-dev-70e543c.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/vats",
|
|
3
|
-
"version": "0.15.2-dev-
|
|
3
|
+
"version": "0.15.2-dev-70e543c.0+70e543c",
|
|
4
4
|
"description": "Agoric's Vat library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"author": "Agoric",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
26
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
27
|
-
"@agoric/governance": "0.10.4-dev-
|
|
28
|
-
"@agoric/internal": "0.3.3-dev-
|
|
29
|
-
"@agoric/network": "0.1.1-dev-
|
|
30
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
31
|
-
"@agoric/store": "0.9.3-dev-
|
|
32
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
33
|
-
"@agoric/time": "0.3.3-dev-
|
|
34
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
35
|
-
"@agoric/vow": "0.1.1-dev-
|
|
36
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
37
|
-
"@agoric/zone": "0.2.3-dev-
|
|
25
|
+
"@agoric/cosmic-proto": "0.4.1-dev-70e543c.0+70e543c",
|
|
26
|
+
"@agoric/ertp": "0.16.3-dev-70e543c.0+70e543c",
|
|
27
|
+
"@agoric/governance": "0.10.4-dev-70e543c.0+70e543c",
|
|
28
|
+
"@agoric/internal": "0.3.3-dev-70e543c.0+70e543c",
|
|
29
|
+
"@agoric/network": "0.1.1-dev-70e543c.0+70e543c",
|
|
30
|
+
"@agoric/notifier": "0.6.3-dev-70e543c.0+70e543c",
|
|
31
|
+
"@agoric/store": "0.9.3-dev-70e543c.0+70e543c",
|
|
32
|
+
"@agoric/swingset-vat": "0.32.3-dev-70e543c.0+70e543c",
|
|
33
|
+
"@agoric/time": "0.3.3-dev-70e543c.0+70e543c",
|
|
34
|
+
"@agoric/vat-data": "0.5.3-dev-70e543c.0+70e543c",
|
|
35
|
+
"@agoric/vow": "0.1.1-dev-70e543c.0+70e543c",
|
|
36
|
+
"@agoric/zoe": "0.26.3-dev-70e543c.0+70e543c",
|
|
37
|
+
"@agoric/zone": "0.2.3-dev-70e543c.0+70e543c",
|
|
38
38
|
"@endo/errors": "^1.2.10",
|
|
39
39
|
"@endo/far": "^1.1.11",
|
|
40
40
|
"@endo/import-bundle": "^1.4.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"jessie.js": "^0.3.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
50
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-70e543c.0+70e543c",
|
|
51
51
|
"@endo/bundle-source": "^4.0.0",
|
|
52
52
|
"@endo/init": "^1.1.9",
|
|
53
53
|
"ava": "^5.3.0",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"typeCoverage": {
|
|
80
80
|
"atLeast": 90.43
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "70e543c8f952246ab36454f8f04ea2589f401d2f"
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminate-governed-instance.d.ts","sourceRoot":"","sources":["terminate-governed-instance.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminate-governed-instance.d.ts","sourceRoot":"","sources":["terminate-governed-instance.js"],"names":[],"mappings":"AA2EO,qFAPI,eAAe,qCAEvB;IAAuB,OAAO,EAC9B;QAAiC,gBAAgB,EAAzC,MAAM,EAAE;KAGlB;CAAA,iBA+GA;AAUM,qCAHI,MAAM,oBACN,MAAM,EAAE;;QAMb,CAAC,iBAAiB,CAAC,IAAI,CAAC;;;;;;UAEvB;;;;;EAMN;AAED,2FAA2F;AAC3F,qCADW,OAAO,oDAAoD,EAAE,eAAe,CAYrF;yBAGoB,uFAAK,EAAE,gGAAU"}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// dynamic import { getSpecifier } from '@agoric/internal/src/module-utils.js';
|
|
15
15
|
import { E, passStyleOf } from '@endo/far';
|
|
16
16
|
import { makeTracer } from '@agoric/internal/src/debug.js';
|
|
17
|
+
import { isAbandonedError } from '@agoric/internal/src/upgrade-api.js';
|
|
17
18
|
|
|
18
19
|
const USAGE = `Usage: agoric run /path/to/terminate-governed-instance.js \\
|
|
19
20
|
<$instanceHandleBoardID:$instanceKitLabel>...`;
|
|
@@ -97,14 +98,36 @@ export const terminateGoverned = async (
|
|
|
97
98
|
label === instanceKitLabel ||
|
|
98
99
|
Fail`${logLabel} unexpected instanceKit label, got ${label} but wanted ${q(instanceKitLabel)}`;
|
|
99
100
|
const govTerms = /** @type {any} */ (await E(zoe).getTerms(governor));
|
|
100
|
-
trace(
|
|
101
|
+
trace('governor terms', govTerms);
|
|
101
102
|
(passStyleOf(govTerms?.governed) === 'copyRecord' &&
|
|
102
103
|
passStyleOf(govTerms?.governedContractInstallation) === 'remotable') ||
|
|
103
104
|
Fail`${logLabel} instanceKit governor does not appear to have the right terms shape`;
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
// We need an adminFacet for the contract instance. Prefer to get it from
|
|
107
|
+
// the governor, but fall back on extracting it from the kit if the
|
|
108
|
+
// governor has already been terminated.
|
|
109
|
+
let { adminFacet: instanceAdminFacet } = instanceKit;
|
|
110
|
+
let governorOk = true;
|
|
111
|
+
try {
|
|
112
|
+
instanceAdminFacet = await E(governorCreatorFacet).getAdminFacet();
|
|
113
|
+
} catch (err) {
|
|
114
|
+
if (!isAbandonedError(err)) throw err;
|
|
115
|
+
governorOk = false;
|
|
116
|
+
}
|
|
117
|
+
trace(
|
|
118
|
+
governorOk
|
|
119
|
+
? 'instance adminFacet from governor'
|
|
120
|
+
: 'instance adminFacet from kit',
|
|
121
|
+
instanceAdminFacet,
|
|
122
|
+
);
|
|
123
|
+
instanceAdminFacet ||
|
|
124
|
+
Fail`${logLabel} instanceKit is missing the instance admin facet`;
|
|
125
|
+
return {
|
|
126
|
+
logLabel,
|
|
127
|
+
trace,
|
|
128
|
+
instanceAdminFacet,
|
|
129
|
+
governorAdminFacet: governorOk ? governorAdminFacet : undefined,
|
|
130
|
+
};
|
|
108
131
|
}),
|
|
109
132
|
);
|
|
110
133
|
const validationProblems = targets.flatMap(
|
|
@@ -129,17 +152,20 @@ export const terminateGoverned = async (
|
|
|
129
152
|
assert(settlement.status === 'fulfilled');
|
|
130
153
|
const { logLabel, trace, instanceAdminFacet, governorAdminFacet } =
|
|
131
154
|
settlement.value;
|
|
155
|
+
|
|
132
156
|
const terminateInstanceMessage = `governed contract ${logLabel} terminated by terminate-governed-instance`;
|
|
133
157
|
await E(instanceAdminFacet).terminateContract(
|
|
134
158
|
harden(Error(terminateInstanceMessage)),
|
|
135
159
|
);
|
|
136
160
|
trace('terminated governed instance');
|
|
137
161
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
162
|
+
if (governorAdminFacet) {
|
|
163
|
+
const terminateGovernorMessage = `governor ${logLabel} terminated by terminate-governed-instance`;
|
|
164
|
+
await E(governorAdminFacet).terminateContract(
|
|
165
|
+
harden(Error(terminateGovernorMessage)),
|
|
166
|
+
);
|
|
167
|
+
trace('terminated governor');
|
|
168
|
+
}
|
|
143
169
|
}),
|
|
144
170
|
);
|
|
145
171
|
const terminationProblems = targets.flatMap(
|