diff --git a/packages/governance/src/committee.js b/packages/governance/src/committee.js index 80f9fb19449c..e4b0cb986f7c 100644 --- a/packages/governance/src/committee.js +++ b/packages/governance/src/committee.js @@ -5,6 +5,7 @@ import { makeStore, makeHeapFarInstance, M } from '@agoric/store'; import { natSafeMath } from '@agoric/zoe/src/contractSupport/index.js'; import { E } from '@endo/eventual-send'; +import { EmptyProposal } from '@agoric/zoe/src/typeGuards.js'; import { makeHandle } from '@agoric/zoe/src/makeHandle.js'; import { getOpenQuestions, @@ -98,7 +99,12 @@ const start = (zcf, privateArgs) => { return E(voteCap).submitVote(voterHandle, positions, 1n); }; - return zcf.makeInvitation(continuingVoteHandler, 'vote'); + return zcf.makeInvitation( + continuingVoteHandler, + 'vote', + undefined, + EmptyProposal, + ); }, }, ), @@ -109,7 +115,12 @@ const start = (zcf, privateArgs) => { // This will produce unique descriptions because // makeCommitteeVoterInvitation() is only called within the following loop, // which is only called once per Electorate. - return zcf.makeInvitation(offerHandler, `Voter${index}`); + return zcf.makeInvitation( + offerHandler, + `Voter${index}`, + undefined, + EmptyProposal, + ); }; const { committeeName, committeeSize } = zcf.getTerms(); diff --git a/packages/governance/src/electorateTools.js b/packages/governance/src/electorateTools.js index be9db4e1d2f4..0f9a06b9c1fd 100644 --- a/packages/governance/src/electorateTools.js +++ b/packages/governance/src/electorateTools.js @@ -1,5 +1,6 @@ // @ts-check +import { EmptyProposal } from '@agoric/zoe/src/typeGuards'; import { E } from '@endo/eventual-send'; import { deeplyFulfilled, Far } from '@endo/marshal'; @@ -88,7 +89,12 @@ const getQuestion = (questionHandleP, questionStore) => */ const getPoserInvitation = (zcf, addQuestion) => { const questionPoserHandler = () => Far(`questionPoser`, { addQuestion }); - return zcf.makeInvitation(questionPoserHandler, `questionPoser`); + return zcf.makeInvitation( + questionPoserHandler, + `questionPoser`, + undefined, + EmptyProposal, + ); }; harden(startCounter); diff --git a/packages/governance/src/noActionElectorate.js b/packages/governance/src/noActionElectorate.js index aea932adc1eb..7f706e88cd1e 100644 --- a/packages/governance/src/noActionElectorate.js +++ b/packages/governance/src/noActionElectorate.js @@ -3,6 +3,7 @@ import { makePublishKit } from '@agoric/notifier'; import { makePromiseKit } from '@endo/promise-kit'; import { makeHeapFarInstance } from '@agoric/store'; +import { EmptyProposal } from '@agoric/zoe/src/typeGuards.js'; import { ElectoratePublicI, ElectorateCreatorI } from './typeGuards.js'; @@ -39,8 +40,12 @@ const start = zcf => { const creatorFacet = makeHeapFarInstance('creatorFacet', ElectorateCreatorI, { getPoserInvitation() { - return zcf.makeInvitation(() => {}, - `noActionElectorate doesn't allow posing questions`); + return zcf.makeInvitation( + () => {}, + `noActionElectorate doesn't allow posing questions`, + undefined, + EmptyProposal, + ); }, addQuestion(_instance, _question) { throw Error(`noActionElectorate doesn't add questions.`); diff --git a/packages/inter-protocol/src/psm/psm.js b/packages/inter-protocol/src/psm/psm.js index 95730750c2be..b1978189a99a 100644 --- a/packages/inter-protocol/src/psm/psm.js +++ b/packages/inter-protocol/src/psm/psm.js @@ -277,9 +277,11 @@ export const start = async (zcf, privateArgs, baggage) => { wantmintedHook, 'wantMinted', undefined, - M.split({ + harden({ give: { In: anchorAmountShape }, want: M.or({ Out: stableAmountShape }, {}), + multiples: 1n, + exit: M.any(), }), ); }, @@ -288,9 +290,11 @@ export const start = async (zcf, privateArgs, baggage) => { giveMintedHook, 'giveMinted', undefined, - M.split({ + harden({ give: { In: stableAmountShape }, want: M.or({ Out: anchorAmountShape }, {}), + multiples: 1n, + exit: M.any(), }), ); }, diff --git a/packages/inter-protocol/src/psm/psmCharter.js b/packages/inter-protocol/src/psm/psmCharter.js index 5bbff37e0a6e..714a1faef47c 100644 --- a/packages/inter-protocol/src/psm/psmCharter.js +++ b/packages/inter-protocol/src/psm/psmCharter.js @@ -4,7 +4,10 @@ import '@agoric/governance/src/exported.js'; import { makeScalarMapStore, M, makeHeapFarInstance, fit } from '@agoric/store'; import '@agoric/zoe/exported.js'; import '@agoric/zoe/src/contracts/exported.js'; -import { InstanceHandleShape } from '@agoric/zoe/src/typeGuards.js'; +import { + EmptyProposal, + InstanceHandleShape, +} from '@agoric/zoe/src/typeGuards.js'; import { BrandShape } from '@agoric/ertp'; import { TimestampShape } from '@agoric/swingset-vat/src/vats/timer/typeGuards.js'; import { E } from '@endo/far'; @@ -68,7 +71,12 @@ export const start = async zcf => { }); }; - return zcf.makeInvitation(voteOnParamChanges, 'vote on param changes'); + return zcf.makeInvitation( + voteOnParamChanges, + 'vote on param changes', + undefined, + EmptyProposal, + ); }; const makeOfferFilterInvitation = (instance, strings, deadline) => { @@ -79,7 +87,12 @@ export const start = async zcf => { return E(psmGovernor).voteOnOfferFilter(counter, deadline, strings); }; - return zcf.makeInvitation(voteOnOfferFilterHandler, 'vote on offer filter'); + return zcf.makeInvitation( + voteOnOfferFilterHandler, + 'vote on offer filter', + undefined, + EmptyProposal, + ); }; const MakerShape = M.interface('PSM Charter InvitationMakers', { @@ -129,6 +142,8 @@ export const start = async zcf => { zcf.makeInvitation( charterMemberHandler, 'PSM charter member invitation', + undefined, + EmptyProposal, ), }, ); diff --git a/packages/inter-protocol/test/psm/test-psm.js b/packages/inter-protocol/test/psm/test-psm.js index b8c3e40731b7..015a10447e77 100644 --- a/packages/inter-protocol/test/psm/test-psm.js +++ b/packages/inter-protocol/test/psm/test-psm.js @@ -624,7 +624,7 @@ test('wrong give giveMintedInvitation', async t => { ), { message: - '"giveMinted" proposal: required-parts: give: In: brand: "[Alleged: aUSD brand]" - Must be: "[Alleged: IST brand]"', + '"giveMinted" proposal: give: In: brand: "[Alleged: aUSD brand]" - Must be: "[Alleged: IST brand]"', }, ); }); @@ -654,7 +654,7 @@ test('wrong give wantMintedInvitation', async t => { ), { message: - '"wantMinted" proposal: required-parts: give: In: brand: "[Alleged: IST brand]" - Must be: "[Alleged: aUSD brand]"', + '"wantMinted" proposal: give: In: brand: "[Alleged: IST brand]" - Must be: "[Alleged: aUSD brand]"', }, ); }); @@ -676,7 +676,7 @@ test('extra give wantMintedInvitation', async t => { ), { message: - '"wantMinted" proposal: required-parts: give: {"Extra":{"brand":"[Alleged: aUSD brand]","value":"[200000000n]"},"In":{"brand":"[Seen]","value":"[200000000n]"}} - Must not have unexpected properties: ["Extra"]', + '"wantMinted" proposal: give: {"Extra":{"brand":"[Alleged: aUSD brand]","value":"[200000000n]"},"In":{"brand":"[Seen]","value":"[200000000n]"}} - Must not have unexpected properties: ["Extra"]', }, ); }); diff --git a/packages/zoe/src/contractSupport/zoeHelpers.js b/packages/zoe/src/contractSupport/zoeHelpers.js index 2ff5303827fd..98cbe24ce7e3 100644 --- a/packages/zoe/src/contractSupport/zoeHelpers.js +++ b/packages/zoe/src/contractSupport/zoeHelpers.js @@ -1,7 +1,7 @@ // @ts-check import '../../exported.js'; -import { fit, keyEQ } from '@agoric/store'; +import { fit, keyEQ, M } from '@agoric/store'; import { E } from '@endo/eventual-send'; import { makePromiseKit } from '@endo/promise-kit'; import { AssetKind } from '@agoric/ertp'; @@ -219,6 +219,13 @@ export const depositToSeat = async (zcf, recipientSeat, amounts, payments) => { const invitation = zcf.makeInvitation( reallocateAfterDeposit, 'temporary seat for deposit', + undefined, + harden({ + give: M.any(), + want: {}, + multiples: 1n, + exit: { onDemand: null }, + }), ); const proposal = harden({ give: amounts }); harden(payments); diff --git a/packages/zoe/src/typeGuards.js b/packages/zoe/src/typeGuards.js index 2eb5fec8b21a..4e5629f9368b 100644 --- a/packages/zoe/src/typeGuards.js +++ b/packages/zoe/src/typeGuards.js @@ -45,6 +45,12 @@ export const FullProposalShape = harden({ }); /** @see {Proposal} type */ export const ProposalShape = M.partial(FullProposalShape); +export const EmptyProposal = harden({ + give: {}, + want: {}, + multiples: 1n, + exit: { onDemand: null }, +}); export const isOnDemandExitRule = exit => { const [exitKey] = Object.getOwnPropertyNames(exit);