From 730b349ee23de4dac88243ef58b979969d25afae Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 23 May 2024 13:57:26 -0700 Subject: [PATCH] test: improve privateArgsShape --- .../orchestration/src/examples/stakeAtom.contract.js | 5 +++-- .../src/examples/swapExample.contract.js | 11 ++++++----- packages/orchestration/src/facade.js | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/orchestration/src/examples/stakeAtom.contract.js b/packages/orchestration/src/examples/stakeAtom.contract.js index 4c87f855f74..ff189ee10d4 100644 --- a/packages/orchestration/src/examples/stakeAtom.contract.js +++ b/packages/orchestration/src/examples/stakeAtom.contract.js @@ -3,6 +3,7 @@ */ import { makeTracer, StorageNodeShape } from '@agoric/internal'; +import { TimerServiceShape } from '@agoric/time'; import { V as E } from '@agoric/vow/vat.js'; import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport'; import { InvitationShape } from '@agoric/zoe/src/typeGuards.js'; @@ -22,8 +23,8 @@ export const meta = harden({ privateArgsShape: { orchestration: M.remotable('orchestration'), storageNode: StorageNodeShape, - marshaller: M.remotable('Marshaller'), - timer: M.remotable('TimerService'), + marshaller: M.remotable('marshaller'), + timer: TimerServiceShape, }, }); export const privateArgsShape = meta.privateArgsShape; diff --git a/packages/orchestration/src/examples/swapExample.contract.js b/packages/orchestration/src/examples/swapExample.contract.js index 3c2a0ff8f59..ac63c9c75bd 100644 --- a/packages/orchestration/src/examples/swapExample.contract.js +++ b/packages/orchestration/src/examples/swapExample.contract.js @@ -1,4 +1,5 @@ import { StorageNodeShape } from '@agoric/internal'; +import { TimerServiceShape } from '@agoric/time'; import { withdrawFromSeat } from '@agoric/zoe/src/contractSupport/zoeHelpers.js'; import { Far } from '@endo/far'; import { deeplyFulfilled } from '@endo/marshal'; @@ -18,10 +19,10 @@ import { orcUtils } from '../utils/orc.js'; /** @type {ContractMeta} */ export const meta = { privateArgsShape: { - localchain: M.any(), - orchestrationService: M.any(), + localchain: M.remotable('localchain'), + orchestrationService: M.or(M.remotable('orchestration'), null), storageNode: StorageNodeShape, - timerService: M.any(), + timerService: M.or(TimerServiceShape, null), zone: M.any(), }, upgradability: 'canUpgrade', @@ -41,9 +42,9 @@ export const makeNatAmountShape = (brand, min) => * @param {ZCF} zcf * @param {{ * localchain: Remote; - * orchestrationService: Remote; + * orchestrationService: Remote | null; * storageNode: Remote; - * timerService: Remote; + * timerService: Remote | null; * zone: Zone; * }} privateArgs */ diff --git a/packages/orchestration/src/facade.js b/packages/orchestration/src/facade.js index 5734d3c9dce..c905534ca18 100644 --- a/packages/orchestration/src/facade.js +++ b/packages/orchestration/src/facade.js @@ -134,10 +134,10 @@ const makeRemoteChainFacade = name => { * * @param {{ * zone: Zone; - * timerService: Remote; + * timerService: Remote | null; * zcf: ZCF; * storageNode: Remote; - * orchestrationService: Remote; + * orchestrationService: Remote | null; * localchain: Remote; * }} powers */