Skip to content

Commit

Permalink
chore: code for including governors
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Sep 23, 2024
1 parent c4e1ae9 commit 0c38de5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions packages/inter-protocol/test/psm/gov-replace-committee.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,41 @@ const startNewEconCharter = async ({
};
harden(startNewEconCharter);

const addGovernorsToEconCharter = async ({
consume: { reserveKit, vaultFactoryKit, econCharterKit, auctioneerKit },
instance: {
consume: { reserve, VaultFactory, auctioneer },
},
}) => {
const { creatorFacet } = E.get(econCharterKit);

await Promise.all(
[
{
label: 'reserve',
instanceP: reserve,
facetP: E.get(reserveKit).governorCreatorFacet,
},
{
label: 'VaultFactory',
instanceP: VaultFactory,
facetP: E.get(vaultFactoryKit).governorCreatorFacet,
},
{
label: 'auctioneer',
instanceP: auctioneer,
facetP: E.get(auctioneerKit).governorCreatorFacet,
},
].map(async ({ label, instanceP, facetP }) => {
const [instance, govFacet] = await Promise.all([instanceP, facetP]);

return E(creatorFacet).addInstance(instance, govFacet, label);
}),
);
};

harden(addGovernorsToEconCharter);

const main = async permittedPowers => {
const newElectoratePoser = await startNewEconomicCommittee(permittedPowers);
await startNewEconCharter(permittedPowers);
Expand Down

0 comments on commit 0c38de5

Please sign in to comment.