Skip to content

Commit

Permalink
chore: re-assign auctioneerKit * auction instance at vault upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Mar 29, 2024
1 parent 627e966 commit ef96d51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/inter-protocol/src/proposals/add-auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export const addAuction = async ({
),
);

// don't overwrite auctioneerKit yet
newAuctioneerKit.resolve(
harden({
label: 'auctioneer',
Expand All @@ -139,7 +138,8 @@ export const addAuction = async ({
governorAdminFacet: governorStartResult.adminFacet,
}),
);
// don't replace auction instance yet.
// don't overwrite auctioneerKit or auction instance yet. Wait until
// upgrade-vault.js
};

export const ADD_AUCTION_MANIFEST = harden({
Expand Down
18 changes: 15 additions & 3 deletions packages/inter-protocol/src/proposals/upgrade-vaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ export const upgradeVaults = async (powers, { options }) => {
const {
consume: {
agoricNamesAdmin,
auctioneerKit: auctioneerKitP,
newAuctioneerKit: auctioneerKitP,
priceAuthority,
vaultFactoryKit,
zoe,
economicCommitteeCreatorFacet: electorateCreatorFacet,
reserveKit,
},
produce: { auctioneerKit: auctioneerKitProducer },
instance: {
produce: { auctioneer: auctioneerProducer },
},
} = powers;
const { vaultsRef } = options;
const kit = await vaultFactoryKit;
Expand Down Expand Up @@ -128,7 +132,13 @@ export const upgradeVaults = async (powers, { options }) => {
E(priceAuthority).quoteGiven(AmountMath.make(brand, 10n), istBrand),
),
),
() => upgradeVaultFactory(),
async () => {
await upgradeVaultFactory();
auctioneerKitProducer.reset();
auctioneerKitProducer.resolve(auctioneerKit);
auctioneerProducer.reset();
auctioneerProducer.resolve(auctioneerKit.instance);
},
);

console.log(`upgradeVaults scheduled; waiting for priceFeeds`);
Expand All @@ -149,14 +159,16 @@ export const getManifestForUpgradeVaults = async (
[upgradeVaults.name]: {
consume: {
agoricNamesAdmin: t,
auctioneerKit: t,
newAuctioneerKit: t,
economicCommitteeCreatorFacet: t,
priceAuthority: t,
reserveKit: t,
vaultFactoryKit: t,
board: t,
zoe: t,
},
produce: { auctioneerKit: t },
instance: { produce: { auctioneer: t } },
},
},
options: { ...vaultUpgradeOptions },
Expand Down

0 comments on commit ef96d51

Please sign in to comment.