From fec4ab10af3aaa4180ce9064f600b8dcedbd5a16 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Thu, 19 Sep 2024 13:34:10 -0500 Subject: [PATCH] fixup! chore: punt on exo for zcfTools --- packages/orchestration/src/utils/zcf-tools.js | 7 ++++--- packages/orchestration/test/utils/zcf-tools.test.ts | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/orchestration/src/utils/zcf-tools.js b/packages/orchestration/src/utils/zcf-tools.js index 9cb677ca720..b825d5f2e58 100644 --- a/packages/orchestration/src/utils/zcf-tools.js +++ b/packages/orchestration/src/utils/zcf-tools.js @@ -1,5 +1,3 @@ -import { VowShape } from '@agoric/vow'; - /** * @import {HostInterface, HostOf} from '@agoric/async-flow'; * @import {VowTools} from '@agoric/vow'; @@ -7,7 +5,9 @@ import { VowShape } from '@agoric/vow'; * @import {ZcfTools} from '../types.js'; */ -import { M } from '@endo/patterns'; +import { M, mustMatch } from '@endo/patterns'; + +const HandlerShape = M.remotable('OfferHandler'); /** * @param {ZCF} zcf @@ -18,6 +18,7 @@ export const makeZcfTools = (zcf, vowTools) => { const zcfForFlows = harden({ /** @type {HostOf} */ makeInvitation(offerHandler, description, customDetails, proposalShape) { + mustMatch(offerHandler, HandlerShape); return vowTools.watch( zcf.makeInvitation( offerHandler, diff --git a/packages/orchestration/test/utils/zcf-tools.test.ts b/packages/orchestration/test/utils/zcf-tools.test.ts index 61f699233f8..510921a9497 100644 --- a/packages/orchestration/test/utils/zcf-tools.test.ts +++ b/packages/orchestration/test/utils/zcf-tools.test.ts @@ -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/, }); });