Skip to content

Commit

Permalink
Merge pull request #8257 from Agoric/mfig-floating-seats
Browse files Browse the repository at this point in the history
fix: properly exit floating `ZCFSeat` instances
  • Loading branch information
michaelfig authored Aug 25, 2023
2 parents 22c3573 + bb2edbd commit 45667f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/governance/src/electorateTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ const getQuestion = (questionHandleP, questionStore) =>
* @param {AddQuestion} addQuestion
*/
const getPoserInvitation = (zcf, addQuestion) => {
const questionPoserHandler = () => Far(`questionPoser`, { addQuestion });
const questionPoserHandler = seat => {
seat.exit();
return Far(`questionPoser`, { addQuestion });
};
return zcf.makeInvitation(questionPoserHandler, `questionPoser`);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/inter-protocol/src/price/fluxAggregatorKit.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export const prepareFluxAggregatorKit = async (
* @param {ZCFSeat} seat
*/
const offerHandler = async seat => {
seat.exit();
const { oracle } = await facets.creator.initOracle(oracleId);
const invitationMakers = Far('invitation makers', {
/** @param {import('./roundsManager.js').PriceRound} result */
Expand All @@ -269,7 +270,6 @@ export const prepareFluxAggregatorKit = async (
);
},
});
seat.exit();

return harden({
invitationMakers,
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/contracts/priceAggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ const start = async (zcf, privateArgs) => {
seat,
{ notifier: oracleNotifier, scaleValueOut = 1 } = {},
) => {
seat.exit();
const admin = await creatorFacet.initOracle(oracleKey);
const invitationMakers = Far('invitation makers', {
/** @param {ParsableNumber} price */
Expand All @@ -469,7 +470,6 @@ const start = async (zcf, privateArgs) => {
}, 'PushPrice');
},
});
seat.exit();

if (oracleNotifier) {
pushFromOracle(oracleNotifier, scaleValueOut, r =>
Expand Down

0 comments on commit 45667f5

Please sign in to comment.