Skip to content

Commit

Permalink
fix(governance): some governance invitations use proposal patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Aug 29, 2023
1 parent eb2d030 commit 2df9334
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
14 changes: 10 additions & 4 deletions packages/governance/src/committee.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { E } from '@endo/eventual-send';

import { StorageNodeShape } from '@agoric/internal';
import { prepareExo, provideDurableMapStore } from '@agoric/vat-data';
import { EmptyProposalShape } from '@agoric/zoe/src/typeGuards.js';
import {
getOpenQuestions,
getPoserInvitation,
Expand Down Expand Up @@ -79,10 +80,15 @@ export const start = (zcf, privateArgs, baggage) => {
// This will produce unique descriptions because
// makeCommitteeVoterInvitation() is only called within the following loop,
// which is only called once per Electorate.
return zcf.makeInvitation(seat => {
seat.exit();
return makeVoterKit(index);
}, `Voter${index}`);
return zcf.makeInvitation(
seat => {
seat.exit();
return makeVoterKit(index);
},
`Voter${index}`,
undefined,
EmptyProposalShape,
);
};

const { committeeName, committeeSize } = zcf.getTerms();
Expand Down
8 changes: 7 additions & 1 deletion packages/governance/src/electorateTools.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { EmptyProposalShape } from '@agoric/zoe/src/typeGuards.js';
import { E } from '@endo/eventual-send';
import { deeplyFulfilled, Far } from '@endo/marshal';

Expand Down Expand Up @@ -95,7 +96,12 @@ const getPoserInvitation = (zcf, addQuestion) => {
seat.exit();
return Far(`questionPoser`, { addQuestion });
};
return zcf.makeInvitation(questionPoserHandler, `questionPoser`);
return zcf.makeInvitation(
questionPoserHandler,
`questionPoser`,
undefined,
EmptyProposalShape,
);
};

harden(startCounter);
Expand Down
3 changes: 3 additions & 0 deletions packages/governance/src/noActionElectorate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { makePublishKit } from '@agoric/notifier';
import { makePromiseKit } from '@endo/promise-kit';
import { makeExo } from '@agoric/store';
import { EmptyProposalShape } from '@agoric/zoe/src/typeGuards.js';

import { ElectoratePublicI, ElectorateCreatorI } from './typeGuards.js';

Expand Down Expand Up @@ -40,6 +41,8 @@ const start = zcf => {
return zcf.makeInvitation(
() => {},
`noActionElectorate doesn't allow posing questions`,
undefined,
EmptyProposalShape,
);
},
addQuestion(_instance, _question) {
Expand Down

0 comments on commit 2df9334

Please sign in to comment.