Skip to content

Commit

Permalink
test: convert zcf-upgrade to .ts
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 15, 2023
1 parent 2fbcd43 commit 48d7dcc
Showing 1 changed file with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
/* eslint @typescript-eslint/no-floating-promises: "warn" */

import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';
Expand All @@ -10,6 +9,8 @@ import processAmbient from 'child_process';
import { promises as fsAmbientPromises } from 'fs';

import { makeAgoricNamesRemotesFromFakeStorage } from '@agoric/vats/tools/board-utils.js';
import { TestFn } from 'ava';
import { BridgeHandler } from '@agoric/vats';
import { makeZoeDriver } from './drivers.ts';
import { makeProposalExtractor, makeSwingsetTestKit } from './supports.ts';

Expand All @@ -18,8 +19,6 @@ const dirname = path.dirname(filename);

const ZCF_PROBE_SRC = './zcfProbe.js';

/** @typedef {Awaited<ReturnType<typeof makeSwingsetTestKit>>} SwingsetTestKit */

/**
* @file Bootstrap test of upgrading ZCF to support atomicRearrange internally.
*
Expand All @@ -42,7 +41,6 @@ const ZCF_PROBE_SRC = './zcfProbe.js';

export const makeZoeTestContext = async t => {
console.time('ZoeTestContext');
/** @type {SwingsetTestKit} */
const swingsetTestKit = await makeSwingsetTestKit(t, 'bundles/zoe', {
configSpecifier: '@agoric/vm-config/decentral-demo-config.json',
});
Expand Down Expand Up @@ -83,12 +81,7 @@ export const makeZoeTestContext = async t => {
};
};

/**
* @type {import('ava').TestFn<
* Awaited<ReturnType<typeof makeZoeTestContext>>
* >}
*/
const test = anyTest;
const test = anyTest as TestFn<Awaited<ReturnType<typeof makeZoeTestContext>>>;

test.before(async t => {
t.context = await makeZoeTestContext(t);
Expand Down Expand Up @@ -116,10 +109,9 @@ test('run restart-vats proposal', async t => {
};

t.log({ bridgeMessage });
/** @type {ERef<import('@agoric/vats/src/types.js').BridgeHandler>} */
const coreEvalBridgeHandler = await EV.vat('bootstrap').consumeItem(
'coreEvalBridgeHandler',
);
const coreEvalBridgeHandler: ERef<BridgeHandler> = await EV.vat(
'bootstrap',
).consumeItem('coreEvalBridgeHandler');
await EV(coreEvalBridgeHandler).fromBridge(bridgeMessage);
};
const source = `${dirname}/${ZCF_PROBE_SRC}`;
Expand Down

0 comments on commit 48d7dcc

Please sign in to comment.