Skip to content

Commit

Permalink
chore: reset the instance and charterKit
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Sep 23, 2024
1 parent 0c38de5 commit 3e6bd06
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions packages/inter-protocol/test/psm/gov-replace-committee.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,10 @@ const reserveThenDeposit = async (
console.info('confirmed deposit for', debugName);
};

const invitePSMCommitteeMembers = async (
{
consume: {
namesByAddressAdmin,
economicCommitteeCreatorFacet,
econCharterKit,
},
},
const inviteECMembers = async (
{ consume: { namesByAddressAdmin, economicCommitteeCreatorFacet } },
{ options: { voterAddresses = {} } },
) => {
console.log('fraz invitePSMCommitteeMembers');

const invitations = await E(
economicCommitteeCreatorFacet,
).getVoterInvitations();
Expand All @@ -117,16 +109,14 @@ const invitePSMCommitteeMembers = async (

await distributeInvitations(zip(values(voterAddresses), invitations));
};
harden(invitePSMCommitteeMembers);
harden(inviteECMembers);

const inviteToEconCharter = async (
{ consume: { namesByAddressAdmin, econCharterKit } },
{ options: { voterAddresses } },
) => {
const { creatorFacet } = E.get(econCharterKit);

// This doesn't resolve until the committee members create their smart wallets.
// Don't block bootstrap on it.
void Promise.all(
values(voterAddresses).map(async addr => {
const debugName = `econ charter member ${addr}`;
Expand Down Expand Up @@ -255,7 +245,10 @@ const startNewEconCharter = async ({
);
trace('Started new EC Charter Instance Successfully');

instanceP.reset();
instanceP.resolve(E.get(startResult).instance);

econCharterKit.reset();
econCharterKit.resolve(startResult);
};
harden(startNewEconCharter);
Expand Down Expand Up @@ -305,7 +298,7 @@ const main = async permittedPowers => {
);
await Promise.all(replacements);

await invitePSMCommitteeMembers(permittedPowers, {
await inviteECMembers(permittedPowers, {
options: { voterAddresses: runConfig.economicCommitteeAddresses },
});

Expand Down

0 comments on commit 3e6bd06

Please sign in to comment.