@agoric/inter-protocol 0.16.2-dev-dfc7a48.0 → 0.16.2-dev-b6379da.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 +17 -6
- package/src/proposals/add-auction.d.ts.map +1 -1
- package/src/proposals/add-auction.js +53 -30
- package/src/proposals/upgrade-vaults.d.ts +7 -9
- package/src/proposals/upgrade-vaults.d.ts.map +1 -1
- package/src/proposals/upgrade-vaults.js +24 -123
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-b6379da.0+b6379da",
|
|
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-b6379da.0+b6379da",
|
|
35
|
+
"@agoric/governance": "0.10.4-dev-b6379da.0+b6379da",
|
|
36
|
+
"@agoric/internal": "0.3.3-dev-b6379da.0+b6379da",
|
|
37
|
+
"@agoric/notifier": "0.6.3-dev-b6379da.0+b6379da",
|
|
38
|
+
"@agoric/store": "0.9.3-dev-b6379da.0+b6379da",
|
|
39
|
+
"@agoric/time": "0.3.3-dev-b6379da.0+b6379da",
|
|
40
|
+
"@agoric/vat-data": "0.5.3-dev-b6379da.0+b6379da",
|
|
41
|
+
"@agoric/vats": "0.15.2-dev-b6379da.0+b6379da",
|
|
42
|
+
"@agoric/zoe": "0.26.3-dev-b6379da.0+b6379da",
|
|
43
43
|
"@endo/captp": "^4.2.2",
|
|
44
44
|
"@endo/errors": "^1.2.4",
|
|
45
45
|
"@endo/eventual-send": "^1.2.4",
|
|
@@ -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-b6379da.0+b6379da",
|
|
54
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-b6379da.0+b6379da",
|
|
55
|
+
"@agoric/swingset-vat": "0.32.3-dev-b6379da.0+b6379da",
|
|
56
|
+
"@agoric/zone": "0.2.3-dev-b6379da.0+b6379da",
|
|
57
57
|
"@endo/bundle-source": "^3.3.0",
|
|
58
58
|
"@endo/init": "^1.1.3",
|
|
59
59
|
"@endo/promise-kit": "^1.1.4",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typeCoverage": {
|
|
85
85
|
"atLeast": 95.81
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "b6379daa03adab7bf71ce859d2fc5e40f81c481c"
|
|
88
88
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export function addAuction({ consume: { zoe, board, chainTimerService, priceAuthority, chainStorage, economicCommitteeCreatorFacet: electorateCreatorFacet, auctioneerKit: legacyKitP, }, produce: {
|
|
1
|
+
export function addAuction({ consume: { zoe, board, chainTimerService, priceAuthority, chainStorage, economicCommitteeCreatorFacet: electorateCreatorFacet, auctioneerKit: legacyKitP, }, produce: { auctioneerKit: produceAuctioneerKit, auctionsUpgradeComplete }, instance: { consume: { reserve: reserveInstance }, }, installation: { consume: { contractGovernor: contractGovernorInstallation }, produce: { auctioneer: produceInstallation }, }, issuer: { consume: { [Stable.symbol]: stableIssuerP }, }, }: import("./econ-behaviors.js").EconomyBootstrapPowers & interlockPowers, { options }: {
|
|
2
|
+
options: {
|
|
3
|
+
auctionsRef: {
|
|
4
|
+
bundleID: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
}): Promise<void>;
|
|
2
8
|
export const ADD_AUCTION_MANIFEST: {
|
|
3
9
|
[x: string]: {
|
|
4
10
|
consume: {
|
|
@@ -11,7 +17,7 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
11
17
|
auctioneerKit: boolean;
|
|
12
18
|
};
|
|
13
19
|
produce: {
|
|
14
|
-
|
|
20
|
+
auctioneerKit: boolean;
|
|
15
21
|
auctionsUpgradeComplete: boolean;
|
|
16
22
|
};
|
|
17
23
|
instance: {
|
|
@@ -21,9 +27,11 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
21
27
|
};
|
|
22
28
|
installation: {
|
|
23
29
|
consume: {
|
|
24
|
-
auctioneer: boolean;
|
|
25
30
|
contractGovernor: boolean;
|
|
26
31
|
};
|
|
32
|
+
produce: {
|
|
33
|
+
auctioneer: boolean;
|
|
34
|
+
};
|
|
27
35
|
};
|
|
28
36
|
issuer: {
|
|
29
37
|
consume: {
|
|
@@ -32,7 +40,7 @@ export const ADD_AUCTION_MANIFEST: {
|
|
|
32
40
|
};
|
|
33
41
|
};
|
|
34
42
|
};
|
|
35
|
-
export function getManifestForAddAuction(): Promise<{
|
|
43
|
+
export function getManifestForAddAuction(_ign: object, addAuctionOptions: any): Promise<{
|
|
36
44
|
manifest: {
|
|
37
45
|
[x: string]: {
|
|
38
46
|
consume: {
|
|
@@ -45,7 +53,7 @@ export function getManifestForAddAuction(): Promise<{
|
|
|
45
53
|
auctioneerKit: boolean;
|
|
46
54
|
};
|
|
47
55
|
produce: {
|
|
48
|
-
|
|
56
|
+
auctioneerKit: boolean;
|
|
49
57
|
auctionsUpgradeComplete: boolean;
|
|
50
58
|
};
|
|
51
59
|
instance: {
|
|
@@ -55,9 +63,11 @@ export function getManifestForAddAuction(): Promise<{
|
|
|
55
63
|
};
|
|
56
64
|
installation: {
|
|
57
65
|
consume: {
|
|
58
|
-
auctioneer: boolean;
|
|
59
66
|
contractGovernor: boolean;
|
|
60
67
|
};
|
|
68
|
+
produce: {
|
|
69
|
+
auctioneer: boolean;
|
|
70
|
+
};
|
|
61
71
|
};
|
|
62
72
|
issuer: {
|
|
63
73
|
consume: {
|
|
@@ -66,6 +76,7 @@ export function getManifestForAddAuction(): Promise<{
|
|
|
66
76
|
};
|
|
67
77
|
};
|
|
68
78
|
};
|
|
79
|
+
options: any;
|
|
69
80
|
}>;
|
|
70
81
|
export type interlockPowers = PromiseSpaceOf<{
|
|
71
82
|
auctionsUpgradeComplete: boolean;
|
|
@@ -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":"AAmBO,sfAJI,OAAO,qBAAqB,EAAE,sBAAsB,GAC9D,eAAmB,eACT;IAAE,OAAO,EAAE;QAAE,WAAW,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,iBA0J5D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BG;AAQI,+CAHI,MAAM,qBACN,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOb;8BA7MY,cAAc,CAAC;IAC3B,uBAA2B,EAAE,OAAO,CAAC;CAClC,CAAC;uBARkB,gCAAgC"}
|
|
@@ -15,35 +15,47 @@ 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
|
|
18
19
|
*/
|
|
19
|
-
export const addAuction = async (
|
|
20
|
-
|
|
21
|
-
zoe,
|
|
22
|
-
board,
|
|
23
|
-
chainTimerService,
|
|
24
|
-
priceAuthority,
|
|
25
|
-
chainStorage,
|
|
26
|
-
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
27
|
-
auctioneerKit: legacyKitP,
|
|
28
|
-
},
|
|
29
|
-
produce: { newAuctioneerKit, auctionsUpgradeComplete },
|
|
30
|
-
instance: {
|
|
31
|
-
consume: { reserve: reserveInstance },
|
|
32
|
-
},
|
|
33
|
-
installation: {
|
|
20
|
+
export const addAuction = async (
|
|
21
|
+
{
|
|
34
22
|
consume: {
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
zoe,
|
|
24
|
+
board,
|
|
25
|
+
chainTimerService,
|
|
26
|
+
priceAuthority,
|
|
27
|
+
chainStorage,
|
|
28
|
+
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
29
|
+
auctioneerKit: legacyKitP,
|
|
30
|
+
},
|
|
31
|
+
produce: { auctioneerKit: produceAuctioneerKit, auctionsUpgradeComplete },
|
|
32
|
+
instance: {
|
|
33
|
+
consume: { reserve: reserveInstance },
|
|
34
|
+
},
|
|
35
|
+
installation: {
|
|
36
|
+
consume: { contractGovernor: contractGovernorInstallation },
|
|
37
|
+
produce: { auctioneer: produceInstallation },
|
|
38
|
+
},
|
|
39
|
+
issuer: {
|
|
40
|
+
consume: { [Stable.symbol]: stableIssuerP },
|
|
37
41
|
},
|
|
38
42
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}) => {
|
|
43
|
-
trace('addAuction start');
|
|
43
|
+
{ options },
|
|
44
|
+
) => {
|
|
45
|
+
trace('addAuction start', options);
|
|
44
46
|
const STORAGE_PATH = 'auction';
|
|
47
|
+
const { auctionsRef } = options;
|
|
45
48
|
|
|
46
49
|
const poserInvitationP = E(electorateCreatorFacet).getPoserInvitation();
|
|
50
|
+
const bundleID = auctionsRef.bundleID;
|
|
51
|
+
/**
|
|
52
|
+
* @type {Promise<
|
|
53
|
+
* Installation<import('../../src/auction/auctioneer.js')['start']>
|
|
54
|
+
* >}
|
|
55
|
+
*/
|
|
56
|
+
const installationP = E(zoe).installBundleID(bundleID);
|
|
57
|
+
produceInstallation.reset();
|
|
58
|
+
produceInstallation.resolve(installationP);
|
|
47
59
|
|
|
48
60
|
const [
|
|
49
61
|
initialPoserInvitation,
|
|
@@ -89,10 +101,12 @@ export const addAuction = async ({
|
|
|
89
101
|
},
|
|
90
102
|
);
|
|
91
103
|
|
|
104
|
+
const installation = await installationP;
|
|
105
|
+
|
|
92
106
|
const governorTerms = await deeplyFulfilledObject(
|
|
93
107
|
harden({
|
|
94
108
|
timer: chainTimerService,
|
|
95
|
-
governedContractInstallation:
|
|
109
|
+
governedContractInstallation: installation,
|
|
96
110
|
governed: {
|
|
97
111
|
terms: auctionTerms,
|
|
98
112
|
issuerKeywordRecord: { Bid: stableIssuer },
|
|
@@ -103,7 +117,7 @@ export const addAuction = async ({
|
|
|
103
117
|
}),
|
|
104
118
|
);
|
|
105
119
|
|
|
106
|
-
/** @type {GovernorStartedInstallationKit<typeof
|
|
120
|
+
/** @type {GovernorStartedInstallationKit<typeof installationP>} */
|
|
107
121
|
const governorStartResult = await E(zoe).startInstance(
|
|
108
122
|
contractGovernorInstallation,
|
|
109
123
|
undefined,
|
|
@@ -137,7 +151,8 @@ export const addAuction = async ({
|
|
|
137
151
|
),
|
|
138
152
|
);
|
|
139
153
|
|
|
140
|
-
|
|
154
|
+
produceAuctioneerKit.reset();
|
|
155
|
+
produceAuctioneerKit.resolve(
|
|
141
156
|
harden({
|
|
142
157
|
label: 'auctioneer',
|
|
143
158
|
creatorFacet: governedCreatorFacet,
|
|
@@ -168,7 +183,7 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
168
183
|
auctioneerKit: true,
|
|
169
184
|
},
|
|
170
185
|
produce: {
|
|
171
|
-
|
|
186
|
+
auctioneerKit: true,
|
|
172
187
|
auctionsUpgradeComplete: true,
|
|
173
188
|
},
|
|
174
189
|
instance: {
|
|
@@ -176,9 +191,9 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
176
191
|
},
|
|
177
192
|
installation: {
|
|
178
193
|
consume: {
|
|
179
|
-
auctioneer: true,
|
|
180
194
|
contractGovernor: true,
|
|
181
195
|
},
|
|
196
|
+
produce: { auctioneer: true },
|
|
182
197
|
},
|
|
183
198
|
issuer: {
|
|
184
199
|
consume: { [Stable.symbol]: true },
|
|
@@ -186,7 +201,15 @@ export const ADD_AUCTION_MANIFEST = harden({
|
|
|
186
201
|
},
|
|
187
202
|
});
|
|
188
203
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Add a new auction to a chain that already has one.
|
|
206
|
+
*
|
|
207
|
+
* @param {object} _ign
|
|
208
|
+
* @param {any} addAuctionOptions
|
|
209
|
+
*/
|
|
210
|
+
export const getManifestForAddAuction = async (_ign, addAuctionOptions) => {
|
|
211
|
+
return {
|
|
212
|
+
manifest: ADD_AUCTION_MANIFEST,
|
|
213
|
+
options: addAuctionOptions,
|
|
214
|
+
};
|
|
192
215
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function upgradeVaults(
|
|
1
|
+
export function upgradeVaults({ consume: { vaultFactoryKit, zoe, economicCommitteeCreatorFacet: electorateCreatorFacet, reserveKit, auctionsUpgradeComplete, }, produce: { auctionsUpgradeComplete: auctionsUpgradeCompleteProducer }, installation: { produce: { VaultFactory: produceVaultInstallation }, }, instance: { consume: { auctioneer: auctioneerInstanceP }, }, }: import("../../src/proposals/econ-behaviors").EconomyBootstrapPowers & interlockPowers, { options }: {
|
|
2
2
|
options: {
|
|
3
3
|
vaultsRef: {
|
|
4
4
|
bundleID: string;
|
|
@@ -9,25 +9,23 @@ export function getManifestForUpgradeVaults(_ign: object, vaultUpgradeOptions: a
|
|
|
9
9
|
manifest: {
|
|
10
10
|
[x: string]: {
|
|
11
11
|
consume: {
|
|
12
|
-
agoricNamesAdmin: string;
|
|
13
|
-
newAuctioneerKit: string;
|
|
14
12
|
economicCommitteeCreatorFacet: string;
|
|
15
|
-
priceAuthority: string;
|
|
16
13
|
reserveKit: string;
|
|
17
14
|
vaultFactoryKit: string;
|
|
18
|
-
board: string;
|
|
19
15
|
zoe: string;
|
|
20
16
|
auctionsUpgradeComplete: string;
|
|
21
17
|
};
|
|
22
18
|
produce: {
|
|
23
|
-
auctioneerKit: string;
|
|
24
|
-
newAuctioneerKit: string;
|
|
25
19
|
auctionsUpgradeComplete: string;
|
|
26
20
|
};
|
|
27
|
-
|
|
21
|
+
installation: {
|
|
28
22
|
produce: {
|
|
23
|
+
VaultFactory: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
instance: {
|
|
27
|
+
consume: {
|
|
29
28
|
auctioneer: string;
|
|
30
|
-
newAuctioneerKit: string;
|
|
31
29
|
};
|
|
32
30
|
};
|
|
33
31
|
};
|
|
@@ -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":"AAkBO,+WAJI,OAAO,oCAAoC,EAAE,sBAAsB,GAC7E,eAAqB,eACX;IAAE,OAAO,EAAE;QAAE,SAAS,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,iBA6I1D;AASM,kDAHI,MAAM,uBACN,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GAuBZ;8BAnLW,cAAc,CAAC;IAC3B,uBAA2B,EAAE,OAAO,CAAC;CAClC,CAAC"}
|
|
@@ -2,34 +2,9 @@ import { E } from '@endo/far';
|
|
|
2
2
|
import { makeNotifierFromAsyncIterable } from '@agoric/notifier';
|
|
3
3
|
import { AmountMath } from '@agoric/ertp/src/index.js';
|
|
4
4
|
import { makeTracer } from '@agoric/internal/src/index.js';
|
|
5
|
-
import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
|
|
6
5
|
|
|
7
6
|
const trace = makeTracer('upgrade Vaults proposal');
|
|
8
7
|
|
|
9
|
-
// stand-in for Promise.any() which isn't available at this point.
|
|
10
|
-
/** @param {Promise<any>[]} promises */
|
|
11
|
-
const any = promises =>
|
|
12
|
-
new Promise((resolve, reject) => {
|
|
13
|
-
for (const promise of promises) {
|
|
14
|
-
void promise.then(resolve, () => {});
|
|
15
|
-
}
|
|
16
|
-
void Promise.allSettled(promises).then(results => {
|
|
17
|
-
const rejects = /** @type {PromiseRejectedResult[]} */ (
|
|
18
|
-
results.filter(({ status }) => status === 'rejected')
|
|
19
|
-
);
|
|
20
|
-
if (rejects.length === results.length) {
|
|
21
|
-
const messages = rejects.map(
|
|
22
|
-
({ reason: { message } }) => message || 'no error message',
|
|
23
|
-
);
|
|
24
|
-
const aggregate = new Error(messages.join(';'));
|
|
25
|
-
/** @type {any} */ (aggregate).errors = rejects.map(
|
|
26
|
-
({ reason }) => reason,
|
|
27
|
-
);
|
|
28
|
-
reject(aggregate);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
8
|
/**
|
|
34
9
|
* @typedef {PromiseSpaceOf<{
|
|
35
10
|
* auctionsUpgradeComplete: boolean;
|
|
@@ -41,33 +16,30 @@ const any = promises =>
|
|
|
41
16
|
* interlockPowers} powers
|
|
42
17
|
* @param {{ options: { vaultsRef: { bundleID: string } } }} options
|
|
43
18
|
*/
|
|
44
|
-
export const upgradeVaults = async (
|
|
45
|
-
|
|
19
|
+
export const upgradeVaults = async (
|
|
20
|
+
{
|
|
46
21
|
consume: {
|
|
47
|
-
agoricNamesAdmin,
|
|
48
|
-
newAuctioneerKit: auctioneerKitP,
|
|
49
|
-
priceAuthority,
|
|
50
22
|
vaultFactoryKit,
|
|
51
23
|
zoe,
|
|
52
24
|
economicCommitteeCreatorFacet: electorateCreatorFacet,
|
|
53
25
|
reserveKit,
|
|
54
26
|
auctionsUpgradeComplete,
|
|
55
27
|
},
|
|
56
|
-
produce: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
auctionsUpgradeComplete: auctionsUpgradeCompleteProducer,
|
|
28
|
+
produce: { auctionsUpgradeComplete: auctionsUpgradeCompleteProducer },
|
|
29
|
+
installation: {
|
|
30
|
+
produce: { VaultFactory: produceVaultInstallation },
|
|
60
31
|
},
|
|
61
32
|
instance: {
|
|
62
|
-
|
|
33
|
+
consume: { auctioneer: auctioneerInstanceP },
|
|
63
34
|
},
|
|
64
|
-
}
|
|
35
|
+
},
|
|
36
|
+
{ options },
|
|
37
|
+
) => {
|
|
65
38
|
const { vaultsRef } = options;
|
|
66
39
|
const kit = await vaultFactoryKit;
|
|
67
|
-
const auctioneerKit = await auctioneerKitP;
|
|
68
40
|
const { instance: directorInstance } = kit;
|
|
69
41
|
const allBrands = await E(zoe).getBrands(directorInstance);
|
|
70
|
-
const { Minted:
|
|
42
|
+
const { Minted: _istBrand, ...vaultBrands } = allBrands;
|
|
71
43
|
|
|
72
44
|
const bundleID = vaultsRef.bundleID;
|
|
73
45
|
console.log(`upgradeVaults: bundleId`, bundleID);
|
|
@@ -76,27 +48,13 @@ export const upgradeVaults = async (powers, { options }) => {
|
|
|
76
48
|
* Installation<import('../../src/vaultFactory/vaultFactory.js')['start']>
|
|
77
49
|
* >}
|
|
78
50
|
*/
|
|
79
|
-
|
|
51
|
+
const installationP = E(zoe).installBundleID(bundleID);
|
|
52
|
+
produceVaultInstallation.reset();
|
|
53
|
+
produceVaultInstallation.resolve(installationP);
|
|
80
54
|
|
|
81
55
|
await auctionsUpgradeComplete;
|
|
82
56
|
auctionsUpgradeCompleteProducer.reset();
|
|
83
57
|
|
|
84
|
-
if (vaultsRef) {
|
|
85
|
-
if (bundleID) {
|
|
86
|
-
installationP = E(zoe).installBundleID(bundleID);
|
|
87
|
-
await E.when(
|
|
88
|
-
installationP,
|
|
89
|
-
installation =>
|
|
90
|
-
E(E(agoricNamesAdmin).lookupAdmin('installation')).update(
|
|
91
|
-
'vaultFactory',
|
|
92
|
-
installation,
|
|
93
|
-
),
|
|
94
|
-
err =>
|
|
95
|
-
console.error(`🚨 failed to update vaultFactory installation`, err),
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
58
|
const readCurrentDirectorParams = async () => {
|
|
101
59
|
const { publicFacet: directorPF } = kit;
|
|
102
60
|
|
|
@@ -173,14 +131,15 @@ export const upgradeVaults = async (powers, { options }) => {
|
|
|
173
131
|
E.get(reserveKit).creatorFacet,
|
|
174
132
|
).makeShortfallReportingInvitation();
|
|
175
133
|
|
|
176
|
-
const poserInvitation = await
|
|
177
|
-
electorateCreatorFacet,
|
|
178
|
-
|
|
134
|
+
const [poserInvitation, auctioneerInstance] = await Promise.all([
|
|
135
|
+
E(electorateCreatorFacet).getPoserInvitation(),
|
|
136
|
+
auctioneerInstanceP,
|
|
137
|
+
]);
|
|
138
|
+
|
|
179
139
|
/** @type {import('../../src/vaultFactory/vaultFactory').VaultFactoryContract['privateArgs']} */
|
|
180
140
|
const newPrivateArgs = harden({
|
|
181
141
|
...privateArgs,
|
|
182
|
-
|
|
183
|
-
auctioneerInstance: auctioneerKit.instance,
|
|
142
|
+
auctioneerInstance,
|
|
184
143
|
initialPoserInvitation: poserInvitation,
|
|
185
144
|
initialShortfallInvitation: shortfallInvitation,
|
|
186
145
|
managerParams: managerParamValues,
|
|
@@ -195,60 +154,7 @@ export const upgradeVaults = async (powers, { options }) => {
|
|
|
195
154
|
trace('upgraded vaultFactory.', upgradeResult);
|
|
196
155
|
};
|
|
197
156
|
|
|
198
|
-
|
|
199
|
-
void E.when(
|
|
200
|
-
any(
|
|
201
|
-
Object.values(vaultBrands).map(async brand => {
|
|
202
|
-
const getQuote = async lastRejectionReason => {
|
|
203
|
-
await null;
|
|
204
|
-
try {
|
|
205
|
-
return await E(priceAuthority).quoteGiven(
|
|
206
|
-
AmountMath.make(brand, 10n),
|
|
207
|
-
istBrand,
|
|
208
|
-
);
|
|
209
|
-
} catch (reason) {
|
|
210
|
-
if (
|
|
211
|
-
isUpgradeDisconnection(reason) &&
|
|
212
|
-
(!lastRejectionReason ||
|
|
213
|
-
reason.incarnationNumber >
|
|
214
|
-
lastRejectionReason.incarnationNumber)
|
|
215
|
-
) {
|
|
216
|
-
return getQuote(reason);
|
|
217
|
-
}
|
|
218
|
-
throw reason;
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
return getQuote(null);
|
|
222
|
-
}),
|
|
223
|
-
),
|
|
224
|
-
async price => {
|
|
225
|
-
trace(`upgrading after delay`, price);
|
|
226
|
-
await upgradeVaultFactory();
|
|
227
|
-
auctioneerKitProducer.reset();
|
|
228
|
-
// @ts-expect-error auctioneerKit is non-null except between auctioneerKitProducer.reset() and auctioneerKitProducer.resolve()
|
|
229
|
-
auctioneerKitProducer.resolve(auctioneerKit);
|
|
230
|
-
auctioneerProducer.reset();
|
|
231
|
-
// @ts-expect-error auctioneerKit is non-null except between auctioneerKitProducer.reset() and auctioneerKitProducer.resolve()
|
|
232
|
-
auctioneerProducer.resolve(auctioneerKit.instance);
|
|
233
|
-
// We wanted it to be valid for only a short while.
|
|
234
|
-
tempAuctioneerKit.reset();
|
|
235
|
-
await E(E(agoricNamesAdmin).lookupAdmin('instance')).update(
|
|
236
|
-
'auctioneer',
|
|
237
|
-
// @ts-expect-error auctioneerKit is non-null except between auctioneerKitProducer.reset() and auctioneerKitProducer.resolve()
|
|
238
|
-
auctioneerKit.instance,
|
|
239
|
-
);
|
|
240
|
-
trace(`upgrading complete`, price);
|
|
241
|
-
},
|
|
242
|
-
error => {
|
|
243
|
-
console.error(
|
|
244
|
-
'Failed to upgrade vaultFactory',
|
|
245
|
-
error.message,
|
|
246
|
-
...(error.errors || []),
|
|
247
|
-
);
|
|
248
|
-
},
|
|
249
|
-
);
|
|
250
|
-
|
|
251
|
-
console.log(`upgradeVaults scheduled; waiting for priceFeeds`);
|
|
157
|
+
await upgradeVaultFactory();
|
|
252
158
|
};
|
|
253
159
|
|
|
254
160
|
const uV = 'upgradeVaults';
|
|
@@ -265,22 +171,17 @@ export const getManifestForUpgradeVaults = async (
|
|
|
265
171
|
manifest: {
|
|
266
172
|
[upgradeVaults.name]: {
|
|
267
173
|
consume: {
|
|
268
|
-
agoricNamesAdmin: uV,
|
|
269
|
-
newAuctioneerKit: uV,
|
|
270
174
|
economicCommitteeCreatorFacet: uV,
|
|
271
|
-
priceAuthority: uV,
|
|
272
175
|
reserveKit: uV,
|
|
273
176
|
vaultFactoryKit: uV,
|
|
274
|
-
board: uV,
|
|
275
177
|
zoe: uV,
|
|
276
178
|
auctionsUpgradeComplete: uV,
|
|
277
179
|
},
|
|
278
|
-
produce: {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
auctionsUpgradeComplete: uV,
|
|
180
|
+
produce: { auctionsUpgradeComplete: uV },
|
|
181
|
+
installation: {
|
|
182
|
+
produce: { VaultFactory: true },
|
|
282
183
|
},
|
|
283
|
-
instance: {
|
|
184
|
+
instance: { consume: { auctioneer: uV } },
|
|
284
185
|
},
|
|
285
186
|
},
|
|
286
187
|
options: { ...vaultUpgradeOptions },
|