Skip to content

Commit

Permalink
refactor(orchestration): Move chainByName inside prepareOrchestrator
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Oct 4, 2024
1 parent 501ac93 commit 2ab7df9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 6 additions & 5 deletions packages/orchestration/src/exos/orchestrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const OrchestratorI = M.interface('Orchestrator', {
* asyncFlowTools: AsyncFlowTools;
* chainHub: ChainHub;
* localchain: Remote<LocalChain>;
* chainByName: MapStore<string, HostInterface<Chain>>;
* makeRecorderKit: MakeRecorderKit;
* makeLocalChainFacade: MakeLocalChainFacade;
* makeRemoteChainFacade: MakeRemoteChainFacade;
Expand All @@ -63,13 +62,15 @@ const prepareOrchestratorKit = (
{
chainHub,
localchain,
chainByName,
makeLocalChainFacade,
makeRemoteChainFacade,
vowTools: { watch, asVow },
},
) =>
zone.exoClassKit(
) => {
/** @type {MapStore<string, HostInterface<Chain>>} */
const chainByName = zone.mapStore('chainName');

return zone.exoClassKit(
'Orchestrator',
{
orchestrator: OrchestratorI,
Expand Down Expand Up @@ -158,6 +159,7 @@ const prepareOrchestratorKit = (
},
},
);
};
harden(prepareOrchestratorKit);

/**
Expand All @@ -166,7 +168,6 @@ harden(prepareOrchestratorKit);
* asyncFlowTools: AsyncFlowTools;
* chainHub: ChainHub;
* localchain: Remote<LocalChain>;
* chainByName: MapStore<string, HostInterface<Chain>>;
* makeRecorderKit: MakeRecorderKit;
* makeLocalChainFacade: MakeLocalChainFacade;
* makeRemoteChainFacade: MakeRemoteChainFacade;
Expand Down
3 changes: 0 additions & 3 deletions packages/orchestration/src/utils/start-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,10 @@ export const provideOrchestration = (
vowTools,
});

const chainByName = zones.orchestration.mapStore('chainName');

const makeOrchestrator = prepareOrchestrator(zones.orchestration, {
asyncFlowTools,
chainHub,
localchain: remotePowers.localchain,
chainByName,
makeRecorderKit,
makeLocalChainFacade,
makeRemoteChainFacade,
Expand Down

0 comments on commit 2ab7df9

Please sign in to comment.