Skip to content

Commit

Permalink
refactor: rename auctionsDone flag, remove it after use
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Aug 19, 2024
1 parent 5cf1eac commit 8f6ed8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions packages/inter-protocol/src/proposals/add-auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const trace = makeTracer('NewAuction', true);

/**
* @typedef {PromiseSpaceOf<{
* auctionsDone: boolean;
* auctionsUpgradeComplete: boolean;
* }>} interlockPowers
*/

Expand All @@ -26,7 +26,7 @@ export const addAuction = async ({
economicCommitteeCreatorFacet: electorateCreatorFacet,
auctioneerKit: legacyKitP,
},
produce: { newAuctioneerKit, auctionsDone },
produce: { newAuctioneerKit, auctionsUpgradeComplete },
instance: {
consume: { reserve: reserveInstance },
},
Expand Down Expand Up @@ -153,7 +153,7 @@ export const addAuction = async ({
// don't overwrite auctioneerKit or auction instance yet. Wait until
// upgrade-vault.js

auctionsDone.resolve(true);
auctionsUpgradeComplete.resolve(true);
};

export const ADD_AUCTION_MANIFEST = harden({
Expand All @@ -169,7 +169,7 @@ export const ADD_AUCTION_MANIFEST = harden({
},
produce: {
newAuctioneerKit: true,
auctionsDone: true,
auctionsUpgradeComplete: true,
},
instance: {
consume: { reserve: true },
Expand Down
16 changes: 11 additions & 5 deletions packages/inter-protocol/src/proposals/upgrade-vaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const any = promises =>

/**
* @typedef {PromiseSpaceOf<{
* auctionsDone: boolean;
* auctionsUpgradeComplete: boolean;
* }>} interlockPowers
*/

Expand All @@ -51,11 +51,12 @@ export const upgradeVaults = async (powers, { options }) => {
zoe,
economicCommitteeCreatorFacet: electorateCreatorFacet,
reserveKit,
auctionsDone,
auctionsUpgradeComplete,
},
produce: {
auctioneerKit: auctioneerKitProducer,
newAuctioneerKit: tempAuctioneerKit,
auctionsUpgradeComplete: auctionsUpgradeCompleteProducer,
},
instance: {
produce: { auctioneer: auctioneerProducer },
Expand All @@ -77,7 +78,8 @@ export const upgradeVaults = async (powers, { options }) => {
*/
let installationP;

await auctionsDone;
await auctionsUpgradeComplete;
auctionsUpgradeCompleteProducer.reset();

if (vaultsRef) {
if (bundleID) {
Expand Down Expand Up @@ -271,9 +273,13 @@ export const getManifestForUpgradeVaults = async (
vaultFactoryKit: uV,
board: uV,
zoe: uV,
auctionsDone: uV,
auctionsUpgradeComplete: uV,
},
produce: {
auctioneerKit: uV,
newAuctioneerKit: uV,
auctionsUpgradeComplete: uV,
},
produce: { auctioneerKit: uV, newAuctioneerKit: uV },
instance: { produce: { auctioneer: uV, newAuctioneerKit: uV } },
},
},
Expand Down

0 comments on commit 8f6ed8d

Please sign in to comment.