Skip to content

Commit

Permalink
feat: introduce each PSM to the provisionPool
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Sep 9, 2022
1 parent 97a90f2 commit a3da596
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions packages/inter-protocol/src/proposals/startPSM.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const startPSM = async (
feeMintAccess: feeMintAccessP,
economicCommitteeCreatorFacet,
psmCharterCreatorFacet,
provisionPoolStartResult,
chainStorage,
chainTimerService,
psmFacets,
Expand Down Expand Up @@ -162,13 +163,20 @@ export const startPSM = async (
psmFacetsMap.init(anchorBrand, newPsmFacets);
const instanceKey = `psm-${Stable.symbol}-${keyword}`;
const instanceAdmin = E(agoricNamesAdmin).lookupAdmin('instance');
await E(instanceAdmin).update(instanceKey, newPsmFacets.psm);
await E(psmCharterCreatorFacet).addInstance(
psm,
psmCreatorFacet,
anchorBrand,
stable,
);

await Promise.all([
E(instanceAdmin).update(instanceKey, newPsmFacets.psm),
E(psmCharterCreatorFacet).addInstance(
psm,
psmCreatorFacet,
anchorBrand,
stable,
),
E(E.get(provisionPoolStartResult).creatorFacet).initPSM(
anchorBrand,
newPsmFacets.psm,
),
]);
};
harden(startPSM);

Expand Down Expand Up @@ -359,6 +367,7 @@ export const PSM_MANIFEST = harden({
zoe: 'zoe',
feeMintAccess: 'zoe',
economicCommitteeCreatorFacet: 'economicCommittee',
provisionPoolStartResult: true,
psmCharterCreatorFacet: 'psmCharter',
chainTimerService: 'timer',
psmFacets: true,
Expand Down

0 comments on commit a3da596

Please sign in to comment.