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

Save the contractKit for the auctioneer before overwriting it #10694

Merged
merged 3 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const trace = makeTracer('RecordedRetired', true);
export const testRecordedRetiredInstances = async ({
consume: {
contractKits,
// governedContractKits,
governedContractKits,
retiredContractInstances: retiredContractInstancesP,
},
}) => {
Expand All @@ -26,8 +26,7 @@ export const testRecordedRetiredInstances = async ({
assert(auctionIDs.length === 1);
const auctionInstance = retiredContractInstances.get(auctionIDs[0]);
trace({ auctionInstance });
// I don't know why it's neither in governedContractKits nor contractKits
// assert(await E(governedContractKits).get(auctionInstance));
assert(await E(governedContractKits).get(auctionInstance));
Copy link
Member

Choose a reason for hiding this comment

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

glad we had this test ready to go, let's figure out later why it got commented out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I commented it out, because I thought the important thing was saving the instance.


const committeeIDs = Array.from(retiredContractInstances.keys()).filter(k =>
k.startsWith('economicCommittee'),
Expand All @@ -47,7 +46,7 @@ export const getManifestForRecordedRetiredInstances = () => {
[testRecordedRetiredInstances.name]: {
consume: {
contractKits: true,
// governedContractKits: true,
governedContractKits: true,
retiredContractInstances: true,
},
},
Expand Down
15 changes: 14 additions & 1 deletion packages/inter-protocol/src/proposals/add-auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,20 @@ export const addAuction = async (
produceRetiredInstances,
);

const governedContractKits = await governedContractKitsP;
trace('has', governedContractKits.has(legacyKit.instance));
if (governedContractKits.has(legacyKit.instance)) {
// bootstrap tests start having already run this upgrade. Actual upgrades on
// mainNet or testnets should start with the promiseSpace post upgrade-17,
// which doesn't have this entry in the map.
trace(
'⚠️ WARNING: not expected during chain upgrade. It IS normal during bootstrap tests',
);
} else {
// @ts-expect-error The original auctioneerKit had everything it needs
governedContractKits.init(legacyKit.instance, legacyKit);
}

// save the auctioneer instance so we can manage it later
const boardID = await E(board).getId(legacyKit.instance);
const identifier = `auctioneer-${boardID}`;
Expand Down Expand Up @@ -205,7 +219,6 @@ export const addAuction = async (
governedInstance,
);

const governedContractKits = await governedContractKitsP;
governedContractKits.init(kit.instance, kit);
auctionUpgradeNewInstance.resolve(governedInstance);
auctionUpgradeNewGovCreator.resolve(kit.governorCreatorFacet);
Expand Down
Loading