Skip to content

Commit

Permalink
refactor(crabble-start): use 0.1.1 lib
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Aug 27, 2024
1 parent c297c19 commit 7a6bb65
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 480 deletions.
151 changes: 0 additions & 151 deletions proposals/64:crabble-start/core-eval-support.js

This file was deleted.

2 changes: 1 addition & 1 deletion proposals/64:crabble-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"license": "Apache-2.0",
"dependencies": {
"@agoric/synthetic-chain": "^0.0.1-rc0",
"@agoric/synthetic-chain": "^0.2.0",
"@endo/zip": "^0.2.35",
"ava": "^5.3.1",
"better-sqlite3": "^8.5.1",
Expand Down
39 changes: 25 additions & 14 deletions proposals/64:crabble-start/test-crabble-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,55 @@
*/

import anyTest from 'ava';
import dbOpenAmbient from 'better-sqlite3';
import * as cpAmbient from 'child_process'; // TODO: use execa
import * as fspAmbient from 'fs/promises';
import { tmpName as tmpNameAmbient } from 'tmp';
import * as pathAmbient from 'path';
import * as processAmbient from 'process';
import dbOpenAmbient from 'better-sqlite3';
import { tmpName as tmpNameAmbient } from 'tmp';

// TODO: factor out ambient authority from these
// or at least allow caller to supply authority.
import {
agoric,
wellKnownIdentities,
} from '@agoric/synthetic-chain/src/lib/cliHelper.js';
import {
provisionSmartWallet,
voteLatestProposalAndWait,
waitForBlock,
} from '@agoric/synthetic-chain/src/lib/commonUpgradeHelpers.js';
wellKnownIdentities,
} from '@agoric/synthetic-chain';

import { makeAgd } from '@agoric/synthetic-chain/src/lib/agd-lib.js';
import { dbTool } from '@agoric/synthetic-chain/src/lib/vat-status.js';
import {
makeFileRd,
makeFileRW,
} from '@agoric/synthetic-chain/src/lib/webAsset.js';
import {
dbTool,
ensureISTForInstall,
flags,
getContractInfo,
loadedBundleIds,
testIncludes,
makeAgd,
makeFileRd,
makeFileRW,
txAbbr,
} from './core-eval-support.js';
} from '@agoric/synthetic-chain';

/** @typedef {Awaited<ReturnType<typeof makeTestContext>>} TestContext */

const test = /** @type {import('ava').TestFn<TestContext>}} */ (anyTest);

/**
* Asserts that `haystack` includes `needle` (or when `sense` is false, that it
* does not), providing pretty output in the case of failure.
*
* @param {import('ava').ExecutionContext} t
* @param {unknown} needle
* @param {unknown[]} haystack
* @param {string} label
* @param {boolean} [sense] true to assert inclusion; false for exclusion
* @returns {void}
*/
export const testIncludes = (t, needle, haystack, label, sense = true) => {
const matches = haystack.filter(c => Object.is(c, needle));
t.deepEqual(matches, sense ? [needle] : [], label);
};

const assetInfo = {
/** @type {Record<string, ProposalInfo>} */
buildAssets: {
Expand Down
Loading

0 comments on commit 7a6bb65

Please sign in to comment.