Skip to content

Commit

Permalink
refactor: OrchestrationService in service.js
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 24, 2024
1 parent 7bd1978 commit 54d18d9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/boot/test/bootstrapTests/test-vat-orchestration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MsgDelegateResponse,
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
import { Any } from '@agoric/cosmic-proto/google/protobuf/any';
import type { ChainAccount, Orchestration } from '@agoric/orchestration';
import type { ChainAccount, OrchestrationService } from '@agoric/orchestration';
import { decodeBase64 } from '@endo/base64';
import { M, matches } from '@endo/patterns';
import { makeWalletFactoryContext } from './walletFactory.ts';
Expand Down Expand Up @@ -100,7 +100,7 @@ test('ICA connection can be closed', async t => {
runUtils: { EV },
} = t.context;

const orchestration: Orchestration =
const orchestration: OrchestrationService =
await EV.vat('bootstrap').consumeItem('orchestration');

const account = await EV(orchestration).createAccount(
Expand Down
2 changes: 1 addition & 1 deletion packages/orchestration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
export * from './src/types.js';
export * from './src/utils/address.js';
export * from './src/utils/tx.js';
export * from './src/orchestration.js';
export * from './src/service.js';
4 changes: 2 additions & 2 deletions packages/orchestration/src/contracts/stakeAtom.contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { prepareStakingAccountHolder } from './stakingAccountHolder.js';

const trace = makeTracer('StakeAtom');
/**
* @import { Orchestration } from '../types.js';
* @import { OrchestrationService } from '../service.js'
* @import { Baggage } from '@agoric/vat-data';
* @import { IBCConnectionID } from '@agoric/vats';
*/
Expand All @@ -27,7 +27,7 @@ const trace = makeTracer('StakeAtom');
*
* @param {ZCF<StakeAtomTerms>} zcf
* @param {{
* orchestration: Orchestration;
* orchestration: OrchestrationService;
* storageNode: StorageNode;
* marshaller: Marshaller;
* }} privateArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
import { V as E } from '@agoric/vat-data/vow.js';
import { Far } from '@endo/far';

/** @import { AttenuatedNetwork, Orchestration, OrchestrationVat } from '../types' */
/**
* @import { AttenuatedNetwork } from '../types'
* @import { OrchestrationService } from '../service.js'
* @import { OrchestrationVat } from '../vat-orchestration.js'
*/

/**
* @param {BootstrapPowers & {
Expand Down Expand Up @@ -67,7 +71,7 @@ export const setupOrchestrationVat = async (
/**
* @param {BootstrapPowers & {
* consume: {
* orchestration: Orchestration;
* orchestration: OrchestrationService;
* };
* }} powers
* @param {object} _options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/** @file Orchestration service */
import { NonNullish } from '@agoric/assert';
import { makeTracer } from '@agoric/internal';
import '@agoric/network/exported.js';
import { V as E } from '@agoric/vat-data/vow.js';
import { M } from '@endo/patterns';
import { makeICAConnectionAddress, parseAddress } from './utils/address.js';
import { makeTxPacket, parsePacketAck } from './utils/tx.js';
import '@agoric/network/exported.js';

/**
* @import { AttenuatedNetwork } from './types.js';
Expand Down Expand Up @@ -256,4 +256,4 @@ harden(prepareOrchestrationTools);
/** @typedef {ChainAccountKit['account']} ChainAccount */
/** @typedef {ReturnType<typeof prepareOrchestrationTools>} OrchestrationTools */
/** @typedef {ReturnType<OrchestrationTools['makeOrchestration']>} OrchestrationKit */
/** @typedef {OrchestrationKit['public']} Orchestration */
/** @typedef {OrchestrationKit['public']} OrchestrationService */
4 changes: 2 additions & 2 deletions packages/orchestration/src/vat-orchestration.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @ts-check
import { Far } from '@endo/far';
import { makeDurableZone } from '@agoric/zone/durable.js';
import { prepareOrchestrationTools } from './orchestration.js';
import { prepareOrchestrationTools } from './service.js';

/** @import { OrchestrationPowers } from './types.js' */
/** @import { OrchestrationPowers } from './service.js' */

export const buildRootObject = (_vatPowers, _args, baggage) => {
const zone = makeDurableZone(baggage);
Expand Down
2 changes: 1 addition & 1 deletion packages/vats/src/core/types-ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ type ChainBootstrapSpaceT = {
namesByAddress: import('../types.js').NameHub;
namesByAddressAdmin: import('../types.js').NamesByAddressAdmin;
networkVat: NetworkVat;
orchestration: import('@agoric/orchestration/src/orchestration.js').Orchestration;
orchestration: import('@agoric/orchestration/src/service.js').OrchestrationService;
pegasusConnections: import('@agoric/vats').NameHubKit;
pegasusConnectionsAdmin: import('@agoric/vats').NameAdmin;
priceAuthorityVat: Awaited<PriceAuthorityVat>;
Expand Down

0 comments on commit 54d18d9

Please sign in to comment.