Skip to content

Commit

Permalink
fixup! chore: punt on exo for zcfTools
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Sep 19, 2024
1 parent 229c605 commit 81b621a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/orchestration/src/utils/zcf-tools.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { VowShape } from '@agoric/vow';

/**
* @import {HostInterface, HostOf} from '@agoric/async-flow';
* @import {VowTools} from '@agoric/vow';
* @import {Zone} from '@agoric/zone';
* @import {ZcfTools} from '../types.js';
*/

import { M } from '@endo/patterns';
import { M, mustMatch } from '@endo/patterns';

const HandlerShape = M.remotable('OfferHandler');

/**
* @param {ZCF} zcf
Expand All @@ -18,6 +17,7 @@ export const makeZcfTools = (zcf, vowTools) => {
const zcfForFlows = harden({
/** @type {HostOf<ZCF['makeInvitation']>} */
makeInvitation(offerHandler, description, customDetails, proposalShape) {
mustMatch(offerHandler, HandlerShape);
return vowTools.watch(
zcf.makeInvitation(
offerHandler,
Expand Down
3 changes: 2 additions & 1 deletion packages/orchestration/test/utils/zcf-tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ test('changed: makeInvitation: watch promise', async t => {
test('removed: makeInvitation: non-passable handler', async t => {
const { zcfTools } = t.context;

t.throws(() => zcfTools.makeInvitation(_seat => {}, 'trade'), {
const handler = harden(_seat => {});
t.throws(() => zcfTools.makeInvitation(handler, 'trade'), {
message: /Remotables must be explicitly declared/,
});
});

0 comments on commit 81b621a

Please sign in to comment.