Skip to content

Commit

Permalink
test(fast-usdc): restore quickSend boot test
Browse files Browse the repository at this point in the history
 - support $SWINGSET_WORKER_TYPE
  • Loading branch information
dckc committed Oct 23, 2024
1 parent 0abb298 commit c42fbd6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
14 changes: 8 additions & 6 deletions packages/boot/test/bootstrapTests/quickSend.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import type { CallDetails } from '@agoric/orchestration/src/examples/quickSend.flows.js';
import type { CallDetails } from 'fast-usdc/contract/quickSend.flows.js';
import { makePromiseKit } from '@endo/promise-kit';
import type { TestFn } from 'ava';
import type { OfferId } from '@agoric/smart-wallet/src/offers.js';
Expand Down Expand Up @@ -39,7 +39,7 @@ const makeMeter = () => {
return policy;
},
setMetering: x => (metering = x),
getValue: () => (policy?.totalBeans() || 0) / mainParams.xsnapComputron,
getValue: () => (policy?.totalBeans() || 0n) / mainParams.xsnapComputron,
resetPolicy: () => (policy = undefined),
});
return meter;
Expand All @@ -51,12 +51,14 @@ const test: TestFn<

test.before('bootstrap', async t => {
const meter = makeMeter();
const { SLOGFILE: slogFile } = process.env;
const {
SLOGFILE: slogFile,
SWINGSET_WORKER_TYPE: defaultManagerType = 'xsnap',
} = process.env;
const ctx = await makeWalletFactoryContext(
t,
'@agoric/vm-config/decentral-itest-orchestration-config.json',
{ defaultManagerType: 'xsnap', meter, slogFile }, // for perf testing
// { defaultManagerType: 'local' }, // 3x faster, node debugger
{ defaultManagerType, meter, slogFile }, // for perf testing
);
t.context = { ...ctx, meter };

Expand All @@ -75,7 +77,7 @@ test.serial('deploy contract', async t => {
refreshAgoricNamesRemotes,
} = t.context;
await evalProposal(
buildProposal('@agoric/builders/scripts/orchestration/init-quickSend.js'),
buildProposal('@agoric/builders/scripts/fast-usdc/init-quickSend.js'),
);
// update now that quickSend is instantiated
refreshAgoricNamesRemotes();
Expand Down
1 change: 1 addition & 0 deletions packages/builders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@endo/marshal": "^1.6.1",
"@endo/promise-kit": "^1.1.7",
"@endo/stream": "^1.2.7",
"fast-usdc": "^0.1.0",
"import-meta-resolve": "^2.2.1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// @ts-check
import { makeHelpers } from '@agoric/deploy-script-support';
import { mustMatch } from '@agoric/internal';
import { getManifestForQuickSend } from '@agoric/orchestration/src/proposals/start-quickSend.js';
import { getManifestForQuickSend } from 'fast-usdc/contract/start-quickSend.js';
import { M } from '@endo/patterns';
import { parseArgs } from 'node:util';

/**
* @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
* @import {QuickSendConfig} from '@agoric/orchestration/src/proposals/start-quickSend.js';
* @import {QuickSendConfig} from 'fast-usdc/contract/start-quickSend.js';
* @import {TypedPattern} from '@agoric/internal';
* @import {ParseArgsConfig} from 'node:util';
*/
Expand All @@ -25,15 +25,15 @@ const QuickSendConfigShape = M.splitRecord({ watcherAddress: M.string() });
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
opts && mustMatch(opts, QuickSendConfigShape);
return harden({
sourceSpec: '@agoric/orchestration/src/proposals/start-quickSend.js',
sourceSpec: 'fast-usdc/contract/start-quickSend.js',
/** @type {[string, Parameters<typeof getManifestForQuickSend>[1]]} */
getManifestCall: [
getManifestForQuickSend.name,
{
options: { quickSend: opts },
installKeys: {
quickSend: publishRef(
install('@agoric/orchestration/src/examples/quickSend.contract.js'),
install('fast-usdc/contract/quickSend.contract.js'),
),
},
},
Expand Down

0 comments on commit c42fbd6

Please sign in to comment.