@agoric/inter-protocol 0.16.2-dev-c42dff3.0 → 0.16.2-dev-3601b6c.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 +15 -15
- package/src/proposals/add-auction.d.ts +12 -13
- package/src/proposals/add-auction.d.ts.map +1 -1
- package/src/proposals/add-auction.js +56 -57
- package/src/proposals/upgrade-vaults.d.ts +17 -10
- package/src/proposals/upgrade-vaults.d.ts.map +1 -1
- package/src/proposals/upgrade-vaults.js +40 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/inter-protocol",
|
|
3
|
-
"version": "0.16.2-dev-
|
|
3
|
+
"version": "0.16.2-dev-3601b6c.0+3601b6c",
|
|
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-
|
|
35
|
-
"@agoric/governance": "0.10.4-dev-
|
|
36
|
-
"@agoric/internal": "0.3.3-dev-
|
|
37
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
38
|
-
"@agoric/store": "0.9.3-dev-
|
|
39
|
-
"@agoric/time": "0.3.3-dev-
|
|
40
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
41
|
-
"@agoric/vats": "0.15.2-dev-
|
|
42
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
34
|
+
"@agoric/ertp": "0.16.3-dev-3601b6c.0+3601b6c",
|
|
35
|
+
"@agoric/governance": "0.10.4-dev-3601b6c.0+3601b6c",
|
|
36
|
+
"@agoric/internal": "0.3.3-dev-3601b6c.0+3601b6c",
|
|
37
|
+
"@agoric/notifier": "0.6.3-dev-3601b6c.0+3601b6c",
|
|
38
|
+
"@agoric/store": "0.9.3-dev-3601b6c.0+3601b6c",
|
|
39
|
+
"@agoric/time": "0.3.3-dev-3601b6c.0+3601b6c",
|
|
40
|
+
"@agoric/vat-data": "0.5.3-dev-3601b6c.0+3601b6c",
|
|
41
|
+
"@agoric/vats": "0.15.2-dev-3601b6c.0+3601b6c",
|
|
42
|
+
"@agoric/zoe": "0.26.3-dev-3601b6c.0+3601b6c",
|
|
43
43
|
"@endo/captp": "^4.3.0",
|
|
44
44
|
"@endo/errors": "^1.2.5",
|
|
45
45
|
"@endo/eventual-send": "^1.2.5",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"jessie.js": "^0.3.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
54
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
55
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
56
|
-
"@agoric/zone": "0.2.3-dev-
|
|
53
|
+
"@agoric/smart-wallet": "0.5.4-dev-3601b6c.0+3601b6c",
|
|
54
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-3601b6c.0+3601b6c",
|
|
55
|
+
"@agoric/swingset-vat": "0.32.3-dev-3601b6c.0+3601b6c",
|
|
56
|
+
"@agoric/zone": "0.2.3-dev-3601b6c.0+3601b6c",
|
|
57
57
|
"@endo/bundle-source": "^3.4.0",
|
|
58
58
|
"@endo/init": "^1.1.4",
|
|
59
59
|
"@endo/promise-kit": "^1.1.5",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typeCoverage": {
|
|
85
85
|
"atLeast": 95.8
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "3601b6cd14e7e8fb97758cc515c81325e2c31aa7"
|
|
88
88
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
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: {
|
|
2
|
-
options: {
|
|
3
|
-
auctionsRef: {
|
|
4
|
-
bundleID: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
}): Promise<void>;
|
|
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>;
|
|
8
2
|
export const ADD_AUCTION_MANIFEST: {
|
|
9
3
|
[x: string]: {
|
|
10
4
|
consume: {
|
|
@@ -33,8 +27,6 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
33
27
|
installation: {
|
|
34
28
|
consume: {
|
|
35
29
|
contractGovernor: boolean;
|
|
36
|
-
};
|
|
37
|
-
produce: {
|
|
38
30
|
auctioneer: boolean;
|
|
39
31
|
};
|
|
40
32
|
};
|
|
@@ -45,7 +37,9 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
45
37
|
};
|
|
46
38
|
};
|
|
47
39
|
};
|
|
48
|
-
export function getManifestForAddAuction(
|
|
40
|
+
export function getManifestForAddAuction({ restoreRef }: {
|
|
41
|
+
restoreRef: any;
|
|
42
|
+
}, { auctioneerRef, contractGovernorRef }: any): Promise<{
|
|
49
43
|
manifest: {
|
|
50
44
|
[x: string]: {
|
|
51
45
|
consume: {
|
|
@@ -74,8 +68,6 @@ export function getManifestForAddAuction(_ign: object, addAuctionOptions: any):
|
|
|
74
68
|
installation: {
|
|
75
69
|
consume: {
|
|
76
70
|
contractGovernor: boolean;
|
|
77
|
-
};
|
|
78
|
-
produce: {
|
|
79
71
|
auctioneer: boolean;
|
|
80
72
|
};
|
|
81
73
|
};
|
|
@@ -86,7 +78,14 @@ export function getManifestForAddAuction(_ign: object, addAuctionOptions: any):
|
|
|
86
78
|
};
|
|
87
79
|
};
|
|
88
80
|
};
|
|
89
|
-
options:
|
|
81
|
+
options: {
|
|
82
|
+
auctioneerRef: any;
|
|
83
|
+
contractGovernorRef: any;
|
|
84
|
+
};
|
|
85
|
+
installations: {
|
|
86
|
+
auctioneer: any;
|
|
87
|
+
contractGovernor: any;
|
|
88
|
+
};
|
|
90
89
|
}>;
|
|
91
90
|
export type interlockPowers = PromiseSpaceOf<{
|
|
92
91
|
auctionUpgradeNewInstance: Instance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-auction.d.ts","sourceRoot":"","sources":["add-auction.js"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -15,61 +15,52 @@ const trace = makeTracer('NewAuction', true);
|
|
|
15
15
|
/**
|
|
16
16
|
* @param {import('./econ-behaviors.js').EconomyBootstrapPowers &
|
|
17
17
|
* interlockPowers} powers
|
|
18
|
-
* @param {{ options: { auctionsRef: { bundleID: string } } }} options
|
|
19
18
|
*/
|
|
20
|
-
export const addAuction = async (
|
|
21
|
-
{
|
|
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: {
|
|
22
37
|
consume: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
board,
|
|
26
|
-
chainStorage,
|
|
27
|
-
chainTimerService,
|
|
28
|
-
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
29
|
-
econCharterKit,
|
|
30
|
-
priceAuthority8400,
|
|
31
|
-
zoe,
|
|
32
|
-
},
|
|
33
|
-
produce: { auctioneerKit: produceAuctioneerKit, auctionUpgradeNewInstance },
|
|
34
|
-
instance: {
|
|
35
|
-
consume: { reserve: reserveInstance },
|
|
36
|
-
produce: { auctioneer: auctionInstance },
|
|
37
|
-
},
|
|
38
|
-
installation: {
|
|
39
|
-
consume: { contractGovernor: contractGovernorInstallation },
|
|
40
|
-
produce: { auctioneer: produceInstallation },
|
|
41
|
-
},
|
|
42
|
-
issuer: {
|
|
43
|
-
consume: { [Stable.symbol]: stableIssuerP },
|
|
38
|
+
auctioneer: auctioneerInstallationP,
|
|
39
|
+
contractGovernor: governorInstallationP,
|
|
44
40
|
},
|
|
45
41
|
},
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
issuer: {
|
|
43
|
+
consume: { [Stable.symbol]: stableIssuerP },
|
|
44
|
+
},
|
|
45
|
+
}) => {
|
|
46
|
+
trace('addAuction start');
|
|
49
47
|
const STORAGE_PATH = 'auction';
|
|
50
|
-
const { auctionsRef } = options;
|
|
51
48
|
|
|
52
49
|
const poserInvitationP = E(electorateCreatorFacet).getPoserInvitation();
|
|
53
|
-
const bundleID = auctionsRef.bundleID;
|
|
54
|
-
/**
|
|
55
|
-
* @type {Promise<
|
|
56
|
-
* Installation<import('../../src/auction/auctioneer.js')['start']>
|
|
57
|
-
* >}
|
|
58
|
-
*/
|
|
59
|
-
const installationP = E(zoe).installBundleID(bundleID);
|
|
60
|
-
produceInstallation.reset();
|
|
61
|
-
produceInstallation.resolve(installationP);
|
|
62
|
-
|
|
63
50
|
const [
|
|
64
51
|
initialPoserInvitation,
|
|
65
52
|
electorateInvitationAmount,
|
|
66
53
|
stableIssuer,
|
|
67
54
|
legacyKit,
|
|
55
|
+
auctioneerInstallation,
|
|
56
|
+
governorInstallation,
|
|
68
57
|
] = await Promise.all([
|
|
69
58
|
poserInvitationP,
|
|
70
59
|
E(E(zoe).getInvitationIssuer()).getAmountOf(poserInvitationP),
|
|
71
60
|
stableIssuerP,
|
|
72
61
|
legacyKitP,
|
|
62
|
+
auctioneerInstallationP,
|
|
63
|
+
governorInstallationP,
|
|
73
64
|
]);
|
|
74
65
|
|
|
75
66
|
// Each field has an extra layer of type + value:
|
|
@@ -104,12 +95,10 @@ export const addAuction = async (
|
|
|
104
95
|
},
|
|
105
96
|
);
|
|
106
97
|
|
|
107
|
-
const installation = await installationP;
|
|
108
|
-
|
|
109
98
|
const governorTerms = await deeplyFulfilledObject(
|
|
110
99
|
harden({
|
|
111
100
|
timer: chainTimerService,
|
|
112
|
-
governedContractInstallation:
|
|
101
|
+
governedContractInstallation: auctioneerInstallation,
|
|
113
102
|
governed: {
|
|
114
103
|
terms: auctionTerms,
|
|
115
104
|
issuerKeywordRecord: { Bid: stableIssuer },
|
|
@@ -120,9 +109,9 @@ export const addAuction = async (
|
|
|
120
109
|
}),
|
|
121
110
|
);
|
|
122
111
|
|
|
123
|
-
/** @type {GovernorStartedInstallationKit<typeof
|
|
112
|
+
/** @type {GovernorStartedInstallationKit<typeof auctioneerInstallationP>} */
|
|
124
113
|
const governorStartResult = await E(zoe).startInstance(
|
|
125
|
-
|
|
114
|
+
governorInstallation,
|
|
126
115
|
undefined,
|
|
127
116
|
governorTerms,
|
|
128
117
|
harden({
|
|
@@ -136,12 +125,17 @@ export const addAuction = async (
|
|
|
136
125
|
'auctioneer.governor',
|
|
137
126
|
);
|
|
138
127
|
|
|
139
|
-
const [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
const [
|
|
129
|
+
governedInstance,
|
|
130
|
+
governedCreatorFacet,
|
|
131
|
+
governedPublicFacet,
|
|
132
|
+
governedAdminFacet,
|
|
133
|
+
] = await Promise.all([
|
|
134
|
+
E(governorStartResult.creatorFacet).getInstance(),
|
|
135
|
+
E(governorStartResult.creatorFacet).getCreatorFacet(),
|
|
136
|
+
E(governorStartResult.creatorFacet).getPublicFacet(),
|
|
137
|
+
E(governorStartResult.creatorFacet).getAdminFacet(),
|
|
138
|
+
]);
|
|
145
139
|
|
|
146
140
|
const allIssuers = await E(zoe).getIssuers(legacyKit.instance);
|
|
147
141
|
const { Bid: _istIssuer, ...auctionIssuers } = allIssuers;
|
|
@@ -157,7 +151,7 @@ export const addAuction = async (
|
|
|
157
151
|
const kit = harden({
|
|
158
152
|
label: 'auctioneer',
|
|
159
153
|
creatorFacet: governedCreatorFacet,
|
|
160
|
-
adminFacet:
|
|
154
|
+
adminFacet: governedAdminFacet,
|
|
161
155
|
publicFacet: governedPublicFacet,
|
|
162
156
|
instance: governedInstance,
|
|
163
157
|
|
|
@@ -209,10 +203,7 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
209
203
|
produce: { auctioneer: true },
|
|
210
204
|
},
|
|
211
205
|
installation: {
|
|
212
|
-
consume: {
|
|
213
|
-
contractGovernor: true,
|
|
214
|
-
},
|
|
215
|
-
produce: { auctioneer: true },
|
|
206
|
+
consume: { contractGovernor: true, auctioneer: true },
|
|
216
207
|
},
|
|
217
208
|
issuer: {
|
|
218
209
|
consume: { [Stable.symbol]: true },
|
|
@@ -223,12 +214,20 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
223
214
|
/**
|
|
224
215
|
* Add a new auction to a chain that already has one.
|
|
225
216
|
*
|
|
226
|
-
* @param {object}
|
|
217
|
+
* @param {object} utils
|
|
218
|
+
* @param {any} utils.restoreRef
|
|
227
219
|
* @param {any} addAuctionOptions
|
|
228
220
|
*/
|
|
229
|
-
export const getManifestForAddAuction = async (
|
|
221
|
+
export const getManifestForAddAuction = async (
|
|
222
|
+
{ restoreRef },
|
|
223
|
+
{ auctioneerRef, contractGovernorRef },
|
|
224
|
+
) => {
|
|
230
225
|
return {
|
|
231
226
|
manifest: ADD_AUCTION_MANIFEST,
|
|
232
|
-
options:
|
|
227
|
+
options: { auctioneerRef, contractGovernorRef },
|
|
228
|
+
installations: {
|
|
229
|
+
auctioneer: restoreRef(auctioneerRef),
|
|
230
|
+
contractGovernor: restoreRef(contractGovernorRef),
|
|
231
|
+
},
|
|
233
232
|
};
|
|
234
233
|
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
export function upgradeVaults({ consume: { auctionUpgradeNewInstance, chainTimerService, economicCommitteeCreatorFacet: electorateCreatorFacet, reserveKit, vaultFactoryKit, zoe, priceAuthority8400, }, produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer },
|
|
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 } }: {
|
|
2
2
|
options: {
|
|
3
|
-
|
|
3
|
+
VaultFactoryBundle: {
|
|
4
|
+
bundleID: string;
|
|
5
|
+
};
|
|
6
|
+
contractGovernorBundle: {
|
|
4
7
|
bundleID: string;
|
|
5
8
|
};
|
|
6
9
|
};
|
|
7
10
|
}): Promise<void>;
|
|
8
|
-
export function getManifestForUpgradeVaults(
|
|
11
|
+
export function getManifestForUpgradeVaults({ restoreRef }: {
|
|
12
|
+
restoreRef: any;
|
|
13
|
+
}, { VaultFactoryRef, contractGovernorRef }: any): Promise<{
|
|
9
14
|
manifest: {
|
|
10
15
|
[x: string]: {
|
|
11
16
|
consume: {
|
|
@@ -20,19 +25,21 @@ export function getManifestForUpgradeVaults(_ign: object, vaultUpgradeOptions: a
|
|
|
20
25
|
produce: {
|
|
21
26
|
auctionUpgradeNewInstance: string;
|
|
22
27
|
};
|
|
23
|
-
installation: {
|
|
24
|
-
produce: {
|
|
25
|
-
VaultFactory: boolean;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
28
|
instance: {
|
|
29
29
|
consume: {
|
|
30
|
-
auctioneer:
|
|
30
|
+
auctioneer: string;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
installations: {
|
|
36
|
+
VaultFactory: any;
|
|
37
|
+
contractGovernor: any;
|
|
38
|
+
};
|
|
39
|
+
options: {
|
|
40
|
+
VaultFactoryBundle: any;
|
|
41
|
+
contractGovernorBundle: any;
|
|
42
|
+
};
|
|
36
43
|
}>;
|
|
37
44
|
export type interlockPowers = PromiseSpaceOf<{
|
|
38
45
|
priceAuthority8400: Instance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-vaults.d.ts","sourceRoot":"","sources":["upgrade-vaults.js"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -16,7 +16,12 @@ const trace = makeTracer('upgrade Vaults proposal');
|
|
|
16
16
|
/**
|
|
17
17
|
* @param {import('../../src/proposals/econ-behaviors').EconomyBootstrapPowers &
|
|
18
18
|
* interlockPowers} powers
|
|
19
|
-
* @param {{
|
|
19
|
+
* @param {{
|
|
20
|
+
* options: {
|
|
21
|
+
* VaultFactoryBundle: { bundleID: string };
|
|
22
|
+
* contractGovernorBundle: { bundleID: string };
|
|
23
|
+
* };
|
|
24
|
+
* }} options
|
|
20
25
|
*/
|
|
21
26
|
export const upgradeVaults = async (
|
|
22
27
|
{
|
|
@@ -30,16 +35,12 @@ export const upgradeVaults = async (
|
|
|
30
35
|
priceAuthority8400,
|
|
31
36
|
},
|
|
32
37
|
produce: { auctionUpgradeNewInstance: auctionUpgradeNewInstanceProducer },
|
|
33
|
-
installation: {
|
|
34
|
-
produce: { VaultFactory: produceVaultInstallation },
|
|
35
|
-
},
|
|
36
38
|
instance: {
|
|
37
39
|
consume: { auctioneer: auctioneerInstanceP },
|
|
38
40
|
},
|
|
39
41
|
},
|
|
40
|
-
{ options },
|
|
42
|
+
{ options: { VaultFactoryBundle: vaultBundleRef, contractGovernorBundle } },
|
|
41
43
|
) => {
|
|
42
|
-
const { vaultsRef } = options;
|
|
43
44
|
const kit = await vaultFactoryKit;
|
|
44
45
|
const { instance: directorInstance } = kit;
|
|
45
46
|
const allBrands = await E(zoe).getBrands(directorInstance);
|
|
@@ -47,17 +48,6 @@ export const upgradeVaults = async (
|
|
|
47
48
|
|
|
48
49
|
await priceAuthority8400;
|
|
49
50
|
|
|
50
|
-
const bundleID = vaultsRef.bundleID;
|
|
51
|
-
console.log(`upgradeVaults: bundleId`, bundleID);
|
|
52
|
-
/**
|
|
53
|
-
* @type {Promise<
|
|
54
|
-
* Installation<import('../../src/vaultFactory/vaultFactory.js')['start']>
|
|
55
|
-
* >}
|
|
56
|
-
*/
|
|
57
|
-
const installationP = E(zoe).installBundleID(bundleID);
|
|
58
|
-
produceVaultInstallation.reset();
|
|
59
|
-
produceVaultInstallation.resolve(installationP);
|
|
60
|
-
|
|
61
51
|
const [auctionOldInstance, auctionNewInstance] = await Promise.all([
|
|
62
52
|
auctioneerInstanceP,
|
|
63
53
|
auctionUpgradeNewInstance,
|
|
@@ -149,7 +139,7 @@ export const upgradeVaults = async (
|
|
|
149
139
|
});
|
|
150
140
|
|
|
151
141
|
const upgradeResult = await E(kit.adminFacet).upgradeContract(
|
|
152
|
-
bundleID,
|
|
142
|
+
vaultBundleRef.bundleID,
|
|
153
143
|
newPrivateArgs,
|
|
154
144
|
);
|
|
155
145
|
|
|
@@ -162,8 +152,9 @@ export const upgradeVaults = async (
|
|
|
162
152
|
trace('restarting governor');
|
|
163
153
|
|
|
164
154
|
const ecf = await electorateCreatorFacet;
|
|
165
|
-
//
|
|
166
|
-
await E(kit.governorAdminFacet).
|
|
155
|
+
// upgrade vaultFactory governor. Won't be needed next time: see #10063
|
|
156
|
+
await E(kit.governorAdminFacet).upgradeContract(
|
|
157
|
+
contractGovernorBundle.bundleID,
|
|
167
158
|
harden({
|
|
168
159
|
electorateCreatorFacet: ecf,
|
|
169
160
|
governed: vaultFactoryPrivateArgs,
|
|
@@ -177,30 +168,37 @@ const uV = 'upgradeVaults';
|
|
|
177
168
|
/**
|
|
178
169
|
* Return the manifest, installations, and options for upgrading Vaults.
|
|
179
170
|
*
|
|
180
|
-
* @param {object}
|
|
171
|
+
* @param {object} utils
|
|
172
|
+
* @param {any} utils.restoreRef
|
|
181
173
|
* @param {any} vaultUpgradeOptions
|
|
182
174
|
*/
|
|
183
175
|
export const getManifestForUpgradeVaults = async (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
) =>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
176
|
+
{ restoreRef },
|
|
177
|
+
{ VaultFactoryRef, contractGovernorRef },
|
|
178
|
+
) => {
|
|
179
|
+
return {
|
|
180
|
+
manifest: {
|
|
181
|
+
[upgradeVaults.name]: {
|
|
182
|
+
consume: {
|
|
183
|
+
priceAuthority8400: uV,
|
|
184
|
+
auctionUpgradeNewInstance: uV,
|
|
185
|
+
chainTimerService: uV,
|
|
186
|
+
economicCommitteeCreatorFacet: uV,
|
|
187
|
+
reserveKit: uV,
|
|
188
|
+
vaultFactoryKit: uV,
|
|
189
|
+
zoe: uV,
|
|
190
|
+
},
|
|
191
|
+
produce: { auctionUpgradeNewInstance: uV },
|
|
192
|
+
instance: { consume: { auctioneer: uV } },
|
|
201
193
|
},
|
|
202
|
-
instance: { consume: { auctioneer: true } },
|
|
203
194
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
195
|
+
installations: {
|
|
196
|
+
VaultFactory: restoreRef(VaultFactoryRef),
|
|
197
|
+
contractGovernor: restoreRef(contractGovernorRef),
|
|
198
|
+
},
|
|
199
|
+
options: {
|
|
200
|
+
VaultFactoryBundle: VaultFactoryRef,
|
|
201
|
+
contractGovernorBundle: contractGovernorRef,
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
};
|