Skip to content

Commit

Permalink
test: match cosmosInterchainService bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jul 9, 2024
1 parent c2f422f commit 1c1560a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const getChainTerms = (
};

const startContract = async ({
orchestration,
cosmosInterchainService,
timer,
marshaller,
storage,
Expand All @@ -69,7 +69,7 @@ const startContract = async ({
terms,
{
marshaller,
cosmosInterchainService: orchestration,
cosmosInterchainService,
storageNode: storage.rootNode.makeChildNode(storagePath),
timer,
},
Expand Down
10 changes: 5 additions & 5 deletions packages/orchestration/test/service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { tryDecodeResponse } from '../src/utils/cosmos.js';

test('makeICQConnection returns an ICQConnection', async t => {
const {
bootstrap: { orchestration },
bootstrap: { cosmosInterchainService },
} = await commonSetup(t);

const CONTROLLER_CONNECTION_ID = 'connection-0';

const icqConnection = await E(orchestration).provideICQConnection(
const icqConnection = await E(cosmosInterchainService).provideICQConnection(
CONTROLLER_CONNECTION_ID,
);
const [localAddr, remoteAddr] = await Promise.all([
Expand All @@ -46,7 +46,7 @@ test('makeICQConnection returns an ICQConnection', async t => {
'remote address contains icqhost port, unordered ordering, and icq-1 version string',
);

const icqConnection2 = await E(orchestration).provideICQConnection(
const icqConnection2 = await E(cosmosInterchainService).provideICQConnection(
CONTROLLER_CONNECTION_ID,
);
const localAddr2 = await E(icqConnection2).getLocalAddress();
Expand All @@ -68,14 +68,14 @@ test('makeICQConnection returns an ICQConnection', async t => {

test('makeAccount returns a ChainAccount', async t => {
const {
bootstrap: { orchestration },
bootstrap: { cosmosInterchainService },
} = await commonSetup(t);

const CHAIN_ID = 'cosmoshub-99';
const HOST_CONNECTION_ID = 'connection-0';
const CONTROLLER_CONNECTION_ID = 'connection-1';

const account = await E(orchestration).makeAccount(
const account = await E(cosmosInterchainService).makeAccount(
CHAIN_ID,
HOST_CONNECTION_ID,
CONTROLLER_CONNECTION_ID,
Expand Down
12 changes: 7 additions & 5 deletions packages/orchestration/test/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ export const commonSetup = async (t: ExecutionContext<any>) => {
);
await setupIBCProtocol();

const makeOrchestrationKit = prepareCosmosInterchainService(
const makeCosmosInterchainService = prepareCosmosInterchainService(
rootZone.subZone('orchestration'),
vowTools,
);
const orchestration = makeOrchestrationKit({ portAllocator });
const cosmosInterchainService = makeCosmosInterchainService({
portAllocator,
});

await registerChainNamespace(agoricNamesAdmin, () => {});

Expand All @@ -129,7 +131,7 @@ export const commonSetup = async (t: ExecutionContext<any>) => {
timer,
localchain,
marshaller,
orchestration,
cosmosInterchainService,
// TODO remove; bootstrap doesn't have a zone
rootZone: rootZone.subZone('contract'),
storage,
Expand All @@ -143,15 +145,15 @@ export const commonSetup = async (t: ExecutionContext<any>) => {
commonPrivateArgs: {
agoricNames,
localchain,
orchestrationService: orchestration,
orchestrationService: cosmosInterchainService,
storageNode: storage.rootNode,
marshaller,
timerService: timer,
},
facadeServices: {
agoricNames,
localchain,
orchestrationService: orchestration,
orchestrationService: cosmosInterchainService,
timerService: timer,
},
utils: {
Expand Down

0 comments on commit 1c1560a

Please sign in to comment.