Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

synchronous makeVstorageKit #10670

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions a3p-integration/proposals/s:stake-bld/test-lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env node */
import { execFileSync } from 'child_process';
import { LOCAL_CONFIG as networkConfig } from '@agoric/client-utils';
import { makeWalletUtils } from './wallet.js';
import { makeAgdWalletUtils } from './wallet.js';

export { networkConfig };

Expand All @@ -13,7 +13,7 @@ export { networkConfig };
*/
const delay = ms => new Promise(resolve => setTimeout(() => resolve(), ms));

export const walletUtils = await makeWalletUtils(
export const walletUtils = await makeAgdWalletUtils(
{ execFileSync, delay, fetch },
networkConfig,
);
14 changes: 11 additions & 3 deletions a3p-integration/proposals/s:stake-bld/test-lib/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ import { makeVstorageKit } from '@agoric/client-utils';
import { sendAction } from 'agoric/src/lib/index.js';
import { inspect } from 'util';

export const makeWalletUtils = async (
/**
* Stop-gap using execFileSync until we have a pure JS signing client.
*
* @param {object} root0
* @param {import('child_process')['execFileSync']} root0.execFileSync
* @param {typeof globalThis.fetch} root0.fetch
* @param {any} root0.delay
* @param {import('@agoric/client-utils').MinimalNetworkConfig} networkConfig
*/
export const makeAgdWalletUtils = async (
{ delay, execFileSync, fetch },
networkConfig,
) => {
const { agoricNames, fromBoard, marshaller, readLatestHead, vstorage } =
const { agoricNames, fromBoard, readLatestHead, vstorage } =
await makeVstorageKit({ fetch }, networkConfig);

/**
Expand All @@ -23,7 +32,6 @@ export const makeWalletUtils = async (
delay,
execFileSync,
from,
marshaller,
keyring: { backend: 'test' },
});
};
Expand Down
2 changes: 1 addition & 1 deletion a3p-integration/proposals/z:acceptance/psm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '@agoric/synthetic-chain';
import { waitUntilAccountFunded } from '@agoric/client-utils';
import test from 'ava';
import { NonNullish } from './test-lib/errors.js';
import { NonNullish } from '@agoric/internal/src/errors.js';
import {
adjustBalancesIfNotProvisioned,
bankSend,
Expand Down
140 changes: 0 additions & 140 deletions a3p-integration/proposals/z:acceptance/test-lib/chain.js

This file was deleted.

20 changes: 0 additions & 20 deletions a3p-integration/proposals/z:acceptance/test-lib/errors.js

This file was deleted.

9 changes: 3 additions & 6 deletions a3p-integration/proposals/z:acceptance/test-lib/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/* eslint-env node */
import { makeWalletUtils } from '@agoric/client-utils';
import { makeWalletUtils, LOCAL_CONFIG } from '@agoric/client-utils';
import { execFileSync } from 'child_process';
import { makeAgdWalletUtils } from './wallet.js';

export const networkConfig = {
rpcAddrs: ['http://0.0.0.0:26657'],
chainName: 'agoriclocal',
};
export const networkConfig = LOCAL_CONFIG;

/**
* Resolve after a delay in milliseconds.
Expand All @@ -22,6 +19,6 @@ export const walletUtils = await makeWalletUtils(
);

export const agdWalletUtils = await makeAgdWalletUtils(
{ execFileSync, setTimeout, walletUtils },
{ execFileSync, delay, fetch },
networkConfig,
);
1 change: 1 addition & 0 deletions a3p-integration/proposals/z:acceptance/test-lib/kread.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-nocheck FIXME
// XXX uses agoric.follow to read data through spawned processes; replace with VstorageKit
import assert from 'node:assert';

import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
VALIDATORADDR,
} from '@agoric/synthetic-chain';
import fsp from 'node:fs/promises';
import { NonNullish } from './errors.js';
import { NonNullish } from '@agoric/internal/src/errors.js';
import { getBalances } from './utils.js';

/** @import {Result as ExecaResult, ExecaError} from 'execa'; */
Expand Down
Loading
Loading