diff --git a/packages/async-flow/src/async-flow.js b/packages/async-flow/src/async-flow.js index cf20b8365785..fda11571b770 100644 --- a/packages/async-flow/src/async-flow.js +++ b/packages/async-flow/src/async-flow.js @@ -2,8 +2,12 @@ import { annotateError, Fail, makeError, q, X } from '@endo/errors'; import { E } from '@endo/eventual-send'; import { M } from '@endo/patterns'; import { makeScalarWeakMapStore } from '@agoric/store'; -import { PromiseWatcherI } from '@agoric/base-zone'; -import { prepareVowTools, toPassableCap, VowShape } from '@agoric/vow'; +import { + prepareVowTools, + toPassableCap, + ReactionGuard, + VowShape, +} from '@agoric/vow'; import { makeReplayMembrane } from './replay-membrane.js'; import { prepareLogStore } from './log-store.js'; import { prepareBijection } from './bijection.js'; @@ -36,7 +40,10 @@ const AsyncFlowIKit = harden({ complete: M.call().returns(), panic: M.call(M.error()).returns(M.not(M.any())), // only throws }), - wakeWatcher: PromiseWatcherI, + wakeWatcher: M.interface('WakeWatcher', { + onFulfilled: ReactionGuard, + onRejected: ReactionGuard, + }), }); const AdminAsyncFlowI = M.interface('AsyncFlowAdmin', { diff --git a/packages/base-zone/src/watch-promise.js b/packages/base-zone/src/watch-promise.js index 4693bd98377b..48ef69c49e60 100644 --- a/packages/base-zone/src/watch-promise.js +++ b/packages/base-zone/src/watch-promise.js @@ -7,7 +7,7 @@ const { Fail } = assert; const { apply } = Reflect; /** - * A PromiseWatcher method guard callable with or more arguments, returning void. + * A PromiseWatcher method guard callable with one or more arguments, returning void. */ export const PromiseWatcherHandler = M.call(M.any()).rest(M.any()).returns(); diff --git a/packages/network/package.json b/packages/network/package.json index 6fdc9586e551..d226c3d9e36d 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -23,8 +23,7 @@ "dependencies": { "@agoric/assert": "^0.6.0", "@agoric/internal": "^0.3.2", - "@agoric/store": "^0.9.2", - "@agoric/vat-data": "^0.5.2", + "@agoric/vow": "^0.1.0", "@endo/base64": "^1.0.5", "@endo/far": "^1.1.2", "@endo/pass-style": "^1.4.0", @@ -32,9 +31,9 @@ "@endo/promise-kit": "^1.1.2" }, "devDependencies": { + "@agoric/store": "^0.9.2", "@agoric/swingset-liveslots": "^0.10.2", "@agoric/swingset-vat": "^0.32.2", - "@agoric/vow": "^0.1.0", "@agoric/zone": "^0.2.2", "@endo/bundle-source": "^3.2.3", "ava": "^5.3.0", diff --git a/packages/network/src/shapes.js b/packages/network/src/shapes.js index fab74462b3e1..3002502a700c 100644 --- a/packages/network/src/shapes.js +++ b/packages/network/src/shapes.js @@ -1,5 +1,6 @@ // @ts-check import { M } from '@endo/patterns'; +import { VowShape, Vow$ } from '@agoric/vow'; const Shape1 = /** @type {const} */ ({ /** @@ -9,12 +10,8 @@ const Shape1 = /** @type {const} */ ({ Data: M.string(), Bytes: M.string(), Endpoint: M.string(), - Vow: M.tagged( - 'Vow', - harden({ - vowV0: M.remotable('VowV0'), - }), - ), + Vow$, + Vow: VowShape, ConnectionHandler: M.remotable('ConnectionHandler'), Connection: M.remotable('Connection'), InboundAttempt: M.remotable('InboundAttempt'), @@ -27,7 +24,6 @@ const Shape1 = /** @type {const} */ ({ const Shape2 = /** @type {const} */ ({ ...Shape1, - Vow$: shape => M.or(shape, Shape1.Vow), AttemptDescription: M.splitRecord( { handler: Shape1.ConnectionHandler }, { remoteAddress: Shape1.Endpoint, localAddress: Shape1.Endpoint }, diff --git a/packages/vats/src/localchain.js b/packages/vats/src/localchain.js index 91f544bc39a1..7b529954430c 100644 --- a/packages/vats/src/localchain.js +++ b/packages/vats/src/localchain.js @@ -2,7 +2,7 @@ import { E } from '@endo/far'; import { M } from '@endo/patterns'; import { AmountShape, BrandShape, PaymentShape } from '@agoric/ertp'; -import { Shape as NetworkShape } from '@agoric/network'; +import { Vow$ } from '@agoric/vow'; const { Fail } = assert; const { Vow$ } = NetworkShape; diff --git a/packages/vats/src/transfer.js b/packages/vats/src/transfer.js index a9a04bd36a74..aa6991985087 100644 --- a/packages/vats/src/transfer.js +++ b/packages/vats/src/transfer.js @@ -1,6 +1,7 @@ // @ts-check import { E } from '@endo/far'; import { M } from '@endo/patterns'; +import { ReactionGuard } from '@agoric/vow'; import { VTRANSFER_IBC_EVENT } from '@agoric/internal'; import { coerceToByteSource, byteSourceToBase64 } from '@agoric/network'; import { TargetAppI, AppTransformerI } from './bridge-target.js'; @@ -11,12 +12,6 @@ import { TargetAppI, AppTransformerI } from './bridge-target.js'; const { Fail, bare } = assert; -/** - * The least possibly restrictive guard for a `watch` watcher's `onFulfilled` or - * `onRejected` reaction - */ -const ReactionGuard = M.call(M.any()).optional(M.any()).returns(M.any()); - /** * @param {import('@agoric/base-zone').Zone} zone * @param {import('@agoric/vow').VowTools} vowTools