Skip to content

Commit

Permalink
test: extract facadeServices
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jun 5, 2024
1 parent 72bf1bf commit 9fdd77f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
19 changes: 5 additions & 14 deletions packages/orchestration/test/facade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ export const mockChainInfo: CosmosChainInfo = harden({
});

test('chain info', async t => {
const { bootstrap } = await commonSetup(t);
const { bootstrap, facadeServices } = await commonSetup(t);

const zone = bootstrap.rootZone;

const { zcf } = await setupZCFTest();

const { registerChain, orchestrate } = makeOrchestrationFacade({
agoricNames: bootstrap.agoricNames,
localchain: bootstrap.localchain,
orchestrationService: bootstrap.orchestration,
...facadeServices,
storageNode: bootstrap.storage.rootNode,
timerService: bootstrap.timer,
zcf,
zone,
});
Expand All @@ -46,7 +43,7 @@ test('chain info', async t => {
});

test('contract upgrade', async t => {
const { bootstrap } = await commonSetup(t);
const { bootstrap, facadeServices } = await commonSetup(t);

const zone = bootstrap.rootZone;

Expand All @@ -55,11 +52,8 @@ test('contract upgrade', async t => {
// Register once
{
const { registerChain } = makeOrchestrationFacade({
agoricNames: bootstrap.agoricNames,
localchain: bootstrap.localchain,
orchestrationService: bootstrap.orchestration,
...facadeServices,
storageNode: bootstrap.storage.rootNode,
timerService: bootstrap.timer,
zcf,
zone,
});
Expand All @@ -74,11 +68,8 @@ test('contract upgrade', async t => {
// Simulate running again in a new incarnation with the same zone
{
const { registerChain } = makeOrchestrationFacade({
agoricNames: bootstrap.agoricNames,
localchain: bootstrap.localchain,
orchestrationService: bootstrap.orchestration,
...facadeServices,
storageNode: bootstrap.storage.rootNode,
timerService: bootstrap.timer,
zcf,
zone,
});
Expand Down
6 changes: 6 additions & 0 deletions packages/orchestration/test/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export const commonSetup = async t => {
storageNode: storage.rootNode,
timerService: timer,
},
facadeServices: {
agoricNames,
localchain,
orchestrationService: orchestration,
timerService: timer,
},
utils: {
pourPayment,
},
Expand Down

0 comments on commit 9fdd77f

Please sign in to comment.