Skip to content

Commit

Permalink
chore: restrict makeInvitation handler to passable
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Sep 13, 2024
1 parent b38b7f3 commit 45d0812
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/orchestration/src/exos/zcf-for-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { M } from '@endo/patterns';
export const ZcfForFlowsI = M.interface(
'ZCF',
{
makeInvitation: M.call(M.raw(), M.string())
makeInvitation: M.call(M.remotable('OfferHandler'), M.string())
.optional(M.record(), M.pattern())
.returns(VowShape),
},
Expand Down
12 changes: 5 additions & 7 deletions packages/orchestration/test/exos/zcf-for-flows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,12 @@ test('changed: makeInvitation: watch promise', async t => {
t.like(amt, { value: [{ description: 'trade' }] });
});

test('changed: makeInvitation: non-passable handler', async t => {
const { zoe, zcf, zcfLtd, vt } = t.context;

const toTradeVow = zcfLtd.makeInvitation(_seat => {}, 'trade');
test('removed: makeInvitation: non-passable handler', async t => {
const { zcfLtd } = t.context;

const toTrade = await vt.when(toTradeVow);
const amt = await E(E(zoe).getInvitationIssuer()).getAmountOf(toTrade);
t.like(amt, { value: [{ description: 'trade' }] });
t.throws(() => zcfLtd.makeInvitation(_seat => {}, 'trade'), {
message: /Remotables must be explicitly declared/,
});
});

test('changed: makeZCFMint - watch', async t => {
Expand Down

0 comments on commit 45d0812

Please sign in to comment.