@agoric/inter-protocol 0.16.2-dev-1ac26b7.0 → 0.16.2-dev-4a33acc.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/inter-protocol",
3
- "version": "0.16.2-dev-1ac26b7.0+1ac26b7",
3
+ "version": "0.16.2-dev-4a33acc.0+4a33acc",
4
4
  "description": "Core cryptoeconomy contracts",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -31,15 +31,15 @@
31
31
  },
32
32
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
33
33
  "dependencies": {
34
- "@agoric/ertp": "0.16.3-dev-1ac26b7.0+1ac26b7",
35
- "@agoric/governance": "0.10.4-dev-1ac26b7.0+1ac26b7",
36
- "@agoric/internal": "0.3.3-dev-1ac26b7.0+1ac26b7",
37
- "@agoric/notifier": "0.6.3-dev-1ac26b7.0+1ac26b7",
38
- "@agoric/store": "0.9.3-dev-1ac26b7.0+1ac26b7",
39
- "@agoric/time": "0.3.3-dev-1ac26b7.0+1ac26b7",
40
- "@agoric/vat-data": "0.5.3-dev-1ac26b7.0+1ac26b7",
41
- "@agoric/vats": "0.15.2-dev-1ac26b7.0+1ac26b7",
42
- "@agoric/zoe": "0.26.3-dev-1ac26b7.0+1ac26b7",
34
+ "@agoric/ertp": "0.16.3-dev-4a33acc.0+4a33acc",
35
+ "@agoric/governance": "0.10.4-dev-4a33acc.0+4a33acc",
36
+ "@agoric/internal": "0.3.3-dev-4a33acc.0+4a33acc",
37
+ "@agoric/notifier": "0.6.3-dev-4a33acc.0+4a33acc",
38
+ "@agoric/store": "0.9.3-dev-4a33acc.0+4a33acc",
39
+ "@agoric/time": "0.3.3-dev-4a33acc.0+4a33acc",
40
+ "@agoric/vat-data": "0.5.3-dev-4a33acc.0+4a33acc",
41
+ "@agoric/vats": "0.15.2-dev-4a33acc.0+4a33acc",
42
+ "@agoric/zoe": "0.26.3-dev-4a33acc.0+4a33acc",
43
43
  "@endo/captp": "^4.4.0",
44
44
  "@endo/errors": "^1.2.6",
45
45
  "@endo/eventual-send": "^1.2.6",
@@ -50,10 +50,10 @@
50
50
  "jessie.js": "^0.3.4"
51
51
  },
52
52
  "devDependencies": {
53
- "@agoric/smart-wallet": "0.5.4-dev-1ac26b7.0+1ac26b7",
54
- "@agoric/swingset-liveslots": "0.10.3-dev-1ac26b7.0+1ac26b7",
55
- "@agoric/swingset-vat": "0.32.3-dev-1ac26b7.0+1ac26b7",
56
- "@agoric/zone": "0.2.3-dev-1ac26b7.0+1ac26b7",
53
+ "@agoric/smart-wallet": "0.5.4-dev-4a33acc.0+4a33acc",
54
+ "@agoric/swingset-liveslots": "0.10.3-dev-4a33acc.0+4a33acc",
55
+ "@agoric/swingset-vat": "0.32.3-dev-4a33acc.0+4a33acc",
56
+ "@agoric/zone": "0.2.3-dev-4a33acc.0+4a33acc",
57
57
  "@endo/bundle-source": "^3.4.1",
58
58
  "@endo/init": "^1.1.5",
59
59
  "@endo/promise-kit": "^1.1.6",
@@ -84,5 +84,5 @@
84
84
  "typeCoverage": {
85
85
  "atLeast": 95.8
86
86
  },
87
- "gitHead": "1ac26b7835bb832d23a967e057c15d0d358d3a5d"
87
+ "gitHead": "4a33accaeeba27044ab07dd04f64226de1b77759"
88
88
  }
@@ -1,4 +1,11 @@
1
- export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, econCharterKit, priceAuthority8400, zoe, }, produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance }, instance: { consume: { reserve: reserveInstance }, produce: { auctioneer: auctionInstance }, }, installation: { consume: { auctioneer: auctioneerInstallationP, contractGovernor: governorInstallationP, }, }, issuer: { consume: { [Stable.symbol]: stableIssuerP }, }, }: import("./econ-behaviors.js").EconomyBootstrapPowers & interlockPowers): Promise<void>;
1
+ export function addAuction({ consume: { agoricNamesAdmin, auctioneerKit: legacyKitP, board, chainStorage, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, econCharterKit, priceAuthority8400, zoe, }, produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance, newContractGovBundleId, }, instance: { consume: { reserve: reserveInstance }, produce: { auctioneer: auctionInstance }, }, installation: { consume: { auctioneer: auctioneerInstallationP }, }, issuer: { consume: { [Stable.symbol]: stableIssuerP }, }, }: import("./econ-behaviors.js").EconomyBootstrapPowers & interlockPowers, { options: { contractGovernorRef: contractGovernorBundle, contractGovernorInstallation, }, }: {
2
+ options: {
3
+ contractGovernorRef: {
4
+ bundleID: string;
5
+ };
6
+ contractGovernorInstallation: Installation;
7
+ };
8
+ }): Promise<void>;
2
9
  export const ADD_AUCTION_MANIFEST: {
3
10
  [x: string]: {
4
11
  consume: {
@@ -15,6 +22,7 @@ export const ADD_AUCTION_MANIFEST: {
15
22
  produce: {
16
23
  auctioneerKit: boolean;
17
24
  auctionUpgradeNewInstance: boolean;
25
+ newContractGovBundleId: boolean;
18
26
  };
19
27
  instance: {
20
28
  consume: {
@@ -56,6 +64,7 @@ export function getManifestForAddAuction({ restoreRef }: {
56
64
  produce: {
57
65
  auctioneerKit: boolean;
58
66
  auctionUpgradeNewInstance: boolean;
67
+ newContractGovBundleId: boolean;
59
68
  };
60
69
  instance: {
61
70
  consume: {
@@ -79,8 +88,8 @@ export function getManifestForAddAuction({ restoreRef }: {
79
88
  };
80
89
  };
81
90
  options: {
82
- auctioneerRef: any;
83
91
  contractGovernorRef: any;
92
+ contractGovernorInstallation: any;
84
93
  };
85
94
  installations: {
86
95
  auctioneer: any;
@@ -89,6 +98,7 @@ export function getManifestForAddAuction({ restoreRef }: {
89
98
  }>;
90
99
  export type interlockPowers = PromiseSpaceOf<{
91
100
  auctionUpgradeNewInstance: Instance;
101
+ newContractGovBundleId: string;
92
102
  }>;
93
103
  import { Stable } from '@agoric/internal/src/tokens.js';
94
104
  //# sourceMappingURL=add-auction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-auction.d.ts","sourceRoot":"","sources":["add-auction.js"],"names":[],"mappings":"AAkBO,yjBAHI,OAAO,qBAAqB,EAAE,sBAAsB,GAC1D,eAAe,iBAqKnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BG;AASI,yDAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,0CAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAcb;8BA/NY,cAAc,CAAC;IACvB,yBAAyB,EAAE,QAAQ,CAAC;CACrC,CAAC;uBARkB,gCAAgC"}
1
+ {"version":3,"file":"add-auction.d.ts","sourceRoot":"","sources":["add-auction.js"],"names":[],"mappings":"AAyBO,wiBATI,OAAO,qBAAqB,EAAE,sBAAsB,GAC1D,eAAe,gGACT;IACN,OAAO,EAAE;QACP,mBAAmB,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1C,4BAA4B,EAAE,YAAY,CAAC;KAC5C,CAAC;CACH,iBAkLH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BG;AASI,yDAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,0CAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBb;8BAvPY,cAAc,CAAC;IACvB,yBAAyB,EAAE,QAAQ,CAAC;IACpC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;uBATkB,gCAAgC"}
@@ -9,40 +9,56 @@ const trace = makeTracer('NewAuction', true);
9
9
  /**
10
10
  * @typedef {PromiseSpaceOf<{
11
11
  * auctionUpgradeNewInstance: Instance;
12
+ * newContractGovBundleId: string;
12
13
  * }>} interlockPowers
13
14
  */
14
15
 
15
16
  /**
16
17
  * @param {import('./econ-behaviors.js').EconomyBootstrapPowers &
17
18
  * interlockPowers} powers
19
+ * @param {{
20
+ * options: {
21
+ * contractGovernorRef: { bundleID: string };
22
+ * contractGovernorInstallation: Installation;
23
+ * };
24
+ * }} options
18
25
  */
19
- export const addAuction = async ({
20
- consume: {
21
- agoricNamesAdmin,
22
- auctioneerKit: legacyKitP,
23
- board,
24
- chainStorage,
25
- chainTimerService,
26
- economicCommitteeCreatorFacet: electorateCreatorFacet,
27
- econCharterKit,
28
- priceAuthority8400,
29
- zoe,
30
- },
31
- produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance },
32
- instance: {
33
- consume: { reserve: reserveInstance },
34
- produce: { auctioneer: auctionInstance },
35
- },
36
- installation: {
26
+ export const addAuction = async (
27
+ {
37
28
  consume: {
38
- auctioneer: auctioneerInstallationP,
39
- contractGovernor: governorInstallationP,
29
+ agoricNamesAdmin,
30
+ auctioneerKit: legacyKitP,
31
+ board,
32
+ chainStorage,
33
+ chainTimerService,
34
+ economicCommitteeCreatorFacet: electorateCreatorFacet,
35
+ econCharterKit,
36
+ priceAuthority8400,
37
+ zoe,
38
+ },
39
+ produce: {
40
+ auctioneerKit: produceAuctioneerKit,
41
+ auctionUpgradeNewInstance,
42
+ newContractGovBundleId,
43
+ },
44
+ instance: {
45
+ consume: { reserve: reserveInstance },
46
+ produce: { auctioneer: auctionInstance },
47
+ },
48
+ installation: {
49
+ consume: { auctioneer: auctioneerInstallationP },
50
+ },
51
+ issuer: {
52
+ consume: { [Stable.symbol]: stableIssuerP },
40
53
  },
41
54
  },
42
- issuer: {
43
- consume: { [Stable.symbol]: stableIssuerP },
55
+ {
56
+ options: {
57
+ contractGovernorRef: contractGovernorBundle,
58
+ contractGovernorInstallation,
59
+ },
44
60
  },
45
- }) => {
61
+ ) => {
46
62
  trace('addAuction start');
47
63
  const STORAGE_PATH = 'auction';
48
64
 
@@ -53,14 +69,12 @@ export const addAuction = async ({
53
69
  stableIssuer,
54
70
  legacyKit,
55
71
  auctioneerInstallation,
56
- governorInstallation,
57
72
  ] = await Promise.all([
58
73
  poserInvitationP,
59
74
  E(E(zoe).getInvitationIssuer()).getAmountOf(poserInvitationP),
60
75
  stableIssuerP,
61
76
  legacyKitP,
62
77
  auctioneerInstallationP,
63
- governorInstallationP,
64
78
  ]);
65
79
 
66
80
  // Each field has an extra layer of type + value:
@@ -109,9 +123,14 @@ export const addAuction = async ({
109
123
  }),
110
124
  );
111
125
 
126
+ const bundleIdFromZoe = await E(zoe).getBundleIDFromInstallation(
127
+ contractGovernorInstallation,
128
+ );
129
+ trace('governor bundle ID', bundleIdFromZoe, contractGovernorBundle.bundleID);
130
+
112
131
  /** @type {GovernorStartedInstallationKit<typeof auctioneerInstallationP>} */
113
132
  const governorStartResult = await E(zoe).startInstance(
114
- governorInstallation,
133
+ contractGovernorInstallation,
115
134
  undefined,
116
135
  governorTerms,
117
136
  harden({
@@ -179,6 +198,7 @@ export const addAuction = async ({
179
198
  );
180
199
 
181
200
  auctionUpgradeNewInstance.resolve(governedInstance);
201
+ newContractGovBundleId.resolve(contractGovernorBundle.bundleID);
182
202
  };
183
203
 
184
204
  export const ADD_AUCTION_MANIFEST = harden({
@@ -197,6 +217,7 @@ export const ADD_AUCTION_MANIFEST = harden({
197
217
  produce: {
198
218
  auctioneerKit: true,
199
219
  auctionUpgradeNewInstance: true,
220
+ newContractGovBundleId: true,
200
221
  },
201
222
  instance: {
202
223
  consume: { reserve: true },
@@ -222,9 +243,12 @@ export const getManifestForAddAuction = async (
222
243
  { restoreRef },
223
244
  { auctioneerRef, contractGovernorRef },
224
245
  ) => {
246
+ const contractGovernorInstallation = restoreRef(contractGovernorRef);
225
247
  return {
226
248
  manifest: ADD_AUCTION_MANIFEST,
227
- options: { auctioneerRef, contractGovernorRef },
249
+ // XXX we should be able to receive contractGovernorInstallation via
250
+ // installations.consume, but the received installation isn't right.
251
+ options: { contractGovernorRef, contractGovernorInstallation },
228
252
  installations: {
229
253
  auctioneer: restoreRef(auctioneerRef),
230
254
  contractGovernor: restoreRef(contractGovernorRef),
@@ -1,16 +1,13 @@
1
- export function upgradeVaults({ consume: { auctionUpgradeNewInstance, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, reserveKit, vaultFactoryKit, zoe, priceAuthority8400, }, produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer }, instance: { consume: { auctioneer: auctioneerInstanceP }, }, }: import("../../src/proposals/econ-behaviors").EconomyBootstrapPowers & interlockPowers, { options: { VaultFactoryBundle: vaultBundleRef, contractGovernorBundle } }: {
1
+ export function upgradeVaults({ consume: { auctionUpgradeNewInstance, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, reserveKit, vaultFactoryKit, zoe, priceAuthority8400, newContractGovBundleId: newContractGovBundleIdP, }, produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer, newContractGovBundleId: newContractGovBundleIdErasor, }, instance: { consume: { auctioneer: auctioneerInstanceP }, }, }: import("../../src/proposals/econ-behaviors").EconomyBootstrapPowers & interlockPowers, { options: { VaultFactoryBundle: vaultBundleRef } }: {
2
2
  options: {
3
3
  VaultFactoryBundle: {
4
4
  bundleID: string;
5
5
  };
6
- contractGovernorBundle: {
7
- bundleID: string;
8
- };
9
6
  };
10
7
  }): Promise<void>;
11
8
  export function getManifestForUpgradeVaults({ restoreRef }: {
12
9
  restoreRef: any;
13
- }, { VaultFactoryRef, contractGovernorRef }: any): Promise<{
10
+ }, { VaultFactoryRef }: any): Promise<{
14
11
  manifest: {
15
12
  [x: string]: {
16
13
  consume: {
@@ -21,9 +18,11 @@ export function getManifestForUpgradeVaults({ restoreRef }: {
21
18
  reserveKit: string;
22
19
  vaultFactoryKit: string;
23
20
  zoe: string;
21
+ newContractGovBundleId: string;
24
22
  };
25
23
  produce: {
26
24
  auctionUpgradeNewInstance: string;
25
+ newContractGovBundleId: string;
27
26
  };
28
27
  instance: {
29
28
  consume: {
@@ -34,15 +33,14 @@ export function getManifestForUpgradeVaults({ restoreRef }: {
34
33
  };
35
34
  installations: {
36
35
  VaultFactory: any;
37
- contractGovernor: any;
38
36
  };
39
37
  options: {
40
38
  VaultFactoryBundle: any;
41
- contractGovernorBundle: any;
42
39
  };
43
40
  }>;
44
41
  export type interlockPowers = PromiseSpaceOf<{
45
42
  priceAuthority8400: Instance;
46
43
  auctionUpgradeNewInstance: Instance;
44
+ newContractGovBundleId: string;
47
45
  }>;
48
46
  //# sourceMappingURL=upgrade-vaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-vaults.d.ts","sourceRoot":"","sources":["upgrade-vaults.js"],"names":[],"mappings":"AAyBO,oVATI,OAAO,oCAAoC,EAAE,sBAAsB,GACvE,eAAe,+EACX;IACN,OAAO,EAAE;QACP,kBAAkB,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QACzC,sBAAsB,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9C,CAAC;CACH,iBA6IH;AAUM,4DAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,4CAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+Bb;8BAlMY,cAAc,CAAC;IACvB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,yBAAyB,EAAE,QAAQ,CAAC;CACrC,CAAC"}
1
+ {"version":3,"file":"upgrade-vaults.d.ts","sourceRoot":"","sources":["upgrade-vaults.js"],"names":[],"mappings":"AAyBO,4bARI,OAAO,oCAAoC,EAAE,sBAAsB,GACvE,eAAe,uDACX;IACN,OAAO,EAAE;QACP,kBAAkB,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;KAC1C,CAAC;CACH,iBAsJH;AAUM,4DAHJ;IAAmB,UAAU,EAArB,GAAG;CACX,uBAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6Bb;8BAzMY,cAAc,CAAC;IACvB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,yBAAyB,EAAE,QAAQ,CAAC;IACpC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC"}
@@ -10,6 +10,7 @@ const trace = makeTracer('upgrade Vaults proposal');
10
10
  * @typedef {PromiseSpaceOf<{
11
11
  * priceAuthority8400: Instance;
12
12
  * auctionUpgradeNewInstance: Instance;
13
+ * newContractGovBundleId: string;
13
14
  * }>} interlockPowers
14
15
  */
15
16
 
@@ -19,7 +20,6 @@ const trace = makeTracer('upgrade Vaults proposal');
19
20
  * @param {{
20
21
  * options: {
21
22
  * VaultFactoryBundle: { bundleID: string };
22
- * contractGovernorBundle: { bundleID: string };
23
23
  * };
24
24
  * }} options
25
25
  */
@@ -33,13 +33,17 @@ export const upgradeVaults = async (
33
33
  vaultFactoryKit,
34
34
  zoe,
35
35
  priceAuthority8400,
36
+ newContractGovBundleId: newContractGovBundleIdP,
37
+ },
38
+ produce: {
39
+ auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer,
40
+ newContractGovBundleId: newContractGovBundleIdErasor,
36
41
  },
37
- produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer },
38
42
  instance: {
39
43
  consume: { auctioneer: auctioneerInstanceP },
40
44
  },
41
45
  },
42
- { options: { VaultFactoryBundle: vaultBundleRef, contractGovernorBundle } },
46
+ { options: { VaultFactoryBundle: vaultBundleRef } },
43
47
  ) => {
44
48
  const kit = await vaultFactoryKit;
45
49
  const { instance: directorInstance } = kit;
@@ -151,10 +155,15 @@ export const upgradeVaults = async (
151
155
  const vaultFactoryPrivateArgs = kit.privateArgs;
152
156
  trace('restarting governor');
153
157
 
154
- const ecf = await electorateCreatorFacet;
158
+ const [ecf, newContractGovBundleId] = await Promise.all([
159
+ electorateCreatorFacet,
160
+ newContractGovBundleIdP,
161
+ ]);
162
+ newContractGovBundleIdErasor.reset();
163
+
155
164
  // upgrade vaultFactory governor. Won't be needed next time: see #10063
156
165
  await E(kit.governorAdminFacet).upgradeContract(
157
- contractGovernorBundle.bundleID,
166
+ newContractGovBundleId,
158
167
  harden({
159
168
  electorateCreatorFacet: ecf,
160
169
  governed: vaultFactoryPrivateArgs,
@@ -174,7 +183,7 @@ const uV = 'upgradeVaults';
174
183
  */
175
184
  export const getManifestForUpgradeVaults = async (
176
185
  { restoreRef },
177
- { VaultFactoryRef, contractGovernorRef },
186
+ { VaultFactoryRef },
178
187
  ) => {
179
188
  return {
180
189
  manifest: {
@@ -187,18 +196,16 @@ export const getManifestForUpgradeVaults = async (
187
196
  reserveKit: uV,
188
197
  vaultFactoryKit: uV,
189
198
  zoe: uV,
199
+ newContractGovBundleId: uV,
200
+ },
201
+ produce: {
202
+ auctionUpgradeNewInstance: uV,
203
+ newContractGovBundleId: uV,
190
204
  },
191
- produce: { auctionUpgradeNewInstance: uV },
192
205
  instance: { consume: { auctioneer: uV } },
193
206
  },
194
207
  },
195
- installations: {
196
- VaultFactory: restoreRef(VaultFactoryRef),
197
- contractGovernor: restoreRef(contractGovernorRef),
198
- },
199
- options: {
200
- VaultFactoryBundle: VaultFactoryRef,
201
- contractGovernorBundle: contractGovernorRef,
202
- },
208
+ installations: { VaultFactory: restoreRef(VaultFactoryRef) },
209
+ options: { VaultFactoryBundle: VaultFactoryRef },
203
210
  };
204
211
  };