@agoric/vats 0.15.2-dev-745f2a8.0 → 0.15.2-dev-ca25dd5.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-745f2a8.0+745f2a8",
3
+ "version": "0.15.2-dev-ca25dd5.0+ca25dd5",
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-745f2a8.0+745f2a8",
26
- "@agoric/ertp": "0.16.3-dev-745f2a8.0+745f2a8",
27
- "@agoric/governance": "0.10.4-dev-745f2a8.0+745f2a8",
28
- "@agoric/internal": "0.3.3-dev-745f2a8.0+745f2a8",
29
- "@agoric/network": "0.1.1-dev-745f2a8.0+745f2a8",
30
- "@agoric/notifier": "0.6.3-dev-745f2a8.0+745f2a8",
31
- "@agoric/store": "0.9.3-dev-745f2a8.0+745f2a8",
32
- "@agoric/swingset-vat": "0.32.3-dev-745f2a8.0+745f2a8",
33
- "@agoric/time": "0.3.3-dev-745f2a8.0+745f2a8",
34
- "@agoric/vat-data": "0.5.3-dev-745f2a8.0+745f2a8",
35
- "@agoric/vow": "0.1.1-dev-745f2a8.0+745f2a8",
36
- "@agoric/zoe": "0.26.3-dev-745f2a8.0+745f2a8",
37
- "@agoric/zone": "0.2.3-dev-745f2a8.0+745f2a8",
25
+ "@agoric/cosmic-proto": "0.4.1-dev-ca25dd5.0+ca25dd5",
26
+ "@agoric/ertp": "0.16.3-dev-ca25dd5.0+ca25dd5",
27
+ "@agoric/governance": "0.10.4-dev-ca25dd5.0+ca25dd5",
28
+ "@agoric/internal": "0.3.3-dev-ca25dd5.0+ca25dd5",
29
+ "@agoric/network": "0.1.1-dev-ca25dd5.0+ca25dd5",
30
+ "@agoric/notifier": "0.6.3-dev-ca25dd5.0+ca25dd5",
31
+ "@agoric/store": "0.9.3-dev-ca25dd5.0+ca25dd5",
32
+ "@agoric/swingset-vat": "0.32.3-dev-ca25dd5.0+ca25dd5",
33
+ "@agoric/time": "0.3.3-dev-ca25dd5.0+ca25dd5",
34
+ "@agoric/vat-data": "0.5.3-dev-ca25dd5.0+ca25dd5",
35
+ "@agoric/vow": "0.1.1-dev-ca25dd5.0+ca25dd5",
36
+ "@agoric/zoe": "0.26.3-dev-ca25dd5.0+ca25dd5",
37
+ "@agoric/zone": "0.2.3-dev-ca25dd5.0+ca25dd5",
38
38
  "@endo/errors": "^1.2.8",
39
39
  "@endo/far": "^1.1.9",
40
40
  "@endo/import-bundle": "^1.3.2",
@@ -47,7 +47,7 @@
47
47
  "jessie.js": "^0.3.4"
48
48
  },
49
49
  "devDependencies": {
50
- "@agoric/swingset-liveslots": "0.10.3-dev-745f2a8.0+745f2a8",
50
+ "@agoric/swingset-liveslots": "0.10.3-dev-ca25dd5.0+ca25dd5",
51
51
  "@endo/bundle-source": "^3.5.0",
52
52
  "@endo/init": "^1.1.7",
53
53
  "ava": "^5.3.0",
@@ -79,5 +79,5 @@
79
79
  "typeCoverage": {
80
80
  "atLeast": 91.21
81
81
  },
82
- "gitHead": "745f2a82cc94e246f98dd1bd69cb679b608a7170"
82
+ "gitHead": "ca25dd59f43f27451fad685207086a9be87860c7"
83
83
  }
@@ -0,0 +1,28 @@
1
+ export function upgradePSMProposal({ consume: { psmKit: psmKitP, economicCommitteeCreatorFacet: electorateCreatorFacet, instancePrivateArgs: instancePrivateArgsP, }, }: BootstrapPowers & {
2
+ consume: {
3
+ economicCommitteeCreatorFacet: any;
4
+ psmKit: any;
5
+ };
6
+ }, options: {
7
+ options: {
8
+ psmRef: VatSourceRef;
9
+ };
10
+ }): Promise<void>;
11
+ export function getManifestForUpgradingPSM(_powers: any, { psmRef }: {
12
+ psmRef: any;
13
+ }): {
14
+ manifest: {
15
+ [x: string]: {
16
+ consume: {
17
+ psmKit: boolean;
18
+ economicCommitteeCreatorFacet: boolean;
19
+ instancePrivateArgs: boolean;
20
+ };
21
+ produce: {};
22
+ };
23
+ };
24
+ options: {
25
+ psmRef: any;
26
+ };
27
+ };
28
+ //# sourceMappingURL=upgrade-psm-proposal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-psm-proposal.d.ts","sourceRoot":"","sources":["upgrade-psm-proposal.js"],"names":[],"mappings":"AAkBO,yKAXI,eAAe,GAAG;IACxB,OAAO,EAAE;QACP,6BAA6B,EAAE,GAAG,CAAC;QACnC,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;CACH,WAED;IAEW,OAAO,EAFV;QACN,MAAM,EAAE,YAAY,CAAC;KACtB;CACH,iBA0CA;AAEM;;;;;;;;;;;;;;;;EAYL"}
@@ -0,0 +1,74 @@
1
+ import { E } from '@endo/far';
2
+ import { deeplyFulfilled } from '@endo/marshal';
3
+ import { makeTracer } from '@agoric/internal';
4
+
5
+ const trace = makeTracer('UpgradePSM');
6
+
7
+ /**
8
+ * @param {BootstrapPowers & {
9
+ * consume: {
10
+ * economicCommitteeCreatorFacet: any;
11
+ * psmKit: any;
12
+ * };
13
+ * }} powers
14
+ * @param {object} options
15
+ * @param {{
16
+ * psmRef: VatSourceRef;
17
+ * }} options.options
18
+ */
19
+ export const upgradePSMProposal = async (
20
+ {
21
+ consume: {
22
+ psmKit: psmKitP,
23
+ economicCommitteeCreatorFacet: electorateCreatorFacet,
24
+ instancePrivateArgs: instancePrivateArgsP,
25
+ },
26
+ },
27
+ options,
28
+ ) => {
29
+ const { psmRef } = options.options;
30
+
31
+ trace(`PSM BUNDLE ID: `, psmRef);
32
+
33
+ const [psmKitMap, instancePrivateArgs] = await Promise.all([
34
+ psmKitP,
35
+ instancePrivateArgsP,
36
+ ]);
37
+
38
+ for (const { psm, psmAdminFacet, label } of psmKitMap.values()) {
39
+ const [originalPrivateArgs, poserInvitation] = await Promise.all([
40
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
41
+ // @ts-ignore Local tsc sees this as an error but typedoc does not
42
+ deeplyFulfilled(instancePrivateArgs.get(psm)),
43
+ E(electorateCreatorFacet).getPoserInvitation(),
44
+ ]);
45
+
46
+ const newPrivateArgs = harden({
47
+ ...originalPrivateArgs,
48
+ initialPoserInvitation: poserInvitation,
49
+ });
50
+
51
+ const upgradeResult = await E(psmAdminFacet).upgradeContract(
52
+ psmRef.bundleID,
53
+ newPrivateArgs,
54
+ );
55
+
56
+ trace(`PSM ${label} upgraded: `, upgradeResult);
57
+ }
58
+
59
+ trace('Done.');
60
+ };
61
+
62
+ export const getManifestForUpgradingPSM = (_powers, { psmRef }) => ({
63
+ manifest: {
64
+ [upgradePSMProposal.name]: {
65
+ consume: {
66
+ psmKit: true,
67
+ economicCommitteeCreatorFacet: true,
68
+ instancePrivateArgs: true,
69
+ },
70
+ produce: {},
71
+ },
72
+ },
73
+ options: { psmRef },
74
+ });