Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get auction instance from promise space after auction startup completes #9940

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/inter-protocol/src/proposals/upgrade-vaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ export const upgradeVaults = async (
installation: {
produce: { VaultFactory: produceVaultInstallation },
},
instance: {
consume: { auctioneer: auctioneerInstanceP },
},
// We want the auction instance after auctionsUpgradeComplete resolves
instance: { consume: consumeInstance },
},
{ options },
) => {
Expand Down Expand Up @@ -131,9 +130,10 @@ export const upgradeVaults = async (
E.get(reserveKit).creatorFacet,
).makeShortfallReportingInvitation();

// we want the auctioneer instance after auctionsUpgradeComplete settles
const [poserInvitation, auctioneerInstance] = await Promise.all([
E(electorateCreatorFacet).getPoserInvitation(),
auctioneerInstanceP,
E.get(consumeInstance).auctioneer,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting approach.

This PromiseSpace synchronization technique is clearly "too clever by half", since I didn't catch that in code review earlier.

I did start to suggest checking that agoricNames got updated, but only for the installation. And just checking that the instance changed in agoricNames wouldn't tell us which instance the vaultFactory picked up.

]);

/** @type {import('../../src/vaultFactory/vaultFactory').VaultFactoryContract['privateArgs']} */
Expand Down Expand Up @@ -181,7 +181,7 @@ export const getManifestForUpgradeVaults = async (
installation: {
produce: { VaultFactory: true },
},
instance: { consume: { auctioneer: uV } },
instance: { consume: true },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Granting more authority is often suspicious... but all the instances here are intended to be widely shared anyway. So this is fine.

},
},
options: { ...vaultUpgradeOptions },
Expand Down
Loading