diff --git a/packages/orchestration/src/examples/stakeBld.contract.js b/packages/orchestration/src/examples/stakeBld.contract.js index 66281b747ac7..2e9ab0199d07 100644 --- a/packages/orchestration/src/examples/stakeBld.contract.js +++ b/packages/orchestration/src/examples/stakeBld.contract.js @@ -10,6 +10,7 @@ import { E } from '@endo/far'; import { deeplyFulfilled } from '@endo/marshal'; import { M } from '@endo/patterns'; import { prepareLocalChainAccountKit } from '../exos/local-chain-account-kit.js'; +import { makeChainHub } from '../utils/chainHub.js'; /** * @import {NameHub} from '@agoric/vats'; @@ -44,19 +45,12 @@ export const start = async (zcf, privateArgs, baggage) => { privateArgs.marshaller, ); - // FIXME in a second incarnation we can't make a remote call before defining all kinds - // UNTIL https://github.com/Agoric/agoric-sdk/issues/8879 - const agoricChainInfo = await E(privateArgs.agoricNames).lookup( - 'chain', - 'agoric', - ); - const makeLocalChainAccountKit = prepareLocalChainAccountKit( zone, makeRecorderKit, zcf, privateArgs.timerService, - agoricChainInfo, + makeChainHub(privateArgs.agoricNames), ); async function makeLocalAccountKit() { diff --git a/packages/orchestration/src/examples/swapExample.contract.js b/packages/orchestration/src/examples/swapExample.contract.js index 448663f7eb1a..34c0f83a16e1 100644 --- a/packages/orchestration/src/examples/swapExample.contract.js +++ b/packages/orchestration/src/examples/swapExample.contract.js @@ -5,8 +5,11 @@ import { makeDurableZone } from '@agoric/zone/durable.js'; import { Far } from '@endo/far'; import { deeplyFulfilled } from '@endo/marshal'; import { M, objectMap } from '@endo/patterns'; +import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js'; import { makeOrchestrationFacade } from '../facade.js'; import { orcUtils } from '../utils/orc.js'; +import { makeChainHub } from '../utils/chainHub.js'; +import { prepareLocalChainAccountKit } from '../exos/local-chain-account-kit.js'; /** * @import {Orchestrator, IcaAccount, CosmosValidatorAddress} from '../types.js' @@ -25,6 +28,7 @@ export const meta = { localchain: M.remotable('localchain'), orchestrationService: M.or(M.remotable('orchestration'), null), storageNode: StorageNodeShape, + marshaller: M.remotable('marshaller'), timerService: M.or(TimerServiceShape, null), }, upgradability: 'canUpgrade', @@ -48,6 +52,7 @@ export const makeNatAmountShape = (brand, min) => * orchestrationService: Remote; * storageNode: Remote; * timerService: Remote; + * marshaller: Marshaller; * }} privateArgs * @param {Baggage} baggage */ @@ -62,16 +67,28 @@ export const start = async (zcf, privateArgs, baggage) => { orchestrationService, storageNode, timerService, + marshaller, } = privateArgs; + const chainHub = makeChainHub(agoricNames); + const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller); + const makeLocalChainAccountKit = prepareLocalChainAccountKit( + zone, + makeRecorderKit, + zcf, + timerService, + chainHub, + ); + const { orchestrate } = makeOrchestrationFacade({ - agoricNames, localchain, orchestrationService, storageNode, timerService, zcf, zone, + chainHub, + makeLocalChainAccountKit, }); /** deprecated historical example */ diff --git a/packages/orchestration/src/examples/unbondExample.contract.js b/packages/orchestration/src/examples/unbondExample.contract.js index 70ae1696114e..6e0e67291cf6 100644 --- a/packages/orchestration/src/examples/unbondExample.contract.js +++ b/packages/orchestration/src/examples/unbondExample.contract.js @@ -1,7 +1,10 @@ import { makeDurableZone } from '@agoric/zone/durable.js'; import { Far } from '@endo/far'; import { M } from '@endo/patterns'; +import { prepareRecorderKitMakers } from '@agoric/zoe/src/contractSupport/recorder.js'; import { makeOrchestrationFacade } from '../facade.js'; +import { makeChainHub } from '../utils/chainHub.js'; +import { prepareLocalChainAccountKit } from '../exos/local-chain-account-kit.js'; /** * @import {Orchestrator, IcaAccount, CosmosValidatorAddress} from '../types.js' @@ -20,6 +23,7 @@ import { makeOrchestrationFacade } from '../facade.js'; * localchain: Remote; * orchestrationService: Remote; * storageNode: Remote; + * marshaller: Marshaller; * timerService: Remote; * }} privateArgs * @param {Baggage} baggage @@ -30,18 +34,29 @@ export const start = async (zcf, privateArgs, baggage) => { localchain, orchestrationService, storageNode, + marshaller, timerService, } = privateArgs; const zone = makeDurableZone(baggage); + const chainHub = makeChainHub(agoricNames); + const { makeRecorderKit } = prepareRecorderKitMakers(baggage, marshaller); + const makeLocalChainAccountKit = prepareLocalChainAccountKit( + zone, + makeRecorderKit, + zcf, + privateArgs.timerService, + chainHub, + ); const { orchestrate } = makeOrchestrationFacade({ - agoricNames, localchain, orchestrationService, storageNode, timerService, zcf, zone, + chainHub: makeChainHub(agoricNames), + makeLocalChainAccountKit, }); /** @type {OfferHandler} */