diff --git a/a3p-integration/README.md b/a3p-integration/README.md index 6076bb3509f..5318bbba750 100644 --- a/a3p-integration/README.md +++ b/a3p-integration/README.md @@ -108,11 +108,37 @@ Instead of relying on an automatic `submission` folder, a core-eval proposal can # Build details +In the `ghcr.io/agoric/agoric-sdk` image the filesystem is: +``` +/usr/src/agoric-sdk +``` + +With the proposals layered on top of the `agoric-sdk` image, the filesystem adds (for example): +``` +/usr/src/proposals/n:upgrade-next +/usr/src/proposals/z:acceptance +``` + +In agoric-sdk CI and development, we want the proposals to use the versions of the packages in the agoric-sdk source tree. To accomplish this we use `yarn link`. In Yarn 4 (berry) it uses a `portal` protocol to link to another Yarn project on the filesystem. One kink is that in development the command would, +``` +yarn link --relative ../../.. --all +``` +Which configures the package.json resolutions to find agoric-sdk three levels up. + +But in CI the proposals aren't nested under agoric-sdk and the command would be, +``` +yarn link --relative ../../agoric-sdk --all +``` + +To give a consistent location, `a3p-integration` has a symlink to the `agoric-sdk` project where the proposals expect it in the Docker fileystem. (I.e. treating `a3p-integration` as `/usr/src` of the Docker image.) + + The `yarn build` script automates 3 steps: - Building the `unreleased` SDK image - Generating the `submission` folders in core proposal packages - Building the synthetic-chain images using the proposals + ## Generate a docker image with the `agoric-sdk` chain software The chain software upgrade proposal contained in this end-to-end integration test performs an upgrade of the agoric-3 synthetic chain to an `UNRELEASED_A3P_INTEGRATION` plan name (or the corresponding upgrade plan name for release branches). It loads the docker image `ghcr.io/agoric/agoric-sdk:unreleased` for the software implementing that upgrade (both in the `master` branch or in release branches). diff --git a/a3p-integration/agoric-sdk b/a3p-integration/agoric-sdk new file mode 120000 index 00000000000..b870225aa05 --- /dev/null +++ b/a3p-integration/agoric-sdk @@ -0,0 +1 @@ +../ \ No newline at end of file diff --git a/a3p-integration/package.json b/a3p-integration/package.json index ee9bb0a570a..c0aac139b14 100644 --- a/a3p-integration/package.json +++ b/a3p-integration/package.json @@ -16,6 +16,6 @@ "@agoric/synthetic-chain": "^0.3.0", "@types/better-sqlite3": "^7.6.11" }, - "packageManager": "yarn@4.2.2", + "packageManager": "yarn@4.5.1", "license": "Apache-2.0" } diff --git a/a3p-integration/proposals/n:upgrade-next/package.json b/a3p-integration/proposals/n:upgrade-next/package.json index af2361a9a58..fccfe2b2701 100644 --- a/a3p-integration/proposals/n:upgrade-next/package.json +++ b/a3p-integration/proposals/n:upgrade-next/package.json @@ -12,11 +12,11 @@ "license": "Apache-2.0", "dependencies": { "@agoric/synthetic-chain": "^0.3.0", - "@endo/init": "^1.1.5", - "@endo/marshal": "^1.5.4", + "@endo/init": "^1.1.6", + "@endo/marshal": "^1.6.1", "ava": "^5.3.1", "better-sqlite3": "^9.6.0", - "execa": "^9.3.1" + "execa": "^9.5.1" }, "ava": { "concurrency": 1, @@ -28,5 +28,8 @@ "scripts": { "agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops" }, - "packageManager": "yarn@4.2.2" + "packageManager": "yarn@4.5.1", + "devDependencies": { + "typescript": "^5.6.3" + } } diff --git a/a3p-integration/proposals/n:upgrade-next/priceFeedUpdate.test.js b/a3p-integration/proposals/n:upgrade-next/priceFeedUpdate.test.js index d0bdaa1b055..104ff759465 100644 --- a/a3p-integration/proposals/n:upgrade-next/priceFeedUpdate.test.js +++ b/a3p-integration/proposals/n:upgrade-next/priceFeedUpdate.test.js @@ -83,6 +83,7 @@ const openMarginalVault = async t => { const currentVaults = await agops.vaults('list', '--from', USER1ADDR); t.log('opening a vault'); + // @ts-expect-error bad typedef await openVault(USER1ADDR, 5, 10); user1IST += 5; const istBalanceAfterVaultOpen = await getISTBalance(USER1ADDR); diff --git a/a3p-integration/proposals/n:upgrade-next/sync-tools.js b/a3p-integration/proposals/n:upgrade-next/sync-tools.js deleted file mode 100644 index 4a0e727c465..00000000000 --- a/a3p-integration/proposals/n:upgrade-next/sync-tools.js +++ /dev/null @@ -1,72 +0,0 @@ -/* eslint-env node */ - -/** - * @file These tools mostly duplicate code that will be added in other PRs - * and eventually migrated to synthetic-chain. Sorry for the duplication. - */ - -/** - * @typedef {object} RetryOptions - * @property {number} [maxRetries] - * @property {number} [retryIntervalMs] - * @property {(...arg0: string[]) => void} log - * @property {(object) => void} [setTimeout] - * @property {string} [errorMessage=Error] - */ - -const ambientSetTimeout = global.setTimeout; - -/** - * From https://github.com/Agoric/agoric-sdk/blob/442f07c8f0af03281b52b90e90c27131eef6f331/multichain-testing/tools/sleep.ts#L10 - * - * @param {number} ms - * @param {*} sleepOptions - */ -const sleep = (ms, { log = () => {}, setTimeout = ambientSetTimeout }) => - new Promise(resolve => { - log(`Sleeping for ${ms}ms...`); - setTimeout(resolve, ms); - }); - -/** - * From https://github.com/Agoric/agoric-sdk/blob/442f07c8f0af03281b52b90e90c27131eef6f331/multichain-testing/tools/sleep.ts#L24 - * - * @param {() => Promise} operation - * @param {(result: any) => boolean} condition - * @param {string} message - * @param {RetryOptions} options - */ -export const retryUntilCondition = async ( - operation, - condition, - message, - { maxRetries = 6, retryIntervalMs = 3500, log, setTimeout }, -) => { - console.log({ maxRetries, retryIntervalMs, message }); - let retries = 0; - - await null; - while (retries < maxRetries) { - try { - const result = await operation(); - log('RESULT', result); - if (condition(result)) { - return result; - } - } catch (error) { - if (error instanceof Error) { - log(`Error: ${error.message}`); - } else { - log(`Unknown error: ${String(error)}`); - } - } - - retries += 1; - console.log( - `Retry ${retries}/${maxRetries} - Waiting for ${retryIntervalMs}ms for ${message}...`, - ); - await sleep(retryIntervalMs, { log, setTimeout }); - } - - throw Error(`${message} condition failed after ${maxRetries} retries.`); -}; diff --git a/a3p-integration/proposals/n:upgrade-next/tsconfig.json b/a3p-integration/proposals/n:upgrade-next/tsconfig.json index 39de5a422e9..d3e64ee5baf 100644 --- a/a3p-integration/proposals/n:upgrade-next/tsconfig.json +++ b/a3p-integration/proposals/n:upgrade-next/tsconfig.json @@ -1,12 +1,14 @@ { "compilerOptions": { - "target": "esnext", - "module": "esnext", + "target": "ESNext", + "module": "NodeNext", "allowJs": true, "checkJs": true, "strict": false, "strictNullChecks": true, "noEmit": true, - "noImplicitThis": true + "noImplicitThis": true, + // XXX synthetic-chain has some errors + "skipLibCheck": true } } diff --git a/a3p-integration/proposals/n:upgrade-next/yarn.lock b/a3p-integration/proposals/n:upgrade-next/yarn.lock index 78dc133a0f9..2c0ecacf2c3 100644 --- a/a3p-integration/proposals/n:upgrade-next/yarn.lock +++ b/a3p-integration/proposals/n:upgrade-next/yarn.lock @@ -27,14 +27,14 @@ __metadata: languageName: node linkType: hard -"@endo/common@npm:^1.2.6": - version: 1.2.6 - resolution: "@endo/common@npm:1.2.6" +"@endo/common@npm:^1.2.7": + version: 1.2.7 + resolution: "@endo/common@npm:1.2.7" dependencies: - "@endo/errors": "npm:^1.2.6" - "@endo/eventual-send": "npm:^1.2.6" - "@endo/promise-kit": "npm:^1.1.6" - checksum: 10c0/7cca372677bd1ab535a0f8fc250eca9bfc202ef7dfd24cac6ff1260003aa4512f8db18419dd632b3e57270a589fec54891496904ff2e8a97047f1e187e3f1401 + "@endo/errors": "npm:^1.2.7" + "@endo/eventual-send": "npm:^1.2.7" + "@endo/promise-kit": "npm:^1.1.7" + checksum: 10c0/2bd25ffc528afd6308b6168650583977139c64e56547b3ea2fee313e01650fb1a041d7b7ce54c6bb70f26c9e78345db2a50fbe3ebccabe9a5c5696eda2cca706 languageName: node linkType: hard @@ -45,85 +45,85 @@ __metadata: languageName: node linkType: hard -"@endo/errors@npm:^1.2.6": - version: 1.2.6 - resolution: "@endo/errors@npm:1.2.6" +"@endo/errors@npm:^1.2.7": + version: 1.2.7 + resolution: "@endo/errors@npm:1.2.7" dependencies: - ses: "npm:^1.9.0" - checksum: 10c0/cbc541c2d26fbfeb1567dd1cdf0e1f110ee9866430c5a1b91d87270d6f00bc8293cc8512301217c4eda35e60677ce62a941d11eb32c7da1f72d450a011ad2bb5 + ses: "npm:^1.9.1" + checksum: 10c0/17eed5d01dd968d8e266db37ac44e76859d14894a2b70457d120f2f05021819671aaf1bdf7dc7c2506b84f6df616402e029695d62309fbdbdd13ed4ba34890dd languageName: node linkType: hard -"@endo/eventual-send@npm:^1.2.6": - version: 1.2.6 - resolution: "@endo/eventual-send@npm:1.2.6" +"@endo/eventual-send@npm:^1.2.7": + version: 1.2.7 + resolution: "@endo/eventual-send@npm:1.2.7" dependencies: "@endo/env-options": "npm:^1.1.7" - checksum: 10c0/6983d6b88bf4e99f6c469d4ca037793582b06cc0bfa2da085b5bc7ad67333a1fba6e5e7077b7f279be23ccfba1dff9e06c7f85f9980b09fd002227f89a673c11 + checksum: 10c0/4a483169bcd9ead47a7a07d3f69bdebdc0d1e2a3198f35ad422b82c1646b64528234bdddc9e0544ac38c2ede84a50af1e126eb4086aa8b4ae4b0002895b55e86 languageName: node linkType: hard -"@endo/init@npm:^1.1.5": - version: 1.1.5 - resolution: "@endo/init@npm:1.1.5" +"@endo/init@npm:^1.1.6": + version: 1.1.6 + resolution: "@endo/init@npm:1.1.6" dependencies: "@endo/base64": "npm:^1.0.8" - "@endo/eventual-send": "npm:^1.2.6" - "@endo/lockdown": "npm:^1.0.11" - "@endo/promise-kit": "npm:^1.1.6" - checksum: 10c0/08abda8a0204450cb39c296270d074189f320cdeb03892e87b27a75f6b98c0b5d9c8471e242c53545843211fe713b01b281eec0eabc1c58ca0760a068b90335c + "@endo/eventual-send": "npm:^1.2.7" + "@endo/lockdown": "npm:^1.0.12" + "@endo/promise-kit": "npm:^1.1.7" + checksum: 10c0/1885429e475c780bb5b7ff0fd4fcd5d76bc3a5cb1c3c2f9f2dfc06152ff1c8c3be512b6760483c8c18598e1977129cb3dd766a32c9f6efb19d70b54a1844c683 languageName: node linkType: hard -"@endo/lockdown@npm:^1.0.11": - version: 1.0.11 - resolution: "@endo/lockdown@npm:1.0.11" +"@endo/lockdown@npm:^1.0.12": + version: 1.0.12 + resolution: "@endo/lockdown@npm:1.0.12" dependencies: - ses: "npm:^1.9.0" - checksum: 10c0/03bb96f370e7ee69d9d8e26b7b124b6381994d3b28a99dc2bcafe77139283701d7543b40e978226cd49443c149e64610e4dd49c32ada931610ba091809478a11 + ses: "npm:^1.9.1" + checksum: 10c0/0b9d36f359ffe8eadd1e799aa0340ccb0680d48c9b6249c380c27724824c4d875dada9fbec096fb4e2ac76b32c7536955524d3eb6579451a618707602fb958f4 languageName: node linkType: hard -"@endo/marshal@npm:^1.5.4": - version: 1.5.4 - resolution: "@endo/marshal@npm:1.5.4" +"@endo/marshal@npm:^1.6.1": + version: 1.6.1 + resolution: "@endo/marshal@npm:1.6.1" dependencies: - "@endo/common": "npm:^1.2.6" - "@endo/errors": "npm:^1.2.6" - "@endo/eventual-send": "npm:^1.2.6" - "@endo/nat": "npm:^5.0.11" - "@endo/pass-style": "npm:^1.4.4" - "@endo/promise-kit": "npm:^1.1.6" - checksum: 10c0/4668a3678567cfbeefc3a47217912ca3f5d8bdb37e0d5d53339953b4ab83950683505f45c0f5c30b415c989bb9df4fa0859849d23b11f5b1064b0da0a13943ab + "@endo/common": "npm:^1.2.7" + "@endo/errors": "npm:^1.2.7" + "@endo/eventual-send": "npm:^1.2.7" + "@endo/nat": "npm:^5.0.12" + "@endo/pass-style": "npm:^1.4.6" + "@endo/promise-kit": "npm:^1.1.7" + checksum: 10c0/e64983abccd833b2a7eb63547e8c5a629f073d3e422229475d470ace95c2640a89e9a9879c46e8389cca8c9e75823ea1c27e27cbeeb8c1c4005146b2c530c530 languageName: node linkType: hard -"@endo/nat@npm:^5.0.11": - version: 5.0.11 - resolution: "@endo/nat@npm:5.0.11" - checksum: 10c0/50cd9033657dd35288f0333a966984f788213f1c836e6772c0d731361d5854d0ce24b8a7d6f351d56618eb40f6b369e130c1ad939c83d5833246c09119b2e777 +"@endo/nat@npm:^5.0.12": + version: 5.0.12 + resolution: "@endo/nat@npm:5.0.12" + checksum: 10c0/deb792b6a0c9fe9c0e7cf74cc725d8bc36934571f4f06ac3b6def2a0622ac79b0278753c574f9b55a88b063d1186fd6971bbe63326077a7d37982c4c37a1a24c languageName: node linkType: hard -"@endo/pass-style@npm:^1.4.4": - version: 1.4.4 - resolution: "@endo/pass-style@npm:1.4.4" +"@endo/pass-style@npm:^1.4.6": + version: 1.4.6 + resolution: "@endo/pass-style@npm:1.4.6" dependencies: "@endo/env-options": "npm:^1.1.7" - "@endo/errors": "npm:^1.2.6" - "@endo/eventual-send": "npm:^1.2.6" - "@endo/promise-kit": "npm:^1.1.6" + "@endo/errors": "npm:^1.2.7" + "@endo/eventual-send": "npm:^1.2.7" + "@endo/promise-kit": "npm:^1.1.7" "@fast-check/ava": "npm:^1.1.5" - checksum: 10c0/d6c6268b269d4c14541087ce6b2975f9e31847893d01360c0ea92392ae93316d94fbf59cd7299853a0fb5214176ad7ffc4616b9b2581fd720bdb55ef96d0beeb + checksum: 10c0/fec9d21bb4c70314e92c72f7ae41ec147ac839a23d54f613d689b84f81206e49e657f3fb414db454cbd6ab67dd2a319b1ae25c42b3a1c881edd5de120496b8b4 languageName: node linkType: hard -"@endo/promise-kit@npm:^1.1.6": - version: 1.1.6 - resolution: "@endo/promise-kit@npm:1.1.6" +"@endo/promise-kit@npm:^1.1.7": + version: 1.1.7 + resolution: "@endo/promise-kit@npm:1.1.7" dependencies: - ses: "npm:^1.9.0" - checksum: 10c0/d60de663e58f9de32b6705268c62c63c4721f1874813d3c10cae7846e921e4ea8a60c8622ef8c937741a3387fbc60110076b25304afedf270727af7b0c3fecb3 + ses: "npm:^1.9.1" + checksum: 10c0/98a8d743c437f106f266871874acd811c0e028fc89553738bbd46a0fea5871b9ba7ef0449ec38e7e3768fc21684993ecdbbd06f5f3429cd69fbe4b867d4c2bd5 languageName: node linkType: hard @@ -892,6 +892,26 @@ __metadata: languageName: node linkType: hard +"execa@npm:^9.5.1": + version: 9.5.1 + resolution: "execa@npm:9.5.1" + dependencies: + "@sindresorhus/merge-streams": "npm:^4.0.0" + cross-spawn: "npm:^7.0.3" + figures: "npm:^6.1.0" + get-stream: "npm:^9.0.0" + human-signals: "npm:^8.0.0" + is-plain-obj: "npm:^4.1.0" + is-stream: "npm:^4.0.1" + npm-run-path: "npm:^6.0.0" + pretty-ms: "npm:^9.0.0" + signal-exit: "npm:^4.1.0" + strip-final-newline: "npm:^4.0.0" + yoctocolors: "npm:^2.0.0" + checksum: 10c0/1a628d535c5a088f9e17a735bb3143efc4198095392b319ba877b2975d5c3c57724536dccb6f68f1cd9b3af331c5a9e8c1aeb338d52ab316b1e008ff453374a7 + languageName: node + linkType: hard + "expand-template@npm:^2.0.3": version: 2.0.3 resolution: "expand-template@npm:2.0.3" @@ -2009,11 +2029,12 @@ __metadata: resolution: "root-workspace-0b6124@workspace:." dependencies: "@agoric/synthetic-chain": "npm:^0.3.0" - "@endo/init": "npm:^1.1.5" - "@endo/marshal": "npm:^1.5.4" + "@endo/init": "npm:^1.1.6" + "@endo/marshal": "npm:^1.6.1" ava: "npm:^5.3.1" better-sqlite3: "npm:^9.6.0" - execa: "npm:^9.3.1" + execa: "npm:^9.5.1" + typescript: "npm:^5.6.3" languageName: unknown linkType: soft @@ -2069,12 +2090,12 @@ __metadata: languageName: node linkType: hard -"ses@npm:^1.9.0": - version: 1.9.0 - resolution: "ses@npm:1.9.0" +"ses@npm:^1.9.1": + version: 1.9.1 + resolution: "ses@npm:1.9.1" dependencies: "@endo/env-options": "npm:^1.1.7" - checksum: 10c0/356f9601b04a87f33403a15fc627caf0c649d86d8d7ee1f4b3c75b947ab05c31b254c94c0aa26e9904862787c73950d5a60f3435deebe5dba23017e20c40b0cb + checksum: 10c0/1e795542954f635aaee2749a1d548460f2978257cb29daaea76b814ef99ffa64ab5cca05fbc3d51a814a57cf9fc4563988ee93312cc53bae4eb63dfff0f0682a languageName: node linkType: hard @@ -2342,6 +2363,26 @@ __metadata: languageName: node linkType: hard +"typescript@npm:^5.6.3": + version: 5.6.3 + resolution: "typescript@npm:5.6.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/44f61d3fb15c35359bc60399cb8127c30bae554cd555b8e2b46d68fa79d680354b83320ad419ff1b81a0bdf324197b29affe6cc28988cd6a74d4ac60c94f9799 + languageName: node + linkType: hard + +"typescript@patch:typescript@npm%3A^5.6.3#optional!builtin": + version: 5.6.3 + resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/7c9d2e07c81226d60435939618c91ec2ff0b75fbfa106eec3430f0fcf93a584bc6c73176676f532d78c3594fe28a54b36eb40b3d75593071a7ec91301533ace7 + languageName: node + linkType: hard + "unicorn-magic@npm:^0.3.0": version: 0.3.0 resolution: "unicorn-magic@npm:0.3.0" diff --git a/a3p-integration/proposals/s:stake-bld/package.json b/a3p-integration/proposals/s:stake-bld/package.json index 39c3d923c8a..477b95ba07a 100644 --- a/a3p-integration/proposals/s:stake-bld/package.json +++ b/a3p-integration/proposals/s:stake-bld/package.json @@ -23,5 +23,5 @@ "ava": { "concurrency": 1 }, - "packageManager": "yarn@4.2.2" + "packageManager": "yarn@4.5.1" } diff --git a/a3p-integration/proposals/s:stake-bld/test-lib/index.js b/a3p-integration/proposals/s:stake-bld/test-lib/index.js index c6970eab1df..a35b9b94fe0 100644 --- a/a3p-integration/proposals/s:stake-bld/test-lib/index.js +++ b/a3p-integration/proposals/s:stake-bld/test-lib/index.js @@ -16,6 +16,6 @@ export const networkConfig = { const delay = ms => new Promise(resolve => setTimeout(() => resolve(), ms)); export const walletUtils = await makeWalletUtils( - { delay, execFileSync, fetch }, + { execFileSync, delay, fetch }, networkConfig, ); diff --git a/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js b/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js index 2cc3c34913f..1d62aedf1be 100644 --- a/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js +++ b/a3p-integration/proposals/s:stake-bld/test-lib/rpc.js @@ -234,7 +234,7 @@ export const makeAgoricNames = async (ctx, vstorage) => { * @param {{ fetch: typeof window.fetch }} io * @param {MinimalNetworkConfig} config */ -export const makeRpcUtils = async ({ fetch }, config = networkConfig) => { +export const makeVstorageKit = async ({ fetch }, config = networkConfig) => { await null; try { const vstorage = makeVStorage({ fetch }, config); @@ -263,4 +263,4 @@ export const makeRpcUtils = async ({ fetch }, config = networkConfig) => { throw Error(`RPC failure (${config.rpcAddrs}): ${err.message}`); } }; -/** @typedef {Awaited>} RpcUtils */ +/** @typedef {Awaited>} RpcUtils */ diff --git a/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js b/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js index 5fbe9b70027..53d9634e278 100644 --- a/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js +++ b/a3p-integration/proposals/s:stake-bld/test-lib/wallet.js @@ -6,84 +6,9 @@ // @ts-check /* global */ -import { E, Far } from '@endo/far'; import { inspect } from 'util'; import { execSwingsetTransaction, pollTx } from './chain.js'; -import { makeRpcUtils } from './rpc.js'; - -/** @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js' */ -/** @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js' */ - -/** - * @template T - * @param follower - * @param [options] - */ -export const iterateReverse = (follower, options) => - // For now, just pass through the iterable. - Far('iterateReverse iterable', { - /** @returns {AsyncIterator} */ - [Symbol.asyncIterator]: () => { - const eachIterable = E(follower).getReverseIterable(options); - const iterator = E(eachIterable)[Symbol.asyncIterator](); - return Far('iterateEach iterator', { - next: () => E(iterator).next(), - }); - }, - }); - -/** @type {CurrentWalletRecord} */ -const emptyCurrentRecord = { - purses: [], - offerToUsedInvitation: [], - offerToPublicSubscriberPaths: [], - liveOffers: [], -}; - -/** - * @param {string} addr - * @param {Pick} io - * @returns {Promise} - */ -export const getCurrent = async (addr, { readLatestHead }) => { - // Partial because older writes may not have had all properties - // NB: assumes changes are only additions - let current = - /** @type {Partial | undefined} */ ( - await readLatestHead(`published.wallet.${addr}.current`) - ); - if (current === undefined) { - throw Error(`undefined current node for ${addr}`); - } - - // Repair a type misunderstanding seen in the wild. - // See https://github.com/Agoric/agoric-sdk/pull/7139 - let offerToUsedInvitation = current.offerToUsedInvitation; - if ( - offerToUsedInvitation && - typeof offerToUsedInvitation === 'object' && - !Array.isArray(offerToUsedInvitation) - ) { - offerToUsedInvitation = Object.entries(offerToUsedInvitation); - current = harden({ - ...current, - offerToUsedInvitation, - }); - } - - // override full empty record with defined values from published one - return { ...emptyCurrentRecord, ...current }; -}; - -/** - * @param {string} addr - * @param {Pick} io - * @returns {Promise} - */ -export const getLastUpdate = (addr, { readLatestHead }) => { - // @ts-expect-error cast - return readLatestHead(`published.wallet.${addr}`); -}; +import { makeVstorageKit } from './rpc.js'; /** * Sign and broadcast a wallet-action. @@ -136,7 +61,7 @@ export const makeWalletUtils = async ( networkConfig, ) => { const { agoricNames, fromBoard, marshaller, readLatestHead, vstorage } = - await makeRpcUtils({ fetch }, networkConfig); + await makeVstorageKit({ fetch }, networkConfig); /** * diff --git a/a3p-integration/proposals/z:acceptance/core-eval.test.js b/a3p-integration/proposals/z:acceptance/core-eval.test.js index 7b92e35a6cb..086613e9c65 100644 --- a/a3p-integration/proposals/z:acceptance/core-eval.test.js +++ b/a3p-integration/proposals/z:acceptance/core-eval.test.js @@ -4,7 +4,7 @@ import test from 'ava'; import { readFile, writeFile } from 'node:fs/promises'; import { agd, evalBundles } from '@agoric/synthetic-chain'; -import { retryUntilCondition } from './test-lib/sync-tools.js'; +import { retryUntilCondition } from '@agoric/client-utils'; const SUBMISSION_DIR = 'core-eval-test-submission'; @@ -20,6 +20,7 @@ const replaceTemplateValuesInFile = async (fileName, replacements) => { await writeFile(`${fileName}.js`, script); }; +/** @param {string} path */ const readPublished = async path => { const { value } = await agd.query( 'vstorage', diff --git a/a3p-integration/proposals/z:acceptance/governance.test.js b/a3p-integration/proposals/z:acceptance/governance.test.js index 7e4b23b5418..31a8642dddd 100644 --- a/a3p-integration/proposals/z:acceptance/governance.test.js +++ b/a3p-integration/proposals/z:acceptance/governance.test.js @@ -1,35 +1,34 @@ /* global fetch setTimeout */ import test from 'ava'; -import '@endo/init'; -import { execFileSync } from 'node:child_process'; + +import { makeWalletUtils } from '@agoric/client-utils'; import { GOV1ADDR, GOV2ADDR } from '@agoric/synthetic-chain'; -import { networkConfig } from './test-lib/index.js'; -import { getLastUpdate, makeWalletUtils } from './test-lib/wallet.js'; import { makeGovernanceDriver } from './test-lib/governance.js'; +import { networkConfig } from './test-lib/index.js'; import { makeTimerUtils } from './test-lib/utils.js'; const GOV4ADDR = 'agoric1c9gyu460lu70rtcdp95vummd6032psmpdx7wdy'; const governanceAddresses = [GOV4ADDR, GOV2ADDR, GOV1ADDR]; +// TODO test-lib export `walletUtils` with this ambient authority like s:stake-bld has +/** @param {number} ms */ +const delay = ms => + new Promise(resolve => setTimeout(() => resolve(undefined), ms)); + test.serial( 'economic committee can make governance proposal and vote on it', async t => { const { waitUntil } = makeTimerUtils({ setTimeout }); - const { readLatestHead } = await makeWalletUtils( - { setTimeout, execFileSync, fetch }, - networkConfig, - ); + const { readLatestHead, getLastUpdate, getCurrentWalletRecord } = + await makeWalletUtils({ delay, fetch }, networkConfig); const governanceDriver = await makeGovernanceDriver(fetch, networkConfig); /** @type {any} */ const instance = await readLatestHead(`published.agoricNames.instance`); const instances = Object.fromEntries(instance); - /** @type {any} */ - const wallet = await readLatestHead( - `published.wallet.${governanceAddresses[0]}.current`, - ); + const wallet = await getCurrentWalletRecord(governanceAddresses[0]); const usedInvitations = wallet.offerToUsedInvitation; const charterInvitation = usedInvitations.find( @@ -37,6 +36,7 @@ test.serial( v[1].value[0].instance.getBoardId() === instances.econCommitteeCharter.getBoardId(), ); + assert(charterInvitation, 'missing charter invitation'); t.log('proposing on param change'); const params = { @@ -51,19 +51,17 @@ test.serial( charterInvitation[0], ); - const questionUpdate = await getLastUpdate(governanceAddresses[0], { - readLatestHead, - }); + const questionUpdate = await getLastUpdate(governanceAddresses[0]); t.like(questionUpdate, { status: { numWantsSatisfied: 1 }, }); t.log('Voting on param change'); for (const address of governanceAddresses) { - /** @type {any} */ - const voteWallet = await readLatestHead( - `published.wallet.${address}.current`, - ); + const voteWallet = + /** @type {import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord} */ ( + await readLatestHead(`published.wallet.${address}.current`) + ); const usedInvitationsForVoter = voteWallet.offerToUsedInvitation; @@ -72,21 +70,24 @@ test.serial( v[1].value[0].instance.getBoardId() === instances.economicCommittee.getBoardId(), ); + assert(committeeInvitationForVoter, 'missing committee invitation'); await governanceDriver.voteOnProposedChanges( address, committeeInvitationForVoter[0], ); - const voteUpdate = await getLastUpdate(address, { readLatestHead }); + const voteUpdate = await getLastUpdate(address); t.like(voteUpdate, { status: { numWantsSatisfied: 1 }, }); } - /** @type {any} */ - const latestQuestion = await readLatestHead( - 'published.committees.Economic_Committee.latestQuestion', - ); + const latestQuestion = + /** @type {import('@agoric/governance/src/types.js').QuestionSpec} */ ( + await readLatestHead( + 'published.committees.Economic_Committee.latestQuestion', + ) + ); await waitUntil(latestQuestion.closingRule.deadline); t.log('check if latest outcome is correct'); diff --git a/a3p-integration/proposals/z:acceptance/lib/vaults.mts b/a3p-integration/proposals/z:acceptance/lib/vaults.mts index cec0cfcf062..f130f6d4be7 100644 --- a/a3p-integration/proposals/z:acceptance/lib/vaults.mts +++ b/a3p-integration/proposals/z:acceptance/lib/vaults.mts @@ -1,4 +1,3 @@ -/* eslint-disable @jessie.js/safe-await-separator */ /* eslint-env node */ import { strict as assert } from 'node:assert'; @@ -57,7 +56,13 @@ const voteForNewParams = (accounts: string[], position: number) => { console.log('ACTIONS voting for position', position, 'using', accounts); return Promise.all( accounts.map((account: string) => - agops.ec('vote', '--forPosition', position, '--send-from', account), + agops.ec( + 'vote', + '--forPosition', + String(position), + '--send-from', + account, + ), ), ); }; diff --git a/a3p-integration/proposals/z:acceptance/localchain.test.js b/a3p-integration/proposals/z:acceptance/localchain.test.js index 3b8cd9c7e86..340e84a5f99 100644 --- a/a3p-integration/proposals/z:acceptance/localchain.test.js +++ b/a3p-integration/proposals/z:acceptance/localchain.test.js @@ -1,11 +1,12 @@ /* global setTimeout */ -import test from 'ava'; import { agd, evalBundles } from '@agoric/synthetic-chain'; +import test from 'ava'; import { retryUntilCondition } from './test-lib/sync-tools.js'; const SUBMISSION_DIR = 'localchaintest-submission'; +/** @param {string} path */ const readPublished = async path => { const { value } = await agd.query( 'vstorage', diff --git a/a3p-integration/proposals/z:acceptance/package.json b/a3p-integration/proposals/z:acceptance/package.json index 4d66b29daa9..03282e517d3 100644 --- a/a3p-integration/proposals/z:acceptance/package.json +++ b/a3p-integration/proposals/z:acceptance/package.json @@ -10,7 +10,9 @@ "type": "module", "license": "Apache-2.0", "dependencies": { + "@agoric/client-utils": "dev", "@agoric/ertp": "dev", + "@agoric/inter-protocol": "dev", "@agoric/internal": "dev", "@agoric/store": "dev", "@agoric/synthetic-chain": "^0.3.0", @@ -25,9 +27,58 @@ }, "$comment": "UNTIL https://github.com/Agoric/agoric-sdk/issues/10259", "resolutions": { - "@agoric/xsnap": "beta" + "$commentXsnap": "UNTIL https://github.com/Agoric/agoric-sdk/issues/10259", + "@agoric/xsnap": "beta", + "@agoric/cosmos": "portal:../../agoric-sdk/golang/cosmos", + "@agoric/ertp": "portal:../../agoric-sdk/packages/ERTP", + "@agoric/swingset-vat": "portal:../../agoric-sdk/packages/SwingSet", + "@agoric/access-token": "portal:../../agoric-sdk/packages/access-token", + "agoric": "portal:../../agoric-sdk/packages/agoric-cli", + "@agoric/async-flow": "portal:../../agoric-sdk/packages/async-flow", + "@agoric/base-zone": "portal:../../agoric-sdk/packages/base-zone", + "@agoric/builders": "portal:../../agoric-sdk/packages/builders", + "@agoric/cache": "portal:../../agoric-sdk/packages/cache", + "@agoric/casting": "portal:../../agoric-sdk/packages/casting", + "@agoric/client-utils": "portal:../../agoric-sdk/packages/client-utils", + "@agoric/cosmic-proto": "portal:../../agoric-sdk/packages/cosmic-proto", + "@agoric/cosmic-swingset": "portal:../../agoric-sdk/packages/cosmic-swingset", + "@agoric/create-dapp": "portal:../../agoric-sdk/packages/create-dapp", + "@agoric/deploy-script-support": "portal:../../agoric-sdk/packages/deploy-script-support", + "@agoric/eslint-config": "portal:../../agoric-sdk/packages/eslint-config", + "@agoric/governance": "portal:../../agoric-sdk/packages/governance", + "@agoric/import-manager": "portal:../../agoric-sdk/packages/import-manager", + "@agoric/inter-protocol": "portal:../../agoric-sdk/packages/inter-protocol", + "@agoric/internal": "portal:../../agoric-sdk/packages/internal", + "@agoric/kmarshal": "portal:../../agoric-sdk/packages/kmarshal", + "@agoric/network": "portal:../../agoric-sdk/packages/network", + "@agoric/notifier": "portal:../../agoric-sdk/packages/notifier", + "@agoric/orchestration": "portal:../../agoric-sdk/packages/orchestration", + "@agoric/pegasus": "portal:../../agoric-sdk/packages/pegasus", + "@agoric/smart-wallet": "portal:../../agoric-sdk/packages/smart-wallet", + "@agoric/solo": "portal:../../agoric-sdk/packages/solo", + "@agoric/sparse-ints": "portal:../../agoric-sdk/packages/sparse-ints", + "@agoric/spawner": "portal:../../agoric-sdk/packages/spawner", + "@agoric/stat-logger": "portal:../../agoric-sdk/packages/stat-logger", + "@agoric/store": "portal:../../agoric-sdk/packages/store", + "@agoric/swing-store": "portal:../../agoric-sdk/packages/swing-store", + "@agoric/swingset-liveslots": "portal:../../agoric-sdk/packages/swingset-liveslots", + "@agoric/swingset-xsnap-supervisor": "portal:../../agoric-sdk/packages/swingset-xsnap-supervisor", + "@agoric/telemetry": "portal:../../agoric-sdk/packages/telemetry", + "@agoric/time": "portal:../../agoric-sdk/packages/time", + "@agoric/vat-data": "portal:../../agoric-sdk/packages/vat-data", + "@agoric/vats": "portal:../../agoric-sdk/packages/vats", + "@agoric/vm-config": "portal:../../agoric-sdk/packages/vm-config", + "@agoric/vow": "portal:../../agoric-sdk/packages/vow", + "@agoric/wallet": "portal:../../agoric-sdk/packages/wallet", + "@agoric/wallet-backend": "portal:../../agoric-sdk/packages/wallet/api", + "@agoric/xsnap-lockdown": "portal:../../agoric-sdk/packages/xsnap-lockdown", + "@agoric/zoe": "portal:../../agoric-sdk/packages/zoe", + "@agoric/zone": "portal:../../agoric-sdk/packages/zone" }, "ava": { + "require": [ + "@endo/init/legacy.js" + ], "concurrency": 1, "serial": true, "timeout": "2m", @@ -38,7 +89,7 @@ "scripts": { "agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops" }, - "packageManager": "yarn@4.2.2", + "packageManager": "yarn@4.5.1", "devDependencies": { "typescript": "^5.5.4" } diff --git a/a3p-integration/proposals/z:acceptance/psm.test.js b/a3p-integration/proposals/z:acceptance/psm.test.js index bd64b3c5229..c902bce305e 100644 --- a/a3p-integration/proposals/z:acceptance/psm.test.js +++ b/a3p-integration/proposals/z:acceptance/psm.test.js @@ -12,7 +12,6 @@ * 6 - Make sure mint limit is adhered */ -import test from 'ava'; import { agd, agoric, @@ -20,9 +19,11 @@ import { GOV1ADDR, GOV2ADDR, } from '@agoric/synthetic-chain'; +import { waitUntilAccountFunded } from '@agoric/client-utils'; +import test from 'ava'; +import { NonNullish } from './test-lib/errors.js'; import { adjustBalancesIfNotProvisioned, - psmSwap, bankSend, checkGovParams, checkSwapExceedMintLimit, @@ -31,10 +32,9 @@ import { implementPsmGovParamChange, initializeNewUser, maxMintBelowLimit, + psmSwap, } from './test-lib/psm-lib.js'; import { getBalances } from './test-lib/utils.js'; -import { NonNullish } from './test-lib/errors.js'; -import { waitUntilAccountFunded } from './test-lib/sync-tools.js'; // Export these from synthetic-chain? const USDC_DENOM = NonNullish(process.env.USDC_DENOM); @@ -227,7 +227,7 @@ test.serial('mint limit is adhered', async t => { await bankSend(otherAddr, `${value}${denom}`); await waitUntilAccountFunded( otherAddr, - { query: agd.query, setTimeout }, + { log: t.log, query: agd.query, setTimeout }, { denom, value: parseInt(value, 10) }, { errorMessage: `${otherAddr} could not be funded with ${value}${denom}` }, ); diff --git a/a3p-integration/proposals/z:acceptance/test-lib/governance.js b/a3p-integration/proposals/z:acceptance/test-lib/governance.js index 910764d16c2..ce08264b870 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/governance.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/governance.js @@ -1,21 +1,26 @@ import { agops, agoric, executeOffer } from '@agoric/synthetic-chain'; -import { makeRpcUtils } from './rpc.js'; +import { makeVstorageKit } from '@agoric/client-utils'; +/** + * @param {typeof window.fetch} fetch + * @param {import('@agoric/client-utils').MinimalNetworkConfig} networkConfig + */ export const makeGovernanceDriver = async (fetch, networkConfig) => { - const { readLatestHead, marshaller } = await makeRpcUtils( + const { readLatestHead, marshaller } = await makeVstorageKit( { fetch }, networkConfig, ); + /** @param {string} previousOfferId */ const generateVoteOffer = async previousOfferId => { const id = `propose-${Date.now()}`; - /** - * @type {object} - */ - const latestQuestionRecord = await readLatestHead( - 'published.committees.Economic_Committee.latestQuestion', - ); + const latestQuestionRecord = + /** @type {import('@agoric/governance/src/types.js').QuestionSpec} */ ( + await readLatestHead( + 'published.committees.Economic_Committee.latestQuestion', + ) + ); const chosenPositions = [latestQuestionRecord.positions[0]]; const body = { @@ -28,6 +33,7 @@ export const makeGovernanceDriver = async (fetch, networkConfig) => { source: 'continuing', invitationArgs: harden([ chosenPositions, + // @ts-expect-error narrowing latestQuestionRecord.questionHandle, ]), }, @@ -39,7 +45,10 @@ export const makeGovernanceDriver = async (fetch, networkConfig) => { return JSON.stringify(capData); }; - const voteOnProposedChanges = async (address, committeeAcceptOfferId) => { + const voteOnProposedChanges = async ( + /** @type {string} */ address, + /** @type {string} */ committeeAcceptOfferId, + ) => { await null; const offerId = committeeAcceptOfferId || @@ -54,6 +63,18 @@ export const makeGovernanceDriver = async (fetch, networkConfig) => { return executeOffer(address, generateVoteOffer(offerId)); }; + /** + * Generates a vault director parameter change proposal as a `executeOffer` message + * body. + * + * @param {string} previousOfferId - the `id` of the offer that this proposal is + * responding to + * @param {string | number | bigint | boolean} voteDur - how long the vote should + * be open for (in seconds) + * @param {any} params + * @param {{ paramPath: any; }} paramsPath + * @returns {Promise} - the `executeOffer` message body as a JSON string + */ const generateVaultDirectorParamChange = async ( previousOfferId, voteDur, @@ -61,7 +82,7 @@ export const makeGovernanceDriver = async (fetch, networkConfig) => { paramsPath, ) => { const voteDurSec = BigInt(voteDur); - const toSec = ms => BigInt(Math.round(ms / 1000)); + const toSec = (/** @type {number} */ ms) => BigInt(Math.round(ms / 1000)); const id = `propose-${Date.now()}`; const deadline = toSec(Date.now()) + voteDurSec; @@ -98,6 +119,13 @@ export const makeGovernanceDriver = async (fetch, networkConfig) => { return JSON.stringify(capData); }; + /** + * + * @param {string} address + * @param {any} params + * @param {{paramPath: any}} path + * @param {string} charterAcceptOfferId + */ const proposeVaultDirectorParamChange = async ( address, params, diff --git a/a3p-integration/proposals/z:acceptance/test-lib/index.js b/a3p-integration/proposals/z:acceptance/test-lib/index.js index 55bbfe8ff20..479d81503fc 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/index.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/index.js @@ -1,4 +1,27 @@ +/* eslint-env node */ +import { makeWalletUtils } 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', }; + +/** + * Resolve after a delay in milliseconds. + * + * @param {number} ms + * @returns {Promise} + */ +const delay = ms => new Promise(resolve => setTimeout(() => resolve(), ms)); + +export const walletUtils = await makeWalletUtils( + { delay, fetch }, + networkConfig, +); + +export const agdWalletUtils = await makeAgdWalletUtils( + { execFileSync, setTimeout, walletUtils }, + networkConfig, +); diff --git a/a3p-integration/proposals/z:acceptance/test-lib/kread.js b/a3p-integration/proposals/z:acceptance/test-lib/kread.js index 83ecc0c3f77..01cd0d29b5f 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/kread.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/kread.js @@ -1,5 +1,6 @@ -import assert from 'assert'; -import '@endo/init'; +// @ts-nocheck FIXME +import assert from 'node:assert'; + import { agoric, executeOffer, @@ -9,10 +10,11 @@ import { import { execFileSync } from 'child_process'; import { makeCopyBag } from '@agoric/store'; import { AmountMath } from '@agoric/ertp'; -import { makeFromBoard, boardSlottingMarshaller } from './rpc.js'; +import { boardSlottingMarshaller, makeFromBoard } from '@agoric/client-utils'; const ISTunit = 1_000_000n; +/** @type {(file: string, args: string[], opts: any) => string} */ const showAndExec = (file, args, opts) => { console.log('$', file, ...args); return execFileSync(file, args, opts); diff --git a/a3p-integration/proposals/z:acceptance/test-lib/price-feed.js b/a3p-integration/proposals/z:acceptance/test-lib/price-feed.js index 179cfa5c203..ea30984d5b5 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/price-feed.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/price-feed.js @@ -1,12 +1,12 @@ /* eslint-env node */ +import { retryUntilCondition } from '@agoric/client-utils'; import { agoric, getContractInfo, - pushPrices, getPriceQuote, + pushPrices, } from '@agoric/synthetic-chain'; -import { retryUntilCondition } from './sync-tools.js'; export const scale6 = x => BigInt(x * 1_000_000); diff --git a/a3p-integration/proposals/z:acceptance/test-lib/psm-lib.js b/a3p-integration/proposals/z:acceptance/test-lib/psm-lib.js index be07700df72..b2a157691f5 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/psm-lib.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/psm-lib.js @@ -1,35 +1,39 @@ /* eslint-env node */ -import '@endo/init'; +import { + boardSlottingMarshaller, + makeFromBoard, + retryUntilCondition, + waitUntilAccountFunded, + waitUntilOfferResult, +} from '@agoric/client-utils'; +import { AmountMath } from '@agoric/ertp'; import { addUser, agd, agops, + agopsLocation, agoric, + CHAINID, + executeCommand, executeOffer, getUser, - agopsLocation, - executeCommand, - CHAINID, - VALIDATORADDR, GOV1ADDR, mkTemp, + VALIDATORADDR, } from '@agoric/synthetic-chain'; -import { AmountMath } from '@agoric/ertp'; import fsp from 'node:fs/promises'; -import { boardSlottingMarshaller, makeFromBoard } from './rpc.js'; -import { getBalances } from './utils.js'; -import { - retryUntilCondition, - waitUntilAccountFunded, - waitUntilOfferResult, -} from './sync-tools.js'; import { NonNullish } from './errors.js'; +import { getBalances } from './utils.js'; // Export these from synthetic-chain? const USDC_DENOM = NonNullish(process.env.USDC_DENOM); const PSM_PAIR = NonNullish(process.env.PSM_PAIR).replace('.', '-'); +/** + * @import {Coin} from '@agoric/cosmic-proto/cosmos/base/v1beta1/coin.js'; + */ + /** * @typedef {object} PsmMetrics * @property {import('@agoric/ertp').Amount<'nat'>} anchorPoolBalance @@ -37,8 +41,6 @@ const PSM_PAIR = NonNullish(process.env.PSM_PAIR).replace('.', '-'); * @property {import('@agoric/ertp').Amount<'nat'>} mintedPoolBalance * @property {import('@agoric/ertp').Amount<'nat'>} totalAnchorProvided * @property {import('@agoric/ertp').Amount<'nat'>} totalMintedProvided - * - * @typedef {Array<{ denom: string; amount: string; }>} CosmosBalances */ const fromBoard = makeFromBoard(); @@ -128,7 +130,7 @@ export const buildProposePSMParamChangeOffer = async ({ params.MintLimit = AmountMath.make(brands.IST, newParams.mintLimit); } - const offerSpec = { + const offerSpec = /** @type {const} */ ({ id: offerId, invitationSpec: { source: 'continuing', @@ -141,14 +143,14 @@ export const buildProposePSMParamChangeOffer = async ({ params, deadline, }, - }; + }); - /** @type {string | object} */ const spendAction = { method: 'executeOffer', offer: offerSpec, }; + // @ts-expect-error XXX Passable const offer = JSON.stringify(marshaller.toCapData(harden(spendAction))); console.log(offerSpec); console.log(offer); @@ -194,7 +196,10 @@ export const fetchLatestEcQuestion = async io => { return { latestOutcome, latestQuestion }; }; -const checkCommitteeElectionResult = (electionResult, expectedResult) => { +const checkCommitteeElectionResult = ( + /** @type {{ latestOutcome: { outcome: any; question: any; }; latestQuestion: { closingRule: { deadline: any; }; questionHandle: any; }; }} */ electionResult, + /** @type {{ outcome: any; deadline: any; }} */ expectedResult, +) => { const { latestOutcome: { outcome, question }, latestQuestion: { @@ -290,7 +295,11 @@ export const getPsmMetrics = async anchor => { return marshaller.fromCapData(JSON.parse(metricsRaw)); }; -export const checkGovParams = async (t, expected, psmName) => { +export const checkGovParams = async ( + /** @type {import("ava").ExecutionContext} */ t, + /** @type {any} */ expected, + /** @type {string} */ psmName, +) => { const current = await getPsmGovernance(psmName); t.log({ @@ -327,7 +336,7 @@ export const checkUserInitializedSuccessfully = async ( * denom: string, * value: string * }} fund - * @param io + * @param {{query: () => Promise, setTimeout: typeof setTimeout}} io */ export const initializeNewUser = async (name, fund, io) => { const psmTrader = await addUser(name); @@ -375,7 +384,7 @@ export const sendOfferAgoric = async (address, offerPromise) => { * @param {Array} params * @param {{ * follow: (...params: string[]) => Promise; - * setTimeout: (callback: Function, delay: number) => void; + * setTimeout: typeof global.setTimeout; * now: () => number * }} io */ @@ -407,7 +416,7 @@ const receiveAnchor = (base, fee) => Math.ceil(base * (1 - fee)); /** * - * @param {CosmosBalances} balances + * @param {Coin[]} balances * @param {string} targetDenom */ const extractBalance = (balances, targetDenom) => { @@ -445,7 +454,7 @@ export const tryISTBalances = async (t, actualBalance, expectedBalance) => { * * @param {import('ava').ExecutionContext} t * @param {PsmMetrics} metricsBefore - * @param {CosmosBalances} balancesBefore + * @param {Coin[]} balancesBefore * @param {{trader: string; fee: number; anchor: string;} & ( * | {wantMinted: number} * | {giveMinted: number} diff --git a/a3p-integration/proposals/z:acceptance/test-lib/rpc.js b/a3p-integration/proposals/z:acceptance/test-lib/rpc.js index 5e047204151..907072d2376 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/rpc.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/rpc.js @@ -234,7 +234,7 @@ export const makeAgoricNames = async (ctx, vstorage) => { * @param {{ fetch: typeof window.fetch }} io * @param {MinimalNetworkConfig} config */ -export const makeRpcUtils = async ({ fetch }, config = networkConfig) => { +export const makeVstorageKit = async ({ fetch }, config = networkConfig) => { await null; try { const vstorage = makeVStorage({ fetch }, config); @@ -263,4 +263,4 @@ export const makeRpcUtils = async ({ fetch }, config = networkConfig) => { throw Error(`RPC failure (${config.rpcAddrs}): ${err.message}`); } }; -/** @typedef {Awaited>} RpcUtils */ +/** @typedef {Awaited>} RpcUtils */ diff --git a/a3p-integration/proposals/z:acceptance/test-lib/utils.js b/a3p-integration/proposals/z:acceptance/test-lib/utils.js index 8c6300876ed..69b67992f7c 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/utils.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/utils.js @@ -1,7 +1,15 @@ -import { makeAgd, agops, agoric } from '@agoric/synthetic-chain'; -import { execFileSync } from 'node:child_process'; +/* eslint-env node */ +import { makeStargateClient, makeVstorageKit } from '@agoric/client-utils'; import { readFile, writeFile } from 'node:fs/promises'; -import { boardSlottingMarshaller, makeFromBoard } from './rpc.js'; +import { networkConfig } from './rpc.js'; + +export const stargateClientP = makeStargateClient(networkConfig, { fetch }); +export const vstorageKitP = makeVstorageKit({ fetch }, networkConfig); + +/** + * @import {WalletUtils} from '@agoric/client-utils'; + * @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js'; + */ /** * @param {string} fileName base file name without .tjs extension @@ -15,24 +23,17 @@ export const replaceTemplateValuesInFile = async (fileName, replacements) => { await writeFile(`${fileName}.js`, script); }; -const showAndExec = (file, args, opts) => { - console.log('$', file, ...args); - return execFileSync(file, args, opts); -}; - -// @ts-expect-error string is not assignable to Buffer -export const agd = makeAgd({ execFileSync: showAndExec }).withOpts({ - keyringBackend: 'test', -}); - +// FIXME this return type depends on its arguments in surprising ways /** * @param {string[]} addresses * @param {string} [targetDenom] + * @returns {Promise} */ export const getBalances = async (addresses, targetDenom = undefined) => { + const client = await stargateClientP; const balancesList = await Promise.all( addresses.map(async address => { - const { balances } = await agd.query(['bank', 'balances', address]); + const balances = await client.getAllBalances(address); if (targetDenom) { const balance = balances.find(({ denom }) => denom === targetDenom); @@ -46,8 +47,27 @@ export const getBalances = async (addresses, targetDenom = undefined) => { return addresses.length === 1 ? balancesList[0] : balancesList; }; -export const agopsVaults = addr => agops.vaults('list', '--from', addr); +// TODO move this out of testing. To inter-protocol? +// "vaults" is an Inter thing, but vstorage shape is a full chain (client) thing +// Maybe a plugin architecture where the truth is in inter-protocol and the +// client-lib rolls up the exports of many packages? +/** + * @param {string} addr + * @param {WalletUtils} walletUtils + * @returns {Promise} + */ +export const listVaults = async (addr, { getCurrentWalletRecord }) => { + const current = await getCurrentWalletRecord(addr); + const vaultStoragePaths = current.offerToPublicSubscriberPaths.map( + ([_offerId, pathmap]) => pathmap.vault, + ); + return vaultStoragePaths; +}; + +/** + * @param {{setTimeout: typeof setTimeout}} io + */ export const makeTimerUtils = ({ setTimeout }) => { /** * Resolve after a delay in milliseconds. @@ -57,6 +77,7 @@ export const makeTimerUtils = ({ setTimeout }) => { */ const delay = ms => new Promise(resolve => setTimeout(() => resolve(), ms)); + /** @param {number} timestamp */ const waitUntil = async timestamp => { const timeDelta = Math.floor(Date.now() / 1000) - Number(timestamp); await delay(timeDelta); @@ -67,22 +88,3 @@ export const makeTimerUtils = ({ setTimeout }) => { waitUntil, }; }; - -const fromBoard = makeFromBoard(); -const marshaller = boardSlottingMarshaller(fromBoard.convertSlotToVal); - -export const getAgoricNamesBrands = async () => { - const brands = await agoric - .follow('-lF', ':published.agoricNames.brand', '-o', 'text') - .then(res => Object.fromEntries(marshaller.fromCapData(JSON.parse(res)))); - - return brands; -}; - -export const getAgoricNamesInstances = async () => { - const instances = await agoric - .follow('-lF', ':published.agoricNames.instance', '-o', 'text') - .then(res => Object.fromEntries(marshaller.fromCapData(JSON.parse(res)))); - - return instances; -}; diff --git a/a3p-integration/proposals/z:acceptance/test-lib/vaults.js b/a3p-integration/proposals/z:acceptance/test-lib/vaults.js index 4ce0ff42716..af37b718b4a 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/vaults.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/vaults.js @@ -1,6 +1,11 @@ /* eslint-env node */ -import '@endo/init'; +import { + boardSlottingMarshaller, + makeFromBoard, + retryUntilCondition, +} from '@agoric/client-utils'; +import { AmountMath } from '@agoric/ertp'; import { agops, agoric, @@ -9,14 +14,13 @@ import { GOV1ADDR, GOV2ADDR, } from '@agoric/synthetic-chain'; -import { AmountMath } from '@agoric/ertp'; import { ceilMultiplyBy, makeRatio, } from '@agoric/zoe/src/contractSupport/ratio.js'; -import { getAgoricNamesBrands, getAgoricNamesInstances } from './utils.js'; -import { boardSlottingMarshaller, makeFromBoard } from './rpc.js'; -import { retryUntilCondition } from './sync-tools.js'; +import { E } from '@endo/far'; +import { walletUtils } from './index.js'; +import { listVaults, vstorageKitP } from './utils.js'; const fromBoard = makeFromBoard(); const marshaller = boardSlottingMarshaller(fromBoard.convertSlotToVal); @@ -26,7 +30,7 @@ const marshaller = boardSlottingMarshaller(fromBoard.convertSlotToVal); * @returns {Promise<{ vaultID: string, debt: bigint, collateral: bigint, state: string }>} */ export const getLastVaultFromAddress = async address => { - const activeVaults = await agops.vaults('list', '--from', address); + const activeVaults = await listVaults(address, walletUtils); const vaultPath = activeVaults[activeVaults.length - 1]; const vaultID = vaultPath.split('.').pop(); @@ -93,7 +97,7 @@ export const getMinInitialDebt = async () => { * @returns {Promise<{ mintFee: import('@agoric/ertp/src/types.js').NatAmount, adjustedToMintAmount: import('@agoric/ertp/src/types.js').NatAmount }>} */ export const calculateMintFee = async (toMintValue, vaultManager) => { - const brands = await getAgoricNamesBrands(); + const { brand } = await E.get(vstorageKitP).agoricNames; const governancePath = `published.vaultFactory.managers.${vaultManager}.governance`; const governance = await getContractInfo(governancePath, { @@ -106,27 +110,44 @@ export const calculateMintFee = async (toMintValue, vaultManager) => { const mintFeeRatio = makeRatio( numerator.value, - brands.IST, + brand.IST, denominator.value, - brands.IST, + brand.IST, ); - const toMintAmount = AmountMath.make(brands.IST, toMintValue * 1_000_000n); + // @ts-expect-error XXX BoardRemote not Brand + const toMintAmount = AmountMath.make(brand.IST, toMintValue * 1_000_000n); const expectedMintFee = ceilMultiplyBy(toMintAmount, mintFeeRatio); const adjustedToMintAmount = AmountMath.add(toMintAmount, expectedMintFee); return { mintFee, adjustedToMintAmount }; }; +/** + * @param {Array} accounts + * @param {number} position + */ const voteForNewParams = (accounts, position) => { console.log('ACTIONS voting for position', position, 'using', accounts); return Promise.all( accounts.map(account => - agops.ec('vote', '--forPosition', position, '--send-from', account), + agops.ec( + 'vote', + '--forPosition', + String(position), + '--send-from', + account, + ), ), ); }; +/** + * + * @param {string} previousOfferId + * @param {number} voteDur + * @param {number} debtLimit + */ const paramChangeOfferGeneration = async ( previousOfferId, voteDur, @@ -134,11 +155,11 @@ const paramChangeOfferGeneration = async ( ) => { const ISTunit = 1_000_000n; // aka displayInfo: { decimalPlaces: 6 } - const brand = await getAgoricNamesBrands(); + const { brand } = await E.get(vstorageKitP).agoricNames; assert(brand.IST); assert(brand.ATOM); - const instance = await getAgoricNamesInstances(); + const { instance } = await E.get(vstorageKitP).agoricNames; assert(instance.VaultFactory); const voteDurSec = BigInt(voteDur); @@ -181,6 +202,12 @@ const paramChangeOfferGeneration = async ( return JSON.stringify(marshaller.toCapData(harden(body))); }; +/** + * + * @param {string} address + * @param {*} debtLimit + * @returns + */ export const proposeNewDebtCeiling = async (address, debtLimit) => { const charterAcceptOfferId = await agops.ec( 'find-continuing-id', @@ -197,6 +224,12 @@ export const proposeNewDebtCeiling = async (address, debtLimit) => { }; export const GOV4ADDR = 'agoric1c9gyu460lu70rtcdp95vummd6032psmpdx7wdy'; + +/** + * + * @param {string} address + * @param {bigint} debtLimit + */ export const setDebtLimit = async (address, debtLimit) => { const govAccounts = [GOV1ADDR, GOV2ADDR, GOV4ADDR]; diff --git a/a3p-integration/proposals/z:acceptance/test-lib/wallet.js b/a3p-integration/proposals/z:acceptance/test-lib/wallet.js index 366a988fc8f..04fcb8f9ccc 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/wallet.js +++ b/a3p-integration/proposals/z:acceptance/test-lib/wallet.js @@ -1,91 +1,11 @@ -/** - * @file copied from packages/agoric-cli, - * removing polling and coalescing features whose dependencies cause import problems here - */ // TODO DRY in https://github.com/Agoric/agoric-sdk/issues/9109 // @ts-check /* global */ -import { E, Far } from '@endo/far'; import { inspect } from 'util'; import { execSwingsetTransaction, pollTx } from './chain.js'; -import { makeRpcUtils } from './rpc.js'; import { makeTimerUtils } from './utils.js'; -/** @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js' */ -/** @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js' */ - -/** - * @template T - * @param follower - * @param [options] - */ -export const iterateReverse = (follower, options) => - // For now, just pass through the iterable. - Far('iterateReverse iterable', { - /** @returns {AsyncIterator} */ - [Symbol.asyncIterator]: () => { - const eachIterable = E(follower).getReverseIterable(options); - const iterator = E(eachIterable)[Symbol.asyncIterator](); - return Far('iterateEach iterator', { - next: () => E(iterator).next(), - }); - }, - }); - -/** @type {CurrentWalletRecord} */ -const emptyCurrentRecord = { - purses: [], - offerToUsedInvitation: [], - offerToPublicSubscriberPaths: [], - liveOffers: [], -}; - -/** - * @param {string} addr - * @param {Pick} io - * @returns {Promise} - */ -export const getCurrent = async (addr, { readLatestHead }) => { - // Partial because older writes may not have had all properties - // NB: assumes changes are only additions - let current = - /** @type {Partial | undefined} */ ( - await readLatestHead(`published.wallet.${addr}.current`) - ); - if (current === undefined) { - throw Error(`undefined current node for ${addr}`); - } - - // Repair a type misunderstanding seen in the wild. - // See https://github.com/Agoric/agoric-sdk/pull/7139 - let offerToUsedInvitation = current.offerToUsedInvitation; - if ( - offerToUsedInvitation && - typeof offerToUsedInvitation === 'object' && - !Array.isArray(offerToUsedInvitation) - ) { - offerToUsedInvitation = Object.entries(offerToUsedInvitation); - current = harden({ - ...current, - offerToUsedInvitation, - }); - } - - // override full empty record with defined values from published one - return { ...emptyCurrentRecord, ...current }; -}; - -/** - * @param {string} addr - * @param {Pick} io - * @returns {Promise} - */ -export const getLastUpdate = (addr, { readLatestHead }) => { - // @ts-expect-error cast - return readLatestHead(`published.wallet.${addr}`); -}; - /** * Sign and broadcast a wallet-action. * @@ -93,7 +13,7 @@ export const getLastUpdate = (addr, { readLatestHead }) => { * @param {import('@agoric/smart-wallet/src/smartWallet.js').BridgeAction} bridgeAction * @param {import('./rpc.js').MinimalNetworkConfig & { * from: string, - * marshaller: import('@endo/marshal').Marshal<'string'>, + * marshaller: Pick, 'toCapData'>, * fees?: string, * verbose?: boolean, * keyring?: {home?: string, backend: string}, @@ -132,12 +52,20 @@ export const sendAction = async (bridgeAction, opts) => { return pollTx(tx.txhash, opts); }; -export const makeWalletUtils = async ( - { setTimeout, execFileSync, fetch }, +/** + * Stop-gap using execFileSync until we have a pure JS signing client. + * + * @param {object} root0 + * @param {import('@agoric/client-utils').WalletUtils} root0.walletUtils + * @param {import('child_process')['execFileSync']} root0.execFileSync + * @param {typeof setTimeout} root0.setTimeout + * @param {import('@agoric/client-utils').MinimalNetworkConfig} networkConfig + */ +export const makeAgdWalletUtils = async ( + { execFileSync, walletUtils, setTimeout }, networkConfig, ) => { - const { agoricNames, fromBoard, marshaller, readLatestHead, vstorage } = - await makeRpcUtils({ fetch }, networkConfig); + const { marshaller } = walletUtils; const { delay } = await makeTimerUtils({ setTimeout }); /** @@ -158,11 +86,6 @@ export const makeWalletUtils = async ( }; return { - agoricNames, broadcastBridgeAction, - fromBoard, - networkConfig, - readLatestHead, - vstorage, }; }; diff --git a/a3p-integration/proposals/z:acceptance/tsconfig.json b/a3p-integration/proposals/z:acceptance/tsconfig.json index bd1c45190fe..dbebe7a229e 100644 --- a/a3p-integration/proposals/z:acceptance/tsconfig.json +++ b/a3p-integration/proposals/z:acceptance/tsconfig.json @@ -9,6 +9,7 @@ "strict": false, "strictNullChecks": true, "noImplicitThis": true, + "noImplicitAny": true, // XXX synthetic-chain has some errors "skipLibCheck": true } diff --git a/a3p-integration/proposals/z:acceptance/valueVow.test.js b/a3p-integration/proposals/z:acceptance/valueVow.test.js index 81cbae6de82..738c8a30bae 100644 --- a/a3p-integration/proposals/z:acceptance/valueVow.test.js +++ b/a3p-integration/proposals/z:acceptance/valueVow.test.js @@ -1,36 +1,27 @@ -/* global fetch setTimeout */ - // @ts-check +/* eslint-env node */ import test from 'ava'; import { inspect } from 'node:util'; -import { execFileSync } from 'node:child_process'; -import '@endo/init/debug.js'; +import { retryUntilCondition } from '@agoric/client-utils'; import { evalBundles, getIncarnation, GOV1ADDR as GETTER, // not particular to governance, just a handy wallet - GOV2ADDR as SETTER, // not particular to governance, just a handy wallet + GOV2ADDR as SETTER, } from '@agoric/synthetic-chain'; -import { makeWalletUtils } from './test-lib/wallet.js'; -import { networkConfig } from './test-lib/index.js'; -import { retryUntilCondition } from './test-lib/sync-tools.js'; +import { agdWalletUtils, walletUtils } from './test-lib/index.js'; const START_VALUEVOW_DIR = 'start-valueVow'; const RESTART_VALUEVOW_DIR = 'restart-valueVow'; test('vow survives restart', async t => { - const walletUtils = await makeWalletUtils( - { setTimeout, execFileSync, fetch }, - networkConfig, - ); - t.log('start valueVow'); await evalBundles(START_VALUEVOW_DIR); t.is(await getIncarnation('valueVow'), 0); t.log('use wallet to get a vow'); - await walletUtils.broadcastBridgeAction(GETTER, { + await agdWalletUtils.broadcastBridgeAction(GETTER, { method: 'executeOffer', offer: { id: 'get-value', @@ -48,7 +39,7 @@ test('vow survives restart', async t => { async () => walletUtils.readLatestHead(`published.wallet.${GETTER}`), value => value.status.id === 'get-value' && value.updated === 'offerStatus', 'Offer get-value not succeeded', - { setTimeout, retryIntervalMs: 5000, maxRetries: 15 }, + { log: t.log, setTimeout, retryIntervalMs: 5000, maxRetries: 15 }, ); console.log('current: ', inspect(getterStatus, { depth: 10 })); @@ -67,7 +58,7 @@ test('vow survives restart', async t => { const offerArgs = { value: 'Ciao, mondo!' }; t.log('use wallet to set value'); - await walletUtils.broadcastBridgeAction(SETTER, { + await agdWalletUtils.broadcastBridgeAction(SETTER, { method: 'executeOffer', offer: { id: 'set-value', diff --git a/a3p-integration/proposals/z:acceptance/vaults.test.js b/a3p-integration/proposals/z:acceptance/vaults.test.js index a32e8e1115a..42d8a5b0157 100644 --- a/a3p-integration/proposals/z:acceptance/vaults.test.js +++ b/a3p-integration/proposals/z:acceptance/vaults.test.js @@ -1,21 +1,29 @@ +/* eslint-env node */ import test from 'ava'; -import '@endo/init'; + +import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; import { - bankSend, - getUser, - openVault, adjustVault, - closeVault, - getISTBalance, ATOM_DENOM, - USER1ADDR, - GOV1ADDR, + bankSend, + closeVault, generateOracleMap, + getISTBalance, getPriceQuote, + getUser, getVaultPrices, + GOV1ADDR, GOV2ADDR, + openVault, + USER1ADDR, } from '@agoric/synthetic-chain'; -import { getBalances, agopsVaults } from './test-lib/utils.js'; +import { agdWalletUtils, walletUtils } from './test-lib/index.js'; +import { + getPriceFeedRoundId, + verifyPushedPrice, +} from './test-lib/price-feed.js'; +import { bankSend as sendIST, tryISTBalances } from './test-lib/psm-lib.js'; +import { getBalances, listVaults } from './test-lib/utils.js'; import { calculateMintFee, getAvailableDebtForMint, @@ -23,28 +31,55 @@ import { getMinInitialDebt, setDebtLimit, } from './test-lib/vaults.js'; -import { - verifyPushedPrice, - getPriceFeedRoundId, -} from './test-lib/price-feed.js'; -import { tryISTBalances, bankSend as sendIST } from './test-lib/psm-lib.js'; const VAULT_MANAGER = 'manager0'; const scale6 = x => x * 1_000_000; +// TODO produce this dynamically from an Offers object exported from a package clientSupport +const exec = { + vaults: { + // TODO decide how to handle defaults, whether CLI and this should have the same + /** + * @param {string} from + * @param {Parameters[1]['wantMinted']} wantMinted + * @param {Parameters[1]['giveCollateral']} giveCollateral + * @param {Parameters[1]['offerId']} offerId + * @param {Parameters[1]['collateralBrandKey']} collateralBrandKey + */ + OpenVault: ( + from, + wantMinted, + giveCollateral, + offerId = `openVault-${Date.now()}`, + collateralBrandKey = 'ATOM', + ) => { + const offer = Offers.vaults.OpenVault(walletUtils.agoricNames, { + giveCollateral, + wantMinted, + offerId, + collateralBrandKey, + }); + return agdWalletUtils.broadcastBridgeAction(from, { + method: 'executeOffer', + offer, + }); + }, + }, +}; + test.serial('open new vault', async t => { await bankSend(USER1ADDR, `20000000${ATOM_DENOM}`); const istBalanceBefore = await getISTBalance(USER1ADDR); - const activeVaultsBefore = await agopsVaults(USER1ADDR); + const activeVaultsBefore = await listVaults(USER1ADDR, walletUtils); - const mint = '5.0'; - const collateral = '10.0'; - await openVault(USER1ADDR, mint, collateral); + const mint = 5.0; + const collateral = 10.0; + await exec.vaults.OpenVault(USER1ADDR, mint, collateral); const istBalanceAfter = await getISTBalance(USER1ADDR); - const activeVaultsAfter = await agopsVaults(USER1ADDR); + const activeVaultsAfter = await listVaults(USER1ADDR, walletUtils); await tryISTBalances( t, @@ -142,7 +177,7 @@ test.serial( 'user cannot open a vault under the minimum initial debt', async t => { await bankSend(GOV1ADDR, `200000000000000000${ATOM_DENOM}`); - const activeVaultsBefore = await agopsVaults(GOV1ADDR); + const activeVaultsBefore = await listVaults(GOV1ADDR, walletUtils); const minInitialDebt = await getMinInitialDebt(); @@ -156,7 +191,7 @@ test.serial( }, ); - const activeVaultsAfter = await agopsVaults(GOV1ADDR); + const activeVaultsAfter = await listVaults(GOV1ADDR, walletUtils); t.is( activeVaultsAfter.length, @@ -167,7 +202,7 @@ test.serial( ); test.serial('user cannot open a vault above debt limit', async t => { - const activeVaultsBefore = await agopsVaults(GOV1ADDR); + const activeVaultsBefore = await listVaults(GOV1ADDR, walletUtils); const { availableDebtForMint } = await getAvailableDebtForMint(VAULT_MANAGER); @@ -181,7 +216,7 @@ test.serial('user cannot open a vault above debt limit', async t => { }, ); - const activeVaultsAfter = await agopsVaults(GOV1ADDR); + const activeVaultsAfter = await listVaults(GOV1ADDR, walletUtils); t.is( activeVaultsAfter.length, @@ -192,7 +227,7 @@ test.serial('user cannot open a vault above debt limit', async t => { test.serial('user can open a vault under debt limit', async t => { const istBalanceBefore = await getISTBalance(GOV1ADDR); - const activeVaultsBefore = await agopsVaults(GOV1ADDR); + const activeVaultsBefore = await listVaults(GOV1ADDR, walletUtils); const { availableDebtForMint } = await getAvailableDebtForMint(VAULT_MANAGER); @@ -202,7 +237,7 @@ test.serial('user can open a vault under debt limit', async t => { await openVault(GOV1ADDR, mint.toString(), collateral.toString()); const istBalanceAfter = await getISTBalance(GOV1ADDR); - const activeVaultsAfter = await agopsVaults(GOV1ADDR); + const activeVaultsAfter = await listVaults(GOV1ADDR, walletUtils); t.is( istBalanceBefore + Number(mint), diff --git a/a3p-integration/proposals/z:acceptance/wallet.test.js b/a3p-integration/proposals/z:acceptance/wallet.test.js index 8d7375f385a..2ae1a0bd275 100644 --- a/a3p-integration/proposals/z:acceptance/wallet.test.js +++ b/a3p-integration/proposals/z:acceptance/wallet.test.js @@ -1,28 +1,29 @@ -/* global fetch setTimeout */ +/* eslint-env node */ import test from 'ava'; -import '@endo/init'; + +import { retryUntilCondition } from '@agoric/client-utils'; import { agoric, + CHAINID, evalBundles, GOV1ADDR, GOV2ADDR, - CHAINID, + makeAgd, } from '@agoric/synthetic-chain'; -import { execFileSync } from 'child_process'; -import { - agd, - getBalances, - replaceTemplateValuesInFile, -} from './test-lib/utils.js'; -import { retryUntilCondition } from './test-lib/sync-tools.js'; -import { makeWalletUtils } from './test-lib/wallet.js'; -import { networkConfig } from './test-lib/index.js'; - -const walletUtils = await makeWalletUtils( - { setTimeout, execFileSync, fetch }, - networkConfig, -); +import { execFileSync } from 'node:child_process'; +import { agdWalletUtils } from './test-lib/index.js'; +import { getBalances, replaceTemplateValuesInFile } from './test-lib/utils.js'; + +const showAndExec = (file, args, opts) => { + console.log('$', file, ...args); + return execFileSync(file, args, opts); +}; + +// @ts-expect-error string is not assignable to Buffer +const agd = makeAgd({ execFileSync: showAndExec }).withOpts({ + keyringBackend: 'test', +}); test.serial(`send invitation via namesByAddress`, async t => { const SUBMISSION_DIR = 'invitation-test-submission'; @@ -55,7 +56,7 @@ test.serial('exitOffer tool reclaims stuck payment', async t => { const istBalanceBefore = await getBalances([GOV1ADDR], 'uist'); const offerId = 'bad-invitation-15'; // offer submitted on proposal upgrade-15 with an incorrect method name - await walletUtils.broadcastBridgeAction(GOV1ADDR, { + await agdWalletUtils.broadcastBridgeAction(GOV1ADDR, { method: 'tryExitOffer', offerId, }); @@ -64,7 +65,7 @@ test.serial('exitOffer tool reclaims stuck payment', async t => { async () => getBalances([GOV1ADDR], 'uist'), istBalance => istBalance > istBalanceBefore, 'tryExitOffer failed to reclaim stuck payment ', - { setTimeout, retryIntervalMs: 5000, maxRetries: 15 }, + { log: t.log, setTimeout, retryIntervalMs: 5000, maxRetries: 15 }, ); t.true( diff --git a/a3p-integration/proposals/z:acceptance/yarn.lock b/a3p-integration/proposals/z:acceptance/yarn.lock index a1f4017c2ec..85e82e2435c 100644 --- a/a3p-integration/proposals/z:acceptance/yarn.lock +++ b/a3p-integration/proposals/z:acceptance/yarn.lock @@ -5,14 +5,7 @@ __metadata: version: 8 cacheKey: 10c0 -"@agoric/assert@npm:^0.4.0": - version: 0.4.0 - resolution: "@agoric/assert@npm:0.4.0" - checksum: 10c0/76f56924a891c5fcbeafce7545530c9e5bfe96dccd05b74dff3a3b9b31e30f60462791f5313afa3090e8966d679ed5628b9e8f50c48168ecfc8c36e8cf345161 - languageName: node - linkType: hard - -"@agoric/babel-generator@npm:^7.17.4, @agoric/babel-generator@npm:^7.17.6": +"@agoric/babel-generator@npm:^7.17.6": version: 7.17.6 resolution: "@agoric/babel-generator@npm:7.17.6" dependencies: @@ -23,44 +16,77 @@ __metadata: languageName: node linkType: hard -"@agoric/base-zone@npm:0.1.1-dev-44132c0.0+44132c0": - version: 0.1.1-dev-44132c0.0 - resolution: "@agoric/base-zone@npm:0.1.1-dev-44132c0.0" +"@agoric/base-zone@portal:../../agoric-sdk/packages/base-zone::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/base-zone@portal:../../agoric-sdk/packages/base-zone::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/store": "npm:0.9.3-dev-44132c0.0+44132c0" + "@agoric/store": "npm:^0.9.2" "@endo/common": "npm:^1.2.7" "@endo/errors": "npm:^1.2.7" "@endo/exo": "npm:^1.5.6" "@endo/far": "npm:^1.1.8" "@endo/pass-style": "npm:^1.4.6" "@endo/patterns": "npm:^1.4.6" - checksum: 10c0/66bffee9feb03f5c940b5072b0f291ea4daec8fbc7a20e688773a41d90a75e1c83a59e0b0947f6a14448c88aab83ee3054db432903cf7c05168b6f76e0424fef languageName: node - linkType: hard + linkType: soft -"@agoric/base-zone@npm:0.1.1-dev-d7c994b.0+d7c994b": - version: 0.1.1-dev-d7c994b.0 - resolution: "@agoric/base-zone@npm:0.1.1-dev-d7c994b.0" - dependencies: - "@agoric/store": "npm:0.9.3-dev-d7c994b.0+d7c994b" - "@endo/common": "npm:^1.2.7" +"@agoric/casting@portal:../../agoric-sdk/packages/casting::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/casting@portal:../../agoric-sdk/packages/casting::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/internal": "npm:^0.3.2" + "@agoric/notifier": "npm:^0.6.2" + "@agoric/store": "npm:^0.9.2" + "@cosmjs/encoding": "npm:^0.32.3" + "@cosmjs/proto-signing": "npm:^0.32.3" + "@cosmjs/stargate": "npm:^0.32.3" + "@cosmjs/tendermint-rpc": "npm:^0.32.3" "@endo/errors": "npm:^1.2.7" - "@endo/exo": "npm:^1.5.6" "@endo/far": "npm:^1.1.8" + "@endo/init": "npm:^1.1.6" + "@endo/lockdown": "npm:^1.0.12" + "@endo/marshal": "npm:^1.6.1" + "@endo/promise-kit": "npm:^1.1.7" + languageName: node + linkType: soft + +"@agoric/client-utils@portal:../../agoric-sdk/packages/client-utils::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/client-utils@portal:../../agoric-sdk/packages/client-utils::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/casting": "npm:^0.4.2" + "@agoric/ertp": "npm:^0.16.2" + "@agoric/internal": "npm:^0.3.2" + "@agoric/smart-wallet": "npm:^0.5.3" + "@agoric/vats": "npm:^0.15.1" + "@cosmjs/stargate": "npm:^0.32.3" + "@cosmjs/tendermint-rpc": "npm:^0.32.3" + "@endo/common": "npm:^1.2.7" + "@endo/errors": "npm:^1.2.7" + "@endo/marshal": "npm:^1.6.1" "@endo/pass-style": "npm:^1.4.6" "@endo/patterns": "npm:^1.4.6" - checksum: 10c0/c739aaba377d0f9409561ece7f9ed94ef3cdad7ddbbf56609bc50ea9fe71446fccbd92bb5a4dcb11a40872fdf862b5a7836b8140b5639ca501717b569249a344 + "@endo/promise-kit": "npm:^1.1.7" languageName: node - linkType: hard + linkType: soft -"@agoric/ertp@npm:0.16.3-dev-44132c0.0+44132c0": - version: 0.16.3-dev-44132c0.0 - resolution: "@agoric/ertp@npm:0.16.3-dev-44132c0.0" +"@agoric/cosmic-proto@portal:../../agoric-sdk/packages/cosmic-proto::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/cosmic-proto@portal:../../agoric-sdk/packages/cosmic-proto::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/notifier": "npm:0.6.3-dev-44132c0.0+44132c0" - "@agoric/store": "npm:0.9.3-dev-44132c0.0+44132c0" - "@agoric/vat-data": "npm:0.5.3-dev-44132c0.0+44132c0" - "@agoric/zone": "npm:0.2.3-dev-44132c0.0+44132c0" + "@endo/base64": "npm:^1.0.8" + "@endo/init": "npm:^1.1.6" + languageName: node + linkType: soft + +"@agoric/ertp@portal:../../agoric-sdk/packages/ERTP::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/ertp@portal:../../agoric-sdk/packages/ERTP::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/notifier": "npm:^0.6.2" + "@agoric/store": "npm:^0.9.2" + "@agoric/vat-data": "npm:^0.5.2" + "@agoric/zone": "npm:^0.2.2" "@endo/errors": "npm:^1.2.7" "@endo/eventual-send": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" @@ -68,54 +94,61 @@ __metadata: "@endo/nat": "npm:^5.0.12" "@endo/patterns": "npm:^1.4.6" "@endo/promise-kit": "npm:^1.1.7" - checksum: 10c0/ff8232603cb00861869f8708aed26d7c9437f616c6d86ee6163af4819f8220ef5d280f8bdce1ea51818326faabc71a2513b4f3f82688e7454d1ff51c57e95dcd languageName: node - linkType: hard + linkType: soft -"@agoric/ertp@npm:dev": - version: 0.16.3-dev-d7c994b.0 - resolution: "@agoric/ertp@npm:0.16.3-dev-d7c994b.0" - dependencies: - "@agoric/notifier": "npm:0.6.3-dev-d7c994b.0+d7c994b" - "@agoric/store": "npm:0.9.3-dev-d7c994b.0+d7c994b" - "@agoric/vat-data": "npm:0.5.3-dev-d7c994b.0+d7c994b" - "@agoric/zone": "npm:0.2.3-dev-d7c994b.0+d7c994b" +"@agoric/governance@portal:../../agoric-sdk/packages/governance::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/governance@portal:../../agoric-sdk/packages/governance::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/ertp": "npm:^0.16.2" + "@agoric/internal": "npm:^0.3.2" + "@agoric/notifier": "npm:^0.6.2" + "@agoric/store": "npm:^0.9.2" + "@agoric/time": "npm:^0.3.2" + "@agoric/vat-data": "npm:^0.5.2" + "@agoric/zoe": "npm:^0.26.2" + "@endo/bundle-source": "npm:^3.4.2" + "@endo/captp": "npm:^4.4.2" "@endo/errors": "npm:^1.2.7" "@endo/eventual-send": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" "@endo/marshal": "npm:^1.6.1" "@endo/nat": "npm:^5.0.12" - "@endo/patterns": "npm:^1.4.6" "@endo/promise-kit": "npm:^1.1.7" - checksum: 10c0/050e7755fcabb1fb624b58742f02571a7b459361ef13f508002c5c64993c22200faf66df8e931caf293e35290ce42bffef3e912839d05a18d26224263e039cf3 + import-meta-resolve: "npm:^2.2.1" languageName: node - linkType: hard + linkType: soft -"@agoric/internal@npm:0.3.3-dev-44132c0.0+44132c0": - version: 0.3.3-dev-44132c0.0 - resolution: "@agoric/internal@npm:0.3.3-dev-44132c0.0" - dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-44132c0.0+44132c0" - "@endo/common": "npm:^1.2.7" +"@agoric/inter-protocol@portal:../../agoric-sdk/packages/inter-protocol::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/inter-protocol@portal:../../agoric-sdk/packages/inter-protocol::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/ertp": "npm:^0.16.2" + "@agoric/governance": "npm:^0.10.3" + "@agoric/internal": "npm:^0.3.2" + "@agoric/notifier": "npm:^0.6.2" + "@agoric/store": "npm:^0.9.2" + "@agoric/time": "npm:^0.3.2" + "@agoric/vat-data": "npm:^0.5.2" + "@agoric/vats": "npm:^0.15.1" + "@agoric/zoe": "npm:^0.26.2" + "@endo/captp": "npm:^4.4.2" "@endo/errors": "npm:^1.2.7" + "@endo/eventual-send": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" - "@endo/init": "npm:^1.1.6" "@endo/marshal": "npm:^1.6.1" - "@endo/pass-style": "npm:^1.4.6" - "@endo/patterns": "npm:^1.4.6" + "@endo/nat": "npm:^5.0.12" "@endo/promise-kit": "npm:^1.1.7" - "@endo/stream": "npm:^1.2.7" - anylogger: "npm:^0.21.0" jessie.js: "npm:^0.3.4" - checksum: 10c0/85c80e2adf3bae4811d8b8c38073044d44519f44a366b79e2a74be774062adf33f2d33628f1957a15df7fc0844fa3b959308a32b6de8d79aee0ffe4ba9d39de6 languageName: node - linkType: hard + linkType: soft -"@agoric/internal@npm:0.3.3-dev-d7c994b.0+d7c994b, @agoric/internal@npm:dev": - version: 0.3.3-dev-d7c994b.0 - resolution: "@agoric/internal@npm:0.3.3-dev-d7c994b.0" +"@agoric/internal@portal:../../agoric-sdk/packages/internal::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/internal@portal:../../agoric-sdk/packages/internal::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-d7c994b.0+d7c994b" + "@agoric/base-zone": "npm:^0.1.0" "@endo/common": "npm:^1.2.7" "@endo/errors": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" @@ -127,119 +160,103 @@ __metadata: "@endo/stream": "npm:^1.2.7" anylogger: "npm:^0.21.0" jessie.js: "npm:^0.3.4" - checksum: 10c0/ce8e58f77c92b4dab1f87ba708b1e189906cf66fcf846d0949ce24822eebca01c76ee5bb992fd4c98fe02add0dc95f502d2a0f7c4f08d6d320268b369e82a9b9 languageName: node - linkType: hard + linkType: soft -"@agoric/kmarshal@npm:0.1.1-dev-44132c0.0+44132c0": - version: 0.1.1-dev-44132c0.0 - resolution: "@agoric/kmarshal@npm:0.1.1-dev-44132c0.0" +"@agoric/kmarshal@portal:../../agoric-sdk/packages/kmarshal::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/kmarshal@portal:../../agoric-sdk/packages/kmarshal::locator=root-workspace-0b6124%40workspace%3A." dependencies: "@endo/errors": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" "@endo/marshal": "npm:^1.6.1" - checksum: 10c0/edbb6f2cd7417d1d428dfd9fe7a0155f5565e0733dba405b3521c093a771b4fb1c8c08999bf051f05392f9065829ba5d901d2079a3eb75c2a0189c682ecf052e languageName: node - linkType: hard + linkType: soft -"@agoric/notifier@npm:0.6.3-dev-44132c0.0+44132c0": - version: 0.6.3-dev-44132c0.0 - resolution: "@agoric/notifier@npm:0.6.3-dev-44132c0.0" +"@agoric/network@portal:../../agoric-sdk/packages/network::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/network@portal:../../agoric-sdk/packages/network::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/internal": "npm:0.3.3-dev-44132c0.0+44132c0" - "@agoric/vat-data": "npm:0.5.3-dev-44132c0.0+44132c0" + "@agoric/internal": "npm:^0.3.2" + "@agoric/store": "npm:^0.9.2" + "@agoric/vat-data": "npm:^0.5.2" + "@endo/base64": "npm:^1.0.8" "@endo/errors": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" - "@endo/marshal": "npm:^1.6.1" + "@endo/pass-style": "npm:^1.4.6" "@endo/patterns": "npm:^1.4.6" "@endo/promise-kit": "npm:^1.1.7" - checksum: 10c0/7db28a1f92ac72ec9f0301d30db32974a4b240d3699a9effa6198fdcc77340d76cb7c60b932f18cd0ff9eb2baea7fa0d5e44c2611cea91f3053cfafcdbb465cc languageName: node - linkType: hard + linkType: soft -"@agoric/notifier@npm:0.6.3-dev-d7c994b.0+d7c994b": - version: 0.6.3-dev-d7c994b.0 - resolution: "@agoric/notifier@npm:0.6.3-dev-d7c994b.0" +"@agoric/notifier@portal:../../agoric-sdk/packages/notifier::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/notifier@portal:../../agoric-sdk/packages/notifier::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/internal": "npm:0.3.3-dev-d7c994b.0+d7c994b" - "@agoric/vat-data": "npm:0.5.3-dev-d7c994b.0+d7c994b" + "@agoric/internal": "npm:^0.3.2" + "@agoric/vat-data": "npm:^0.5.2" "@endo/errors": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" "@endo/marshal": "npm:^1.6.1" "@endo/patterns": "npm:^1.4.6" "@endo/promise-kit": "npm:^1.1.7" - checksum: 10c0/93951f38ea10f5eef09e0aa89db8e9bbd0579f8ed14fd0161701c2eb3070c25138b2076e7c101c53e36ecbf1da7cf477cc1c1d5e520f8107a0e5ebf02aa9796f languageName: node - linkType: hard + linkType: soft -"@agoric/store@npm:0.9.3-dev-44132c0.0+44132c0": - version: 0.9.3-dev-44132c0.0 - resolution: "@agoric/store@npm:0.9.3-dev-44132c0.0" - dependencies: +"@agoric/smart-wallet@portal:../../agoric-sdk/packages/smart-wallet::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/smart-wallet@portal:../../agoric-sdk/packages/smart-wallet::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/ertp": "npm:^0.16.2" + "@agoric/internal": "npm:^0.3.2" + "@agoric/notifier": "npm:^0.6.2" + "@agoric/store": "npm:^0.9.2" + "@agoric/vat-data": "npm:^0.5.2" + "@agoric/vats": "npm:^0.15.1" + "@agoric/vow": "npm:^0.1.0" + "@agoric/zoe": "npm:^0.26.2" + "@agoric/zone": "npm:^0.2.2" "@endo/errors": "npm:^1.2.7" - "@endo/exo": "npm:^1.5.6" + "@endo/eventual-send": "npm:^1.2.7" + "@endo/far": "npm:^1.1.8" "@endo/marshal": "npm:^1.6.1" - "@endo/pass-style": "npm:^1.4.6" - "@endo/patterns": "npm:^1.4.6" - checksum: 10c0/c587b6e7de35e1f5ecd8e461dc23ef48070f5c9311710ee4f4499b8f6f57fd18df0a40cd963dd8f9d22933780d37422fd52bcad4db7f00d31bb659e64a67e91a + "@endo/nat": "npm:^5.0.12" + "@endo/promise-kit": "npm:^1.1.7" languageName: node - linkType: hard + linkType: soft -"@agoric/store@npm:0.9.3-dev-d7c994b.0+d7c994b, @agoric/store@npm:dev": - version: 0.9.3-dev-d7c994b.0 - resolution: "@agoric/store@npm:0.9.3-dev-d7c994b.0" +"@agoric/store@portal:../../agoric-sdk/packages/store::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/store@portal:../../agoric-sdk/packages/store::locator=root-workspace-0b6124%40workspace%3A." dependencies: "@endo/errors": "npm:^1.2.7" "@endo/exo": "npm:^1.5.6" "@endo/marshal": "npm:^1.6.1" "@endo/pass-style": "npm:^1.4.6" "@endo/patterns": "npm:^1.4.6" - checksum: 10c0/0d90e03e71dd3f9a152308b0d3ebfe9a5e31e56bf47dcd1e7c58c38dba52ecf72279aa04c44c4f4e1570428b3828419cc59b1072c3346f9fed502a8828dae0b0 languageName: node - linkType: hard + linkType: soft -"@agoric/swing-store@npm:0.9.2-dev-44132c0.0+44132c0": - version: 0.9.2-dev-44132c0.0 - resolution: "@agoric/swing-store@npm:0.9.2-dev-44132c0.0" +"@agoric/swing-store@portal:../../agoric-sdk/packages/swing-store::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/swing-store@portal:../../agoric-sdk/packages/swing-store::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/internal": "npm:0.3.3-dev-44132c0.0+44132c0" + "@agoric/internal": "npm:^0.3.2" "@endo/base64": "npm:^1.0.8" "@endo/bundle-source": "npm:^3.4.2" "@endo/check-bundle": "npm:^1.0.11" "@endo/errors": "npm:^1.2.7" "@endo/nat": "npm:^5.0.12" better-sqlite3: "npm:^9.1.1" - checksum: 10c0/8d1bb191729a17338e697dcd96e47ece2c57d1d7edf277730a17c0c0ca9eff476ccbc0d05218d29412672fa58025ccc3d508998697cf4117257b7dcd1169cb1e - languageName: node - linkType: hard - -"@agoric/swingset-liveslots@npm:0.10.3-dev-44132c0.0+44132c0": - version: 0.10.3-dev-44132c0.0 - resolution: "@agoric/swingset-liveslots@npm:0.10.3-dev-44132c0.0" - dependencies: - "@agoric/internal": "npm:0.3.3-dev-44132c0.0+44132c0" - "@agoric/store": "npm:0.9.3-dev-44132c0.0+44132c0" - "@endo/env-options": "npm:^1.1.7" - "@endo/errors": "npm:^1.2.7" - "@endo/eventual-send": "npm:^1.2.7" - "@endo/exo": "npm:^1.5.6" - "@endo/far": "npm:^1.1.8" - "@endo/init": "npm:^1.1.6" - "@endo/marshal": "npm:^1.6.1" - "@endo/nat": "npm:^5.0.12" - "@endo/pass-style": "npm:^1.4.6" - "@endo/patterns": "npm:^1.4.6" - "@endo/promise-kit": "npm:^1.1.7" - checksum: 10c0/a4256b9b551cef41e31acfb6bf05416f6be24993013477774e8cad5cef138606bda0bb410914adf602820a331129b2e918b5968e035a1702cd89daaf1b7c81fd languageName: node - linkType: hard + linkType: soft -"@agoric/swingset-liveslots@npm:0.10.3-dev-d7c994b.0+d7c994b": - version: 0.10.3-dev-d7c994b.0 - resolution: "@agoric/swingset-liveslots@npm:0.10.3-dev-d7c994b.0" +"@agoric/swingset-liveslots@portal:../../agoric-sdk/packages/swingset-liveslots::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/swingset-liveslots@portal:../../agoric-sdk/packages/swingset-liveslots::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/internal": "npm:0.3.3-dev-d7c994b.0+d7c994b" - "@agoric/store": "npm:0.9.3-dev-d7c994b.0+d7c994b" + "@agoric/internal": "npm:^0.3.2" + "@agoric/store": "npm:^0.9.2" "@endo/env-options": "npm:^1.1.7" "@endo/errors": "npm:^1.2.7" "@endo/eventual-send": "npm:^1.2.7" @@ -251,24 +268,22 @@ __metadata: "@endo/pass-style": "npm:^1.4.6" "@endo/patterns": "npm:^1.4.6" "@endo/promise-kit": "npm:^1.1.7" - checksum: 10c0/ab846647342126e6c0f16a1709c938a75c4e75f4cfffeaeeef70ec33e193ade258d18ee748cfa220e6e38239c79692b6a6ae082facaf95519b0485d711a14a7e languageName: node - linkType: hard + linkType: soft -"@agoric/swingset-vat@npm:0.32.3-dev-44132c0.0+44132c0": - version: 0.32.3-dev-44132c0.0 - resolution: "@agoric/swingset-vat@npm:0.32.3-dev-44132c0.0" - dependencies: - "@agoric/internal": "npm:0.3.3-dev-44132c0.0+44132c0" - "@agoric/kmarshal": "npm:0.1.1-dev-44132c0.0+44132c0" - "@agoric/store": "npm:0.9.3-dev-44132c0.0+44132c0" - "@agoric/swing-store": "npm:0.9.2-dev-44132c0.0+44132c0" - "@agoric/swingset-liveslots": "npm:0.10.3-dev-44132c0.0+44132c0" - "@agoric/swingset-xsnap-supervisor": "npm:0.10.3-dev-44132c0.0+44132c0" - "@agoric/time": "npm:0.3.3-dev-44132c0.0+44132c0" - "@agoric/vat-data": "npm:0.5.3-dev-44132c0.0+44132c0" - "@agoric/xsnap": "npm:0.14.3-dev-44132c0.0+44132c0" - "@agoric/xsnap-lockdown": "npm:0.14.1-dev-44132c0.0+44132c0" +"@agoric/swingset-vat@portal:../../agoric-sdk/packages/SwingSet::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/swingset-vat@portal:../../agoric-sdk/packages/SwingSet::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/internal": "npm:^0.3.2" + "@agoric/kmarshal": "npm:^0.1.0" + "@agoric/store": "npm:^0.9.2" + "@agoric/swing-store": "npm:^0.9.1" + "@agoric/swingset-liveslots": "npm:^0.10.2" + "@agoric/swingset-xsnap-supervisor": "npm:^0.10.2" + "@agoric/time": "npm:^0.3.2" + "@agoric/vat-data": "npm:^0.5.2" + "@agoric/xsnap-lockdown": "npm:^0.14.0" "@endo/base64": "npm:^1.0.8" "@endo/bundle-source": "npm:^3.4.2" "@endo/captp": "npm:^4.4.2" @@ -296,19 +311,18 @@ __metadata: tmp: "npm:^0.2.1" yargs-parser: "npm:^21.1.1" peerDependencies: + "@agoric/xsnap": ^0.14.2 ava: ^5.3.0 bin: vat: bin/vat - checksum: 10c0/c51d74501e42d99b9f5bd60ee6e1a8edcd0db0821f82dbfd85876f76bfc740ede9493dbcde3cf2cef2479f47319db45e7f93fb22b513c60ed01af52a94187b63 languageName: node - linkType: hard + linkType: soft -"@agoric/swingset-xsnap-supervisor@npm:0.10.3-dev-44132c0.0+44132c0": - version: 0.10.3-dev-44132c0.0 - resolution: "@agoric/swingset-xsnap-supervisor@npm:0.10.3-dev-44132c0.0" - checksum: 10c0/aa0dfe53beaa8c5b1d2dac1dac0e8b8e7085f15c67de7577fb1af14728625fc4a92ff6a303f0901fc50db302eb87af2fa70868dd865a5c014f3f8a3f3410c634 +"@agoric/swingset-xsnap-supervisor@portal:../../agoric-sdk/packages/swingset-xsnap-supervisor::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/swingset-xsnap-supervisor@portal:../../agoric-sdk/packages/swingset-xsnap-supervisor::locator=root-workspace-0b6124%40workspace%3A." languageName: node - linkType: hard + linkType: soft "@agoric/synthetic-chain@npm:^0.3.0": version: 0.3.0 @@ -325,104 +339,96 @@ __metadata: languageName: node linkType: hard -"@agoric/time@npm:0.3.3-dev-44132c0.0+44132c0": - version: 0.3.3-dev-44132c0.0 - resolution: "@agoric/time@npm:0.3.3-dev-44132c0.0" +"@agoric/time@portal:../../agoric-sdk/packages/time::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/time@portal:../../agoric-sdk/packages/time::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/store": "npm:0.9.3-dev-44132c0.0+44132c0" + "@agoric/store": "npm:^0.9.2" "@endo/errors": "npm:^1.2.7" "@endo/nat": "npm:^5.0.12" "@endo/patterns": "npm:^1.4.6" - checksum: 10c0/a7ed479c3f519a1c0ec3bc939f455d7816728cdbff7f60cfbc11a06340a2af0672203670850845d60856c25fc4b8856e275bee7c341f19ea04ed9ca7889fe71c languageName: node - linkType: hard + linkType: soft -"@agoric/vat-data@npm:0.5.3-dev-44132c0.0+44132c0": - version: 0.5.3-dev-44132c0.0 - resolution: "@agoric/vat-data@npm:0.5.3-dev-44132c0.0" +"@agoric/vat-data@portal:../../agoric-sdk/packages/vat-data::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/vat-data@portal:../../agoric-sdk/packages/vat-data::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-44132c0.0+44132c0" - "@agoric/store": "npm:0.9.3-dev-44132c0.0+44132c0" - "@agoric/swingset-liveslots": "npm:0.10.3-dev-44132c0.0+44132c0" + "@agoric/base-zone": "npm:^0.1.0" + "@agoric/store": "npm:^0.9.2" + "@agoric/swingset-liveslots": "npm:^0.10.2" "@endo/errors": "npm:^1.2.7" "@endo/exo": "npm:^1.5.6" "@endo/patterns": "npm:^1.4.6" - checksum: 10c0/aa7bca1b26b1add0de4340ad2a5f14134abe6bb0dbe928023c8c2b9f310d0d551ad97abd05692cfe33ffcf160cdbf27684dc5ea72ac8569a87f272637bd2c439 languageName: node - linkType: hard + linkType: soft -"@agoric/vat-data@npm:0.5.3-dev-d7c994b.0+d7c994b": - version: 0.5.3-dev-d7c994b.0 - resolution: "@agoric/vat-data@npm:0.5.3-dev-d7c994b.0" - dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-d7c994b.0+d7c994b" - "@agoric/store": "npm:0.9.3-dev-d7c994b.0+d7c994b" - "@agoric/swingset-liveslots": "npm:0.10.3-dev-d7c994b.0+d7c994b" +"@agoric/vats@portal:../../agoric-sdk/packages/vats::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/vats@portal:../../agoric-sdk/packages/vats::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/cosmic-proto": "npm:^0.4.0" + "@agoric/ertp": "npm:^0.16.2" + "@agoric/governance": "npm:^0.10.3" + "@agoric/internal": "npm:^0.3.2" + "@agoric/network": "npm:^0.1.0" + "@agoric/notifier": "npm:^0.6.2" + "@agoric/store": "npm:^0.9.2" + "@agoric/swingset-vat": "npm:^0.32.2" + "@agoric/time": "npm:^0.3.2" + "@agoric/vat-data": "npm:^0.5.2" + "@agoric/vow": "npm:^0.1.0" + "@agoric/zoe": "npm:^0.26.2" + "@agoric/zone": "npm:^0.2.2" "@endo/errors": "npm:^1.2.7" - "@endo/exo": "npm:^1.5.6" + "@endo/far": "npm:^1.1.8" + "@endo/import-bundle": "npm:^1.3.1" + "@endo/marshal": "npm:^1.6.1" + "@endo/nat": "npm:^5.0.12" + "@endo/pass-style": "npm:^1.4.6" "@endo/patterns": "npm:^1.4.6" - checksum: 10c0/860280ad7f09f499d8fea3d494c787748571a12b2e636c53762924064c9ea2e6c0e7fbe50c41f804f981f32066d82d3ff0a733c58276df180e5670b5b382a79f + "@endo/promise-kit": "npm:^1.1.7" + import-meta-resolve: "npm:^2.2.1" + jessie.js: "npm:^0.3.4" languageName: node - linkType: hard + linkType: soft -"@agoric/vow@npm:0.1.1-dev-44132c0.0+44132c0": - version: 0.1.1-dev-44132c0.0 - resolution: "@agoric/vow@npm:0.1.1-dev-44132c0.0" +"@agoric/vow@portal:../../agoric-sdk/packages/vow::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/vow@portal:../../agoric-sdk/packages/vow::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-44132c0.0+44132c0" - "@agoric/internal": "npm:0.3.3-dev-44132c0.0+44132c0" + "@agoric/base-zone": "npm:^0.1.0" + "@agoric/internal": "npm:^0.3.2" "@endo/env-options": "npm:^1.1.7" "@endo/errors": "npm:^1.2.7" "@endo/eventual-send": "npm:^1.2.7" "@endo/pass-style": "npm:^1.4.6" "@endo/patterns": "npm:^1.4.6" "@endo/promise-kit": "npm:^1.1.7" - checksum: 10c0/8771de0db121b11c4fa8f32abf6e86ffe2db0e9afdef459beabcda3e582d9cf428f6fd20fcd8501f292ef775a55eb2a43c2f8f6f20f0cd3d3f429cb75a250d0c languageName: node - linkType: hard + linkType: soft -"@agoric/xsnap-lockdown@npm:0.14.1-dev-44132c0.0+44132c0": - version: 0.14.1-dev-44132c0.0 - resolution: "@agoric/xsnap-lockdown@npm:0.14.1-dev-44132c0.0" - checksum: 10c0/057212a8f1aa2323b8f7d097900729158f08d99b887ea8b7dc0f6df44ea2093fa240f214da4b5261fc5a21d3022dfda2bb26e588022cbad8c4726b087a872091 +"@agoric/xsnap-lockdown@portal:../../agoric-sdk/packages/xsnap-lockdown::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/xsnap-lockdown@portal:../../agoric-sdk/packages/xsnap-lockdown::locator=root-workspace-0b6124%40workspace%3A." languageName: node - linkType: hard + linkType: soft -"@agoric/xsnap@npm:beta": - version: 0.13.0 - resolution: "@agoric/xsnap@npm:0.13.0" - dependencies: - "@agoric/assert": "npm:^0.4.0" - "@endo/bundle-source": "npm:^2.2.0" - "@endo/eventual-send": "npm:^0.15.3" - "@endo/init": "npm:^0.5.41" - "@endo/netstring": "npm:^0.3.11" - "@endo/stream": "npm:^0.3.10" - "@endo/stream-node": "npm:^0.2.11" - glob: "npm:^7.1.6" - rollup-plugin-string: "npm:^3.0.0" - bin: - ava-xs: src/ava-xs.js - xsrepl: src/xsrepl - checksum: 10c0/5014144f82156d77f760290bb569430eb3078ace26037b50ddd63be63f7b57b4b60b0ff9fa32b029559acc583e3e7b1951aa8b46de6bf399bbcb997844ce97c5 - languageName: node - linkType: hard - -"@agoric/zoe@npm:dev": - version: 0.26.3-dev-44132c0.0 - resolution: "@agoric/zoe@npm:0.26.3-dev-44132c0.0" - dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-44132c0.0+44132c0" - "@agoric/ertp": "npm:0.16.3-dev-44132c0.0+44132c0" - "@agoric/internal": "npm:0.3.3-dev-44132c0.0+44132c0" - "@agoric/notifier": "npm:0.6.3-dev-44132c0.0+44132c0" - "@agoric/store": "npm:0.9.3-dev-44132c0.0+44132c0" - "@agoric/swingset-liveslots": "npm:0.10.3-dev-44132c0.0+44132c0" - "@agoric/swingset-vat": "npm:0.32.3-dev-44132c0.0+44132c0" - "@agoric/time": "npm:0.3.3-dev-44132c0.0+44132c0" - "@agoric/vat-data": "npm:0.5.3-dev-44132c0.0+44132c0" - "@agoric/vow": "npm:0.1.1-dev-44132c0.0+44132c0" - "@agoric/zone": "npm:0.2.3-dev-44132c0.0+44132c0" +"@agoric/zoe@portal:../../agoric-sdk/packages/zoe::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/zoe@portal:../../agoric-sdk/packages/zoe::locator=root-workspace-0b6124%40workspace%3A." + dependencies: + "@agoric/base-zone": "npm:^0.1.0" + "@agoric/ertp": "npm:^0.16.2" + "@agoric/internal": "npm:^0.3.2" + "@agoric/notifier": "npm:^0.6.2" + "@agoric/store": "npm:^0.9.2" + "@agoric/swingset-liveslots": "npm:^0.10.2" + "@agoric/swingset-vat": "npm:^0.32.2" + "@agoric/time": "npm:^0.3.2" + "@agoric/vat-data": "npm:^0.5.2" + "@agoric/vow": "npm:^0.1.0" + "@agoric/zone": "npm:^0.2.2" "@endo/bundle-source": "npm:^3.4.2" "@endo/captp": "npm:^4.4.2" "@endo/common": "npm:^1.2.7" @@ -437,35 +443,20 @@ __metadata: "@endo/patterns": "npm:^1.4.6" "@endo/promise-kit": "npm:^1.1.7" yargs-parser: "npm:^21.1.1" - checksum: 10c0/777087b245e1d5ba61f5c76ca6ba5d7e4b653e399e6765ea0f74a3e8c3ac8dddf4193537a39648eb9972ddf4e3f0e24c04957d6f0f65f64247adf6a8de73a639 - languageName: node - linkType: hard - -"@agoric/zone@npm:0.2.3-dev-44132c0.0+44132c0": - version: 0.2.3-dev-44132c0.0 - resolution: "@agoric/zone@npm:0.2.3-dev-44132c0.0" - dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-44132c0.0+44132c0" - "@agoric/vat-data": "npm:0.5.3-dev-44132c0.0+44132c0" - "@endo/errors": "npm:^1.2.7" - "@endo/far": "npm:^1.1.8" - "@endo/pass-style": "npm:^1.4.6" - checksum: 10c0/d11086b651f77a9811d04cff371f65ce342e725f50282ae71f0a3cee468173a2cb1c70ead053858e77c8dd37087d99ece7bd7811eeec17e64137b6dc1b7429fa languageName: node - linkType: hard + linkType: soft -"@agoric/zone@npm:0.2.3-dev-d7c994b.0+d7c994b": - version: 0.2.3-dev-d7c994b.0 - resolution: "@agoric/zone@npm:0.2.3-dev-d7c994b.0" +"@agoric/zone@portal:../../agoric-sdk/packages/zone::locator=root-workspace-0b6124%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@agoric/zone@portal:../../agoric-sdk/packages/zone::locator=root-workspace-0b6124%40workspace%3A." dependencies: - "@agoric/base-zone": "npm:0.1.1-dev-d7c994b.0+d7c994b" - "@agoric/vat-data": "npm:0.5.3-dev-d7c994b.0+d7c994b" + "@agoric/base-zone": "npm:^0.1.0" + "@agoric/vat-data": "npm:^0.5.2" "@endo/errors": "npm:^1.2.7" "@endo/far": "npm:^1.1.8" "@endo/pass-style": "npm:^1.4.6" - checksum: 10c0/ac5cbe949e81048cbaf08b1e5ad5a91c3693a0516d21214e7638b04a2a352e531221f8d1ae1b05b4506a34ea0de2f707a36c9147268082bada887d3df99fcc84 languageName: node - linkType: hard + linkType: soft "@babel/code-frame@npm:^7.25.9": version: 7.26.2 @@ -505,7 +496,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.17.3, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.23.6, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2": version: 7.26.2 resolution: "@babel/parser@npm:7.26.2" dependencies: @@ -527,7 +518,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.17.3, @babel/traverse@npm:^7.23.6": +"@babel/traverse@npm:^7.23.6": version: 7.25.9 resolution: "@babel/traverse@npm:7.25.9" dependencies: @@ -552,41 +543,155 @@ __metadata: languageName: node linkType: hard -"@endo/base64@npm:^0.2.35": - version: 0.2.35 - resolution: "@endo/base64@npm:0.2.35" - checksum: 10c0/5935cd609cbe3da91e9bdbc1c3a2be0460c58302d0b92ae63054e537aa9e2e5648a238810ec548d7367166c72094c38e2dbf0b16a37c6987c8d7353d1b0123a1 +"@confio/ics23@npm:^0.6.8": + version: 0.6.8 + resolution: "@confio/ics23@npm:0.6.8" + dependencies: + "@noble/hashes": "npm:^1.0.0" + protobufjs: "npm:^6.8.8" + checksum: 10c0/2f3f5032cd6a34c9b2fbd64bbf7e1cdec75ca71f348a770f7b5474b5027b12202bfbcd404eca931efddb5901f769af035a87cb8bddbf3f23d7e5d93c9d3d7f6f languageName: node linkType: hard -"@endo/base64@npm:^1.0.8": - version: 1.0.8 - resolution: "@endo/base64@npm:1.0.8" - checksum: 10c0/3501efbf866acc25b9ad0912ec2383e3b976c890a18dc67b5c6eb128433708db69e8ed1cc57190305266bdcbd132659aa87edfc6d02a9886b711e8b86adc21c0 +"@cosmjs/amino@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/amino@npm:0.32.4" + dependencies: + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + checksum: 10c0/cd8e215b0406f5c7b73ab0a21106d06b6f76b1da12f1ab7b612884e1dd8bc626966dc67d4e7580090ade131546cbec70000f854e6596935299d054b788929a7e languageName: node linkType: hard -"@endo/bundle-source@npm:^2.2.0": - version: 2.8.0 - resolution: "@endo/bundle-source@npm:2.8.0" +"@cosmjs/crypto@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/crypto@npm:0.32.4" dependencies: - "@agoric/babel-generator": "npm:^7.17.4" - "@babel/parser": "npm:^7.17.3" - "@babel/traverse": "npm:^7.17.3" - "@endo/base64": "npm:^0.2.35" - "@endo/compartment-mapper": "npm:^0.9.2" - "@endo/init": "npm:^0.5.60" - "@endo/promise-kit": "npm:^0.2.60" - "@endo/where": "npm:^0.3.5" - "@rollup/plugin-commonjs": "npm:^19.0.0" - "@rollup/plugin-node-resolve": "npm:^13.0.0" - acorn: "npm:^8.2.4" - jessie.js: "npm:^0.3.2" - rollup: "npm:^2.79.1" - source-map: "npm:^0.7.3" - bin: - bundle-source: src/tool.js - checksum: 10c0/7319c658d081ab963304b60e787f4338268530586f2c58c6be4aabbf109e0e044048a6b2061b97cdc374a91dc29f907cd4e2a119fb543296af0fb9b086a14088 + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + "@noble/hashes": "npm:^1" + bn.js: "npm:^5.2.0" + elliptic: "npm:^6.5.4" + libsodium-wrappers-sumo: "npm:^0.7.11" + checksum: 10c0/94e742285eb8c7c5393055ba0635f10c06bf87710e953aedc71e3edc2b8e21a12a0d9b5e8eff37e326765f57c9eb3c7fd358f24f639efad4f1a6624eb8189534 + languageName: node + linkType: hard + +"@cosmjs/encoding@npm:^0.32.3, @cosmjs/encoding@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/encoding@npm:0.32.4" + dependencies: + base64-js: "npm:^1.3.0" + bech32: "npm:^1.1.4" + readonly-date: "npm:^1.0.0" + checksum: 10c0/4a30d5ae1a2d1247d44bda46101ce208c7666d8801ca9a33de94edc35cc22460c16b4834ec84d5a65ffef5e2a4b58605e0a0a056c46bc0a042979ec84acf20cd + languageName: node + linkType: hard + +"@cosmjs/json-rpc@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/json-rpc@npm:0.32.4" + dependencies: + "@cosmjs/stream": "npm:^0.32.4" + xstream: "npm:^11.14.0" + checksum: 10c0/b3ebd240f4fb21260e284d2e503ecc61bac898842187ab717f0efb9a5f21272f161f267cc145629caeb9735f80946844384e2bd410275a4744147a44518c0fa0 + languageName: node + linkType: hard + +"@cosmjs/math@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/math@npm:0.32.4" + dependencies: + bn.js: "npm:^5.2.0" + checksum: 10c0/91e47015be5634d27d71d14c5a05899fb4992b69db02cab1558376dedf8254f96d5e24f097c5601804ae18ed33c7c25d023653ac2bf9d20250fd3e5637f6b101 + languageName: node + linkType: hard + +"@cosmjs/proto-signing@npm:^0.32.3, @cosmjs/proto-signing@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/proto-signing@npm:0.32.4" + dependencies: + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + cosmjs-types: "npm:^0.9.0" + checksum: 10c0/6915059d2e6dbe1abda4a747c3b1abd47a9eff4f8cb2cf9a5545f939b656b4a15bbde2bfc1364357f9b2a081a066280c3b469f6d13dd5fc51b429b0f90a54913 + languageName: node + linkType: hard + +"@cosmjs/socket@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/socket@npm:0.32.4" + dependencies: + "@cosmjs/stream": "npm:^0.32.4" + isomorphic-ws: "npm:^4.0.1" + ws: "npm:^7" + xstream: "npm:^11.14.0" + checksum: 10c0/2d94c1fb39016bea3c7c145f4565c8a0fed20c805ac569ea604cd3646c15147b82b8db18a4e3c832d6ae0c3dd14363d4db3d91bcacac922679efba164ed49386 + languageName: node + linkType: hard + +"@cosmjs/stargate@npm:^0.32.3": + version: 0.32.4 + resolution: "@cosmjs/stargate@npm:0.32.4" + dependencies: + "@confio/ics23": "npm:^0.6.8" + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/proto-signing": "npm:^0.32.4" + "@cosmjs/stream": "npm:^0.32.4" + "@cosmjs/tendermint-rpc": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + cosmjs-types: "npm:^0.9.0" + xstream: "npm:^11.14.0" + checksum: 10c0/c30a3519516aaa7eae58ba827c80fcf74c7fe7a9d3aa5cc8138c3a2768f5f241f59c2f5cec27e9037b4df12b1c6605b4fac9eadb4de97bd84edddc3a80a02e24 + languageName: node + linkType: hard + +"@cosmjs/stream@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/stream@npm:0.32.4" + dependencies: + xstream: "npm:^11.14.0" + checksum: 10c0/c677c53f9101c2a36fa03a475d92dea2fa69c475f896751b5e18a5d07087eeecbf6bca2e62a8940003da53fa235a9b2dd78c8257bf19c3f96e3f69fa8d5f183d + languageName: node + linkType: hard + +"@cosmjs/tendermint-rpc@npm:^0.32.3, @cosmjs/tendermint-rpc@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/tendermint-rpc@npm:0.32.4" + dependencies: + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/json-rpc": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/socket": "npm:^0.32.4" + "@cosmjs/stream": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + axios: "npm:^1.6.0" + readonly-date: "npm:^1.0.0" + xstream: "npm:^11.14.0" + checksum: 10c0/5fae7afcdf98cc7dd36922aa1586254cc8c202cf8fe66804e61d793d31dcff816f40d33f7a0eb72c1b9226c7c361d4848e4ff12d0489f6fa66f47f0c86ae18dd + languageName: node + linkType: hard + +"@cosmjs/utils@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/utils@npm:0.32.4" + checksum: 10c0/d5ff8b235094be1150853a715116049f73eb5cdfeea8ce8e22ecccc61ec99792db457404d4307782b1a2f935dcf438f5c485beabfcfbc1dc5df26eb6e6da9062 + languageName: node + linkType: hard + +"@endo/base64@npm:^1.0.8": + version: 1.0.8 + resolution: "@endo/base64@npm:1.0.8" + checksum: 10c0/3501efbf866acc25b9ad0912ec2383e3b976c890a18dc67b5c6eb128433708db69e8ed1cc57190305266bdcbd132659aa87edfc6d02a9886b711e8b86adc21c0 languageName: node linkType: hard @@ -635,13 +740,6 @@ __metadata: languageName: node linkType: hard -"@endo/cjs-module-analyzer@npm:^0.2.35": - version: 0.2.35 - resolution: "@endo/cjs-module-analyzer@npm:0.2.35" - checksum: 10c0/26d571803afe889ba327979c9208a037d8cbbb6e689cf20e10bd8d0658936a35b37d61b86180dbed6ac49ac284307177b16eeb10d6afe61c7674d4c6507913ab - languageName: node - linkType: hard - "@endo/cjs-module-analyzer@npm:^1.0.8": version: 1.0.8 resolution: "@endo/cjs-module-analyzer@npm:1.0.8" @@ -660,18 +758,6 @@ __metadata: languageName: node linkType: hard -"@endo/compartment-mapper@npm:^0.9.2": - version: 0.9.2 - resolution: "@endo/compartment-mapper@npm:0.9.2" - dependencies: - "@endo/cjs-module-analyzer": "npm:^0.2.35" - "@endo/static-module-record": "npm:^0.8.2" - "@endo/zip": "npm:^0.2.35" - ses: "npm:^0.18.8" - checksum: 10c0/ee42a78293f04924f3f65b123822e7f684c4337c3b3921cb78385c37ca4011ca89deca21488c7a44a9d472b196036ba9549b3e727b2934b67a9cf8876f1a8b38 - languageName: node - linkType: hard - "@endo/compartment-mapper@npm:^1.3.1": version: 1.3.1 resolution: "@endo/compartment-mapper@npm:1.3.1" @@ -685,13 +771,6 @@ __metadata: languageName: node linkType: hard -"@endo/env-options@npm:^0.1.4": - version: 0.1.4 - resolution: "@endo/env-options@npm:0.1.4" - checksum: 10c0/5bf49d362849090bff328b15f906adb5b8b6220815e8955e45f81e7ff9a8ab17e509fff8bf30f4c619772f4f1a8cba8f1ca90faec724b53b5b3f1c89050c6b44 - languageName: node - linkType: hard - "@endo/env-options@npm:^1.1.7": version: 1.1.7 resolution: "@endo/env-options@npm:1.1.7" @@ -720,22 +799,6 @@ __metadata: languageName: node linkType: hard -"@endo/eventual-send@npm:^0.15.3": - version: 0.15.5 - resolution: "@endo/eventual-send@npm:0.15.5" - checksum: 10c0/f064f107591022b6c25245f21d1b26766d590788d2f39de45d999bcb085b7fe9b69f10e673de9a013df849774d011b2878be9da5473b40ff33ca5700cf4b517e - languageName: node - linkType: hard - -"@endo/eventual-send@npm:^0.17.6": - version: 0.17.6 - resolution: "@endo/eventual-send@npm:0.17.6" - dependencies: - "@endo/env-options": "npm:^0.1.4" - checksum: 10c0/3a8dae48e06ad3a8fdad074d0b6b10ced09f1e440f04f802d98372243ed8ead97278d85d4aa4a310dee34bc7146f09e7aaf6d01b7c06cbe3f8610544c97b5ce2 - languageName: node - linkType: hard - "@endo/eventual-send@npm:^1.2.7": version: 1.2.7 resolution: "@endo/eventual-send@npm:1.2.7" @@ -784,18 +847,6 @@ __metadata: languageName: node linkType: hard -"@endo/init@npm:^0.5.41, @endo/init@npm:^0.5.60": - version: 0.5.60 - resolution: "@endo/init@npm:0.5.60" - dependencies: - "@endo/base64": "npm:^0.2.35" - "@endo/eventual-send": "npm:^0.17.6" - "@endo/lockdown": "npm:^0.1.32" - "@endo/promise-kit": "npm:^0.2.60" - checksum: 10c0/247f189139e3ba244ddcf9c3252e865783020c1524cfab94210b504afaecc11f0e9d61ab7beef9fbe221c572577113a7a4d3a12057f9e9072a4e1e7eda493c62 - languageName: node - linkType: hard - "@endo/init@npm:^1.1.4, @endo/init@npm:^1.1.6": version: 1.1.6 resolution: "@endo/init@npm:1.1.6" @@ -808,15 +859,6 @@ __metadata: languageName: node linkType: hard -"@endo/lockdown@npm:^0.1.32": - version: 0.1.32 - resolution: "@endo/lockdown@npm:0.1.32" - dependencies: - ses: "npm:^0.18.8" - checksum: 10c0/9756759e4b099faa2293d03d47e34c176b68fb08a82714cd2b2e0b49fc0534972582f08ba82282bdfea79688b408d61e07980eacadfb70e7a8fef9fea6b16f6e - languageName: node - linkType: hard - "@endo/lockdown@npm:^1.0.12": version: 1.0.12 resolution: "@endo/lockdown@npm:1.0.12" @@ -860,17 +902,6 @@ __metadata: languageName: node linkType: hard -"@endo/netstring@npm:^0.3.11": - version: 0.3.30 - resolution: "@endo/netstring@npm:0.3.30" - dependencies: - "@endo/init": "npm:^0.5.60" - "@endo/stream": "npm:^0.3.29" - ses: "npm:^0.18.8" - checksum: 10c0/9a5910962884f4e5d7cba57cd0e5625241e89af3505d8698b5066c396f2fe16083a4cfc1ac99c950148db36d56a73dac62a086c25538e6ea44288ffc25e4ccff - languageName: node - linkType: hard - "@endo/pass-style@npm:^1.4.6": version: 1.4.6 resolution: "@endo/pass-style@npm:1.4.6" @@ -897,15 +928,6 @@ __metadata: languageName: node linkType: hard -"@endo/promise-kit@npm:^0.2.60": - version: 0.2.60 - resolution: "@endo/promise-kit@npm:0.2.60" - dependencies: - ses: "npm:^0.18.8" - checksum: 10c0/45fa191d0211cf9e99a6b300c373849c7662e8832e20fbcfa4a8f4938d9c9509f22c3a76377629be70447adc1d2e4e99a56a99395af19ba2a0c1010bfe1da4dd - languageName: node - linkType: hard - "@endo/promise-kit@npm:^1.1.7": version: 1.1.7 resolution: "@endo/promise-kit@npm:1.1.7" @@ -928,41 +950,6 @@ __metadata: languageName: node linkType: hard -"@endo/static-module-record@npm:^0.8.2": - version: 0.8.2 - resolution: "@endo/static-module-record@npm:0.8.2" - dependencies: - "@agoric/babel-generator": "npm:^7.17.6" - "@babel/parser": "npm:^7.17.3" - "@babel/traverse": "npm:^7.17.3" - "@babel/types": "npm:^7.17.0" - ses: "npm:^0.18.8" - checksum: 10c0/85b3cc7c11568706c51c85b665b3a49cc141bc7ca023531dbff6cd46e3cd00ddfc6edc58b4dc171a0fb352dd6a33d17b867531d9e1c8a7951eef770635535f51 - languageName: node - linkType: hard - -"@endo/stream-node@npm:^0.2.11": - version: 0.2.30 - resolution: "@endo/stream-node@npm:0.2.30" - dependencies: - "@endo/init": "npm:^0.5.60" - "@endo/stream": "npm:^0.3.29" - ses: "npm:^0.18.8" - checksum: 10c0/e64838d4552715b72f01635e8ff70552eb66c078382a48b3e3ce70af78d0eb5333c39d691a6bc43e5b61a3b535dcde2ac10b6b51886b5f88715a03ffbe783565 - languageName: node - linkType: hard - -"@endo/stream@npm:^0.3.10, @endo/stream@npm:^0.3.29": - version: 0.3.29 - resolution: "@endo/stream@npm:0.3.29" - dependencies: - "@endo/eventual-send": "npm:^0.17.6" - "@endo/promise-kit": "npm:^0.2.60" - ses: "npm:^0.18.8" - checksum: 10c0/a1bbf1d643193650efb4b68784193729ed6c1e2c9039ba2a51502b0ebf37691b338961ed9f69e81d4edec1b40e1f6d4ab1887a6ddf824bcda5d094e6d1489282 - languageName: node - linkType: hard - "@endo/stream@npm:^1.2.7": version: 1.2.7 resolution: "@endo/stream@npm:1.2.7" @@ -981,13 +968,6 @@ __metadata: languageName: node linkType: hard -"@endo/where@npm:^0.3.5": - version: 0.3.5 - resolution: "@endo/where@npm:0.3.5" - checksum: 10c0/ae4214a4ef1ec9338301e4ae3df17e7c988abb1abf5c3e4c7f720b44e93c4d57e11fff7b454a031fa6216cc2ee3b9eba718cc851db171bb50ca91e693e5e8826 - languageName: node - linkType: hard - "@endo/where@npm:^1.0.8": version: 1.0.8 resolution: "@endo/where@npm:1.0.8" @@ -995,13 +975,6 @@ __metadata: languageName: node linkType: hard -"@endo/zip@npm:^0.2.35": - version: 0.2.35 - resolution: "@endo/zip@npm:0.2.35" - checksum: 10c0/bb81c085e47a5d67342dcc039b2f471e4679e08de95cea3cdba598e2644125ec0b2002e7a1d3ff9a10977380487a58688d7e2c4d1d5525c16e46fed4b735372d - languageName: node - linkType: hard - "@endo/zip@npm:^1.0.7, @endo/zip@npm:^1.0.8": version: 1.0.8 resolution: "@endo/zip@npm:1.0.8" @@ -1263,6 +1236,13 @@ __metadata: languageName: node linkType: hard +"@noble/hashes@npm:^1, @noble/hashes@npm:^1.0.0": + version: 1.5.0 + resolution: "@noble/hashes@npm:1.5.0" + checksum: 10c0/1b46539695fbfe4477c0822d90c881a04d4fa2921c08c552375b444a48cac9930cb1ee68de0a3c7859e676554d0f3771999716606dc4d8f826e414c11692cdd9 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -1319,6 +1299,79 @@ __metadata: languageName: node linkType: hard +"@protobufjs/aspromise@npm:^1.1.1, @protobufjs/aspromise@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/aspromise@npm:1.1.2" + checksum: 10c0/a83343a468ff5b5ec6bff36fd788a64c839e48a07ff9f4f813564f58caf44d011cd6504ed2147bf34835bd7a7dd2107052af755961c6b098fd8902b4f6500d0f + languageName: node + linkType: hard + +"@protobufjs/base64@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/base64@npm:1.1.2" + checksum: 10c0/eec925e681081af190b8ee231f9bad3101e189abbc182ff279da6b531e7dbd2a56f1f306f37a80b1be9e00aa2d271690d08dcc5f326f71c9eed8546675c8caf6 + languageName: node + linkType: hard + +"@protobufjs/codegen@npm:^2.0.4": + version: 2.0.4 + resolution: "@protobufjs/codegen@npm:2.0.4" + checksum: 10c0/26ae337c5659e41f091606d16465bbcc1df1f37cc1ed462438b1f67be0c1e28dfb2ca9f294f39100c52161aef82edf758c95d6d75650a1ddf31f7ddee1440b43 + languageName: node + linkType: hard + +"@protobufjs/eventemitter@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/eventemitter@npm:1.1.0" + checksum: 10c0/1eb0a75180e5206d1033e4138212a8c7089a3d418c6dfa5a6ce42e593a4ae2e5892c4ef7421f38092badba4040ea6a45f0928869989411001d8c1018ea9a6e70 + languageName: node + linkType: hard + +"@protobufjs/fetch@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/fetch@npm:1.1.0" + dependencies: + "@protobufjs/aspromise": "npm:^1.1.1" + "@protobufjs/inquire": "npm:^1.1.0" + checksum: 10c0/cda6a3dc2d50a182c5865b160f72077aac197046600091dbb005dd0a66db9cce3c5eaed6d470ac8ed49d7bcbeef6ee5f0bc288db5ff9a70cbd003e5909065233 + languageName: node + linkType: hard + +"@protobufjs/float@npm:^1.0.2": + version: 1.0.2 + resolution: "@protobufjs/float@npm:1.0.2" + checksum: 10c0/18f2bdede76ffcf0170708af15c9c9db6259b771e6b84c51b06df34a9c339dbbeec267d14ce0bddd20acc142b1d980d983d31434398df7f98eb0c94a0eb79069 + languageName: node + linkType: hard + +"@protobufjs/inquire@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/inquire@npm:1.1.0" + checksum: 10c0/64372482efcba1fb4d166a2664a6395fa978b557803857c9c03500e0ac1013eb4b1aacc9ed851dd5fc22f81583670b4f4431bae186f3373fedcfde863ef5921a + languageName: node + linkType: hard + +"@protobufjs/path@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/path@npm:1.1.2" + checksum: 10c0/cece0a938e7f5dfd2fa03f8c14f2f1cf8b0d6e13ac7326ff4c96ea311effd5fb7ae0bba754fbf505312af2e38500250c90e68506b97c02360a43793d88a0d8b4 + languageName: node + linkType: hard + +"@protobufjs/pool@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/pool@npm:1.1.0" + checksum: 10c0/eda2718b7f222ac6e6ad36f758a92ef90d26526026a19f4f17f668f45e0306a5bd734def3f48f51f8134ae0978b6262a5c517c08b115a551756d1a3aadfcf038 + languageName: node + linkType: hard + +"@protobufjs/utf8@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/utf8@npm:1.1.0" + checksum: 10c0/a3fe31fe3fa29aa3349e2e04ee13dc170cc6af7c23d92ad49e3eeaf79b9766264544d3da824dba93b7855bd6a2982fb40032ef40693da98a136d835752beb487 + languageName: node + linkType: hard + "@rollup/plugin-commonjs@npm:^19.0.0": version: 19.0.2 resolution: "@rollup/plugin-commonjs@npm:19.0.2" @@ -1440,7 +1493,14 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*": +"@types/long@npm:^4.0.1": + version: 4.0.2 + resolution: "@types/long@npm:4.0.2" + checksum: 10c0/42ec66ade1f72ff9d143c5a519a65efc7c1c77be7b1ac5455c530ae9acd87baba065542f8847522af2e3ace2cc999f3ad464ef86e6b7352eece34daf88f8c924 + languageName: node + linkType: hard + +"@types/node@npm:*, @types/node@npm:>=13.7.0": version: 22.9.0 resolution: "@types/node@npm:22.9.0" dependencies: @@ -1640,6 +1700,13 @@ __metadata: languageName: node linkType: hard +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 10c0/d73e2ddf20c4eb9337e1b3df1a0f6159481050a5de457c55b14ea2e5cb6d90bb69e004c9af54737a5ee0917fcf2c9e25de67777bbe58261847846066ba75bc9d + languageName: node + linkType: hard + "ava@npm:^6.1.2": version: 6.2.0 resolution: "ava@npm:6.2.0" @@ -1695,6 +1762,17 @@ __metadata: languageName: node linkType: hard +"axios@npm:^1.6.0": + version: 1.7.7 + resolution: "axios@npm:1.7.7" + dependencies: + follow-redirects: "npm:^1.15.6" + form-data: "npm:^4.0.0" + proxy-from-env: "npm:^1.1.0" + checksum: 10c0/4499efc89e86b0b49ffddc018798de05fab26e3bf57913818266be73279a6418c3ce8f9e934c7d2d707ab8c095e837fc6c90608fb7715b94d357720b5f568af7 + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -1702,13 +1780,20 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1": +"base64-js@npm:^1.3.0, base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 10c0/f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf languageName: node linkType: hard +"bech32@npm:^1.1.4": + version: 1.1.4 + resolution: "bech32@npm:1.1.4" + checksum: 10c0/5f62ca47b8df99ace9c0e0d8deb36a919d91bf40066700aaa9920a45f86bb10eb56d537d559416fd8703aa0fb60dddb642e58f049701e7291df678b2033e5ee5 + languageName: node + linkType: hard + "better-sqlite3@npm:^9.1.1, better-sqlite3@npm:^9.6.0": version: 9.6.0 resolution: "better-sqlite3@npm:9.6.0" @@ -1747,6 +1832,20 @@ __metadata: languageName: node linkType: hard +"bn.js@npm:^4.11.9": + version: 4.12.0 + resolution: "bn.js@npm:4.12.0" + checksum: 10c0/9736aaa317421b6b3ed038ff3d4491935a01419ac2d83ddcfebc5717385295fcfcf0c57311d90fe49926d0abbd7a9dbefdd8861e6129939177f7e67ebc645b21 + languageName: node + linkType: hard + +"bn.js@npm:^5.2.0": + version: 5.2.1 + resolution: "bn.js@npm:5.2.1" + checksum: 10c0/bed3d8bd34ec89dbcf9f20f88bd7d4a49c160fda3b561c7bb227501f974d3e435a48fb9b61bc3de304acab9215a3bda0803f7017ffb4d0016a0c3a740a283caa + languageName: node + linkType: hard + "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -1775,6 +1874,13 @@ __metadata: languageName: node linkType: hard +"brorand@npm:^1.1.0": + version: 1.1.0 + resolution: "brorand@npm:1.1.0" + checksum: 10c0/6f366d7c4990f82c366e3878492ba9a372a73163c09871e80d82fb4ae0d23f9f8924cb8a662330308206e6b3b76ba1d528b4601c9ef73c2166b440b2ea3b7571 + languageName: node + linkType: hard + "buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -1932,6 +2038,15 @@ __metadata: languageName: node linkType: hard +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: "npm:~1.0.0" + checksum: 10c0/0dbb829577e1b1e839fa82b40c07ffaf7de8a09b935cadd355a73652ae70a88b4320db322f6634a4ad93424292fa80973ac6480986247f1734a1137debf271d5 + languageName: node + linkType: hard + "common-path-prefix@npm:^3.0.0": version: 3.0.0 resolution: "common-path-prefix@npm:3.0.0" @@ -2054,6 +2169,35 @@ __metadata: languageName: node linkType: hard +"define-data-property@npm:^1.0.1": + version: 1.1.4 + resolution: "define-data-property@npm:1.1.4" + dependencies: + es-define-property: "npm:^1.0.0" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.0.1" + checksum: 10c0/dea0606d1483eb9db8d930d4eac62ca0fa16738b0b3e07046cddfacf7d8c868bbe13fa0cb263eb91c7d0d527960dc3f2f2471a69ed7816210307f6744fe62e37 + languageName: node + linkType: hard + +"define-properties@npm:^1.2.1": + version: 1.2.1 + resolution: "define-properties@npm:1.2.1" + dependencies: + define-data-property: "npm:^1.0.1" + has-property-descriptors: "npm:^1.0.0" + object-keys: "npm:^1.1.1" + checksum: 10c0/88a152319ffe1396ccc6ded510a3896e77efac7a1bfbaa174a7b00414a1747377e0bb525d303794a47cf30e805c2ec84e575758512c6e44a993076d29fd4e6c3 + languageName: node + linkType: hard + +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 10c0/d758899da03392e6712f042bec80aa293bbe9e9ff1b2634baae6a360113e708b91326594c8a486d475c69d6259afb7efacdc3537bfcda1c6c648e390ce601b19 + languageName: node + linkType: hard + "delegates@npm:^1.0.0": version: 1.0.0 resolution: "delegates@npm:1.0.0" @@ -2075,6 +2219,21 @@ __metadata: languageName: node linkType: hard +"elliptic@npm:^6.5.4": + version: 6.6.0 + resolution: "elliptic@npm:6.6.0" + dependencies: + bn.js: "npm:^4.11.9" + brorand: "npm:^1.1.0" + hash.js: "npm:^1.0.0" + hmac-drbg: "npm:^1.0.1" + inherits: "npm:^2.0.4" + minimalistic-assert: "npm:^1.0.1" + minimalistic-crypto-utils: "npm:^1.0.1" + checksum: 10c0/42eb3492e218017bf8923a5d14a86f414952f2f771361805b3ae9f380923b5da53e203d0d92be95cb0a248858a78db7db5934a346e268abb757e6fe561d401c9 + languageName: node + linkType: hard + "emittery@npm:^1.0.3": version: 1.0.3 resolution: "emittery@npm:1.0.3" @@ -2135,6 +2294,22 @@ __metadata: languageName: node linkType: hard +"es-define-property@npm:^1.0.0": + version: 1.0.0 + resolution: "es-define-property@npm:1.0.0" + dependencies: + get-intrinsic: "npm:^1.2.4" + checksum: 10c0/6bf3191feb7ea2ebda48b577f69bdfac7a2b3c9bcf97307f55fd6ef1bbca0b49f0c219a935aca506c993d8c5d8bddd937766cb760cd5e5a1071351f2df9f9aa4 + languageName: node + linkType: hard + +"es-errors@npm:^1.3.0": + version: 1.3.0 + resolution: "es-errors@npm:1.3.0" + checksum: 10c0/0a61325670072f98d8ae3b914edab3559b6caa980f08054a3b872052640d91da01d38df55df797fcc916389d77fc92b8d5906cf028f4db46d7e3003abecbca85 + languageName: node + linkType: hard + "esbuild@npm:~0.23.0": version: 0.23.1 resolution: "esbuild@npm:0.23.1" @@ -2256,13 +2431,6 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:^0.6.1": - version: 0.6.1 - resolution: "estree-walker@npm:0.6.1" - checksum: 10c0/6dabc855faa04a1ffb17b6a9121b6008ba75ab5a163ad9dc3d7fca05cfda374c5f5e91418d783496620ca75e99a73c40874d8b75f23b4117508cc8bde78e7b41 - languageName: node - linkType: hard - "estree-walker@npm:^1.0.1": version: 1.0.1 resolution: "estree-walker@npm:1.0.1" @@ -2381,6 +2549,16 @@ __metadata: languageName: node linkType: hard +"follow-redirects@npm:^1.15.6": + version: 1.15.9 + resolution: "follow-redirects@npm:1.15.9" + peerDependenciesMeta: + debug: + optional: true + checksum: 10c0/5829165bd112c3c0e82be6c15b1a58fa9dcfaede3b3c54697a82fe4a62dd5ae5e8222956b448d2f98e331525f05d00404aba7d696de9e761ef6e42fdc780244f + languageName: node + linkType: hard + "foreground-child@npm:^3.1.0": version: 3.3.0 resolution: "foreground-child@npm:3.3.0" @@ -2391,6 +2569,17 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^4.0.0": + version: 4.0.1 + resolution: "form-data@npm:4.0.1" + dependencies: + asynckit: "npm:^0.4.0" + combined-stream: "npm:^1.0.8" + mime-types: "npm:^2.1.12" + checksum: 10c0/bb102d570be8592c23f4ea72d7df9daa50c7792eb0cf1c5d7e506c1706e7426a4e4ae48a35b109e91c85f1c0ec63774a21ae252b66f4eb981cb8efef7d0463c8 + languageName: node + linkType: hard + "fs-constants@npm:^1.0.0": version: 1.0.0 resolution: "fs-constants@npm:1.0.0" @@ -2480,6 +2669,19 @@ __metadata: languageName: node linkType: hard +"get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.4": + version: 1.2.4 + resolution: "get-intrinsic@npm:1.2.4" + dependencies: + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + has-proto: "npm:^1.0.1" + has-symbols: "npm:^1.0.3" + hasown: "npm:^2.0.0" + checksum: 10c0/0a9b82c16696ed6da5e39b1267104475c47e3a9bdbe8b509dfe1710946e38a87be70d759f4bb3cda042d76a41ef47fe769660f3b7c0d1f68750299344ffb15b7 + languageName: node + linkType: hard + "get-stream@npm:^9.0.0": version: 9.0.1 resolution: "get-stream@npm:9.0.1" @@ -2552,6 +2754,16 @@ __metadata: languageName: node linkType: hard +"globalthis@npm:^1.0.1": + version: 1.0.4 + resolution: "globalthis@npm:1.0.4" + dependencies: + define-properties: "npm:^1.2.1" + gopd: "npm:^1.0.1" + checksum: 10c0/9d156f313af79d80b1566b93e19285f481c591ad6d0d319b4be5e03750d004dde40a39a0f26f7e635f9007a3600802f53ecd85a759b86f109e80a5f705e01846 + languageName: node + linkType: hard + "globby@npm:^14.0.2": version: 14.0.2 resolution: "globby@npm:14.0.2" @@ -2566,6 +2778,15 @@ __metadata: languageName: node linkType: hard +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: "npm:^1.1.3" + checksum: 10c0/505c05487f7944c552cee72087bf1567debb470d4355b1335f2c262d218ebbff805cd3715448fe29b4b380bae6912561d0467233e4165830efd28da241418c63 + languageName: node + linkType: hard + "graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" @@ -2573,6 +2794,29 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.0": + version: 1.0.2 + resolution: "has-property-descriptors@npm:1.0.2" + dependencies: + es-define-property: "npm:^1.0.0" + checksum: 10c0/253c1f59e80bb476cf0dde8ff5284505d90c3bdb762983c3514d36414290475fe3fd6f574929d84de2a8eec00d35cf07cb6776205ff32efd7c50719125f00236 + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.3 + resolution: "has-proto@npm:1.0.3" + checksum: 10c0/35a6989f81e9f8022c2f4027f8b48a552de714938765d019dbea6bb547bd49ce5010a3c7c32ec6ddac6e48fc546166a3583b128f5a7add8b058a6d8b4afec205 + languageName: node + linkType: hard + +"has-symbols@npm:^1.0.3": + version: 1.0.3 + resolution: "has-symbols@npm:1.0.3" + checksum: 10c0/e6922b4345a3f37069cdfe8600febbca791c94988c01af3394d86ca3360b4b93928bbf395859158f88099cb10b19d98e3bbab7c9ff2c1bd09cf665ee90afa2c3 + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -2580,7 +2824,17 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.2": +"hash.js@npm:^1.0.0, hash.js@npm:^1.0.3": + version: 1.1.7 + resolution: "hash.js@npm:1.1.7" + dependencies: + inherits: "npm:^2.0.3" + minimalistic-assert: "npm:^1.0.1" + checksum: 10c0/41ada59494eac5332cfc1ce6b7ebdd7b88a3864a6d6b08a3ea8ef261332ed60f37f10877e0c825aaa4bddebf164fbffa618286aeeec5296675e2671cbfa746c4 + languageName: node + linkType: hard + +"hasown@npm:^2.0.0, hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" dependencies: @@ -2589,6 +2843,17 @@ __metadata: languageName: node linkType: hard +"hmac-drbg@npm:^1.0.1": + version: 1.0.1 + resolution: "hmac-drbg@npm:1.0.1" + dependencies: + hash.js: "npm:^1.0.3" + minimalistic-assert: "npm:^1.0.0" + minimalistic-crypto-utils: "npm:^1.0.1" + checksum: 10c0/f3d9ba31b40257a573f162176ac5930109816036c59a09f901eb2ffd7e5e705c6832bedfff507957125f2086a0ab8f853c0df225642a88bf1fcaea945f20600d + languageName: node + linkType: hard + "http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" @@ -2859,6 +3124,15 @@ __metadata: languageName: node linkType: hard +"isomorphic-ws@npm:^4.0.1": + version: 4.0.1 + resolution: "isomorphic-ws@npm:4.0.1" + peerDependencies: + ws: "*" + checksum: 10c0/7cb90dc2f0eb409825558982fb15d7c1d757a88595efbab879592f9d2b63820d6bbfb5571ab8abe36c715946e165a413a99f6aafd9f40ab1f514d73487bc9996 + languageName: node + linkType: hard + "jackspeak@npm:^3.1.2": version: 3.4.3 resolution: "jackspeak@npm:3.4.3" @@ -2872,7 +3146,7 @@ __metadata: languageName: node linkType: hard -"jessie.js@npm:^0.3.2, jessie.js@npm:^0.3.4": +"jessie.js@npm:^0.3.4": version: 0.3.4 resolution: "jessie.js@npm:0.3.4" dependencies: @@ -2932,6 +3206,22 @@ __metadata: languageName: node linkType: hard +"libsodium-sumo@npm:^0.7.15": + version: 0.7.15 + resolution: "libsodium-sumo@npm:0.7.15" + checksum: 10c0/5a1437ccff03c72669e7b49da702034e171df9ff6a4e65698297ab63ad0bf8f889d3dd51494e29418c643143526d8d7f08cbba3929d220334cddbe3e74a1560e + languageName: node + linkType: hard + +"libsodium-wrappers-sumo@npm:^0.7.11": + version: 0.7.15 + resolution: "libsodium-wrappers-sumo@npm:0.7.15" + dependencies: + libsodium-sumo: "npm:^0.7.15" + checksum: 10c0/6da919a13395346d54f2ce4841adda8feb3fbb8a8c378ec5c93b7e6dc6353b379289349e659f3e017a9f1995ef396bf43f89c7ab4aab4e3b5ed85df62407d810 + languageName: node + linkType: hard + "load-json-file@npm:^7.0.1": version: 7.0.1 resolution: "load-json-file@npm:7.0.1" @@ -2946,6 +3236,13 @@ __metadata: languageName: node linkType: hard +"long@npm:^4.0.0": + version: 4.0.0 + resolution: "long@npm:4.0.0" + checksum: 10c0/50a6417d15b06104dbe4e3d4a667c39b137f130a9108ea8752b352a4cfae047531a3ac351c181792f3f8768fe17cca6b0f406674a541a86fb638aaac560d83ed + languageName: node + linkType: hard + "lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": version: 10.4.3 resolution: "lru-cache@npm:10.4.3" @@ -3046,6 +3343,22 @@ __metadata: languageName: node linkType: hard +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 10c0/0557a01deebf45ac5f5777fe7740b2a5c309c6d62d40ceab4e23da9f821899ce7a900b7ac8157d4548ddbb7beffe9abc621250e6d182b0397ec7f10c7b91a5aa + languageName: node + linkType: hard + +"mime-types@npm:^2.1.12": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: "npm:1.52.0" + checksum: 10c0/82fb07ec56d8ff1fc999a84f2f217aa46cb6ed1033fefaabd5785b9a974ed225c90dc72fff460259e66b95b73648596dbcc50d51ed69cdf464af2d237d3149b2 + languageName: node + linkType: hard + "mimic-function@npm:^5.0.0": version: 5.0.1 resolution: "mimic-function@npm:5.0.1" @@ -3060,6 +3373,20 @@ __metadata: languageName: node linkType: hard +"minimalistic-assert@npm:^1.0.0, minimalistic-assert@npm:^1.0.1": + version: 1.0.1 + resolution: "minimalistic-assert@npm:1.0.1" + checksum: 10c0/96730e5601cd31457f81a296f521eb56036e6f69133c0b18c13fe941109d53ad23a4204d946a0d638d7f3099482a0cec8c9bb6d642604612ce43ee536be3dddd + languageName: node + linkType: hard + +"minimalistic-crypto-utils@npm:^1.0.1": + version: 1.0.1 + resolution: "minimalistic-crypto-utils@npm:1.0.1" + checksum: 10c0/790ecec8c5c73973a4fbf2c663d911033e8494d5fb0960a4500634766ab05d6107d20af896ca2132e7031741f19888154d44b2408ada0852446705441383e9f8 + languageName: node + linkType: hard + "minimatch@npm:^3.1.1": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -3327,6 +3654,13 @@ __metadata: languageName: node linkType: hard +"object-keys@npm:^1.1.1": + version: 1.1.1 + resolution: "object-keys@npm:1.1.1" + checksum: 10c0/b11f7ccdbc6d406d1f186cdadb9d54738e347b2692a14439ca5ac70c225fa6db46db809711b78589866d47b25fc3e8dee0b4c722ac751e11180f9380e3d8601d + languageName: node + linkType: hard + "once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" @@ -3499,6 +3833,37 @@ __metadata: languageName: node linkType: hard +"protobufjs@npm:^6.8.8": + version: 6.11.4 + resolution: "protobufjs@npm:6.11.4" + dependencies: + "@protobufjs/aspromise": "npm:^1.1.2" + "@protobufjs/base64": "npm:^1.1.2" + "@protobufjs/codegen": "npm:^2.0.4" + "@protobufjs/eventemitter": "npm:^1.1.0" + "@protobufjs/fetch": "npm:^1.1.0" + "@protobufjs/float": "npm:^1.0.2" + "@protobufjs/inquire": "npm:^1.1.0" + "@protobufjs/path": "npm:^1.1.2" + "@protobufjs/pool": "npm:^1.1.0" + "@protobufjs/utf8": "npm:^1.1.0" + "@types/long": "npm:^4.0.1" + "@types/node": "npm:>=13.7.0" + long: "npm:^4.0.0" + bin: + pbjs: bin/pbjs + pbts: bin/pbts + checksum: 10c0/c244d7b9b6d3258193da5c0d1e558dfb47f208ae345e209f90ec45c9dca911b90fa17e937892a9a39a4136ab9886981aae9efdf6039f7baff4f7225f5eeb9812 + languageName: node + linkType: hard + +"proxy-from-env@npm:^1.1.0": + version: 1.1.0 + resolution: "proxy-from-env@npm:1.1.0" + checksum: 10c0/fe7dd8b1bdbbbea18d1459107729c3e4a2243ca870d26d34c2c1bcd3e4425b7bcc5112362df2d93cc7fb9746f6142b5e272fd1cc5c86ddf8580175186f6ad42b + languageName: node + linkType: hard + "pump@npm:^3.0.0": version: 3.0.2 resolution: "pump@npm:3.0.2" @@ -3548,6 +3913,13 @@ __metadata: languageName: node linkType: hard +"readonly-date@npm:^1.0.0": + version: 1.0.0 + resolution: "readonly-date@npm:1.0.0" + checksum: 10c0/7ab32bf19f6bfec102584a524fa79a289e6ede0bf20c80fd90ab309962e45b71d19dd0e3915dff6e81edf226f08fda65e890539b4aca74668921790b10471356 + languageName: node + linkType: hard + "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -3629,24 +4001,6 @@ __metadata: languageName: node linkType: hard -"rollup-plugin-string@npm:^3.0.0": - version: 3.0.0 - resolution: "rollup-plugin-string@npm:3.0.0" - dependencies: - rollup-pluginutils: "npm:^2.4.1" - checksum: 10c0/83bbc2230d5271bc014739d52320b66cd4071fc4f7181369533809e4a3f0269b6cb4873caa96426396b36f694023a9f68f5de7a94254e1f2764ca6bacff61995 - languageName: node - linkType: hard - -"rollup-pluginutils@npm:^2.4.1": - version: 2.8.2 - resolution: "rollup-pluginutils@npm:2.8.2" - dependencies: - estree-walker: "npm:^0.6.1" - checksum: 10c0/20947bec5a5dd68b5c5c8423911e6e7c0ad834c451f1a929b1f4e2bc08836ad3f1a722ef2bfcbeca921870a0a283f13f064a317dc7a6768496e98c9a641ba290 - languageName: node - linkType: hard - "rollup@npm:^2.79.1": version: 2.79.2 resolution: "rollup@npm:2.79.2" @@ -3665,7 +4019,9 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: + "@agoric/client-utils": "npm:dev" "@agoric/ertp": "npm:dev" + "@agoric/inter-protocol": "npm:dev" "@agoric/internal": "npm:dev" "@agoric/store": "npm:dev" "@agoric/synthetic-chain": "npm:^0.3.0" @@ -3731,15 +4087,6 @@ __metadata: languageName: node linkType: hard -"ses@npm:^0.18.8": - version: 0.18.8 - resolution: "ses@npm:0.18.8" - dependencies: - "@endo/env-options": "npm:^0.1.4" - checksum: 10c0/2c5c5e40f6a8edee081e1c62b65316128823070a68858c6ee45810fb14464d14a9f82499bf4d1cb274b46e35e199f7c55565755236a708d25ace493da206083f - languageName: node - linkType: hard - "ses@npm:^1.9.1": version: 1.9.1 resolution: "ses@npm:1.9.1" @@ -3863,13 +4210,6 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.7.3": - version: 0.7.4 - resolution: "source-map@npm:0.7.4" - checksum: 10c0/dc0cf3768fe23c345ea8760487f8c97ef6fca8a73c83cd7c9bf2fde8bc2c34adb9c0824d6feb14bc4f9e37fb522e18af621543f1289038a66ac7586da29aa7dc - languageName: node - linkType: hard - "sourcemap-codec@npm:^1.4.8": version: 1.4.8 resolution: "sourcemap-codec@npm:1.4.8" @@ -4002,6 +4342,13 @@ __metadata: languageName: node linkType: hard +"symbol-observable@npm:^2.0.3": + version: 2.0.3 + resolution: "symbol-observable@npm:2.0.3" + checksum: 10c0/03fb8766b75bfa65a3c7d68ae1e51a13a5ff71b40d6d53b17a0c9c77b1685c20a3bfbf45547ab36214a079665c3f551e250798f6b2f83a2a40762d864ed87f78 + languageName: node + linkType: hard + "tar-fs@npm:^2.0.0": version: 2.1.1 resolution: "tar-fs@npm:2.1.1" @@ -4122,11 +4469,11 @@ __metadata: "typescript@patch:typescript@npm%3A^5.5.4#optional!builtin": version: 5.6.3 - resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=b45daf" + resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin::version=5.6.3&hash=8c6c40" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/ac8307bb06bbfd08ae7137da740769b7d8c3ee5943188743bb622c621f8ad61d244767480f90fbd840277fbf152d8932aa20c33f867dea1bb5e79b187ca1a92f + checksum: 10c0/7c9d2e07c81226d60435939618c91ec2ff0b75fbfa106eec3430f0fcf93a584bc6c73176676f532d78c3594fe28a54b36eb40b3d75593071a7ec91301533ace7 languageName: node linkType: hard @@ -4270,6 +4617,31 @@ __metadata: languageName: node linkType: hard +"ws@npm:^7": + version: 7.5.10 + resolution: "ws@npm:7.5.10" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 10c0/bd7d5f4aaf04fae7960c23dcb6c6375d525e00f795dd20b9385902bd008c40a94d3db3ce97d878acc7573df852056ca546328b27b39f47609f80fb22a0a9b61d + languageName: node + linkType: hard + +"xstream@npm:^11.14.0": + version: 11.14.0 + resolution: "xstream@npm:11.14.0" + dependencies: + globalthis: "npm:^1.0.1" + symbol-observable: "npm:^2.0.3" + checksum: 10c0/7a28baedc64385dc17597d04c7130ec3135db298e66d6dcf33821eb1953d5ad1b83c5fa08f1ce4d36e75fd219f2e9ef81ee0721aa8d4ccf619acc1760ba37f71 + languageName: node + linkType: hard + "y18n@npm:^5.0.5": version: 5.0.8 resolution: "y18n@npm:5.0.8" diff --git a/packages/agoric-cli/src/commands/auction.js b/packages/agoric-cli/src/commands/auction.js index 241b49ec28c..5a6ba79e84b 100644 --- a/packages/agoric-cli/src/commands/auction.js +++ b/packages/agoric-cli/src/commands/auction.js @@ -2,7 +2,7 @@ /* eslint-env node */ import { InvalidArgumentError } from 'commander'; import { Fail } from '@endo/errors'; -import { makeRpcUtils } from '@agoric/client-utils'; +import { makeVstorageKit } from '@agoric/client-utils'; import { outputActionAndHint } from '../lib/wallet.js'; import { getNetworkConfig } from '../lib/network-config.js'; @@ -89,7 +89,7 @@ export const makeAuctionCommand = ( * }} opts */ async opts => { - const { agoricNames, readLatestHead } = await makeRpcUtils( + const { agoricNames, readLatestHead } = await makeVstorageKit( { fetch }, networkConfig, ); diff --git a/packages/agoric-cli/src/commands/gov.js b/packages/agoric-cli/src/commands/gov.js index fd0efc504ef..26c8a280a25 100644 --- a/packages/agoric-cli/src/commands/gov.js +++ b/packages/agoric-cli/src/commands/gov.js @@ -1,7 +1,7 @@ // @ts-check /* eslint-disable func-names */ /* eslint-env node */ -import { makeRpcUtils } from '@agoric/client-utils'; +import { makeVstorageKit } from '@agoric/client-utils'; import { execFileSync as execFileSyncAmbient } from 'child_process'; import { Command, CommanderError } from 'commander'; import { normalizeAddressWithOptions, pollBlocks } from '../lib/chain.js'; @@ -91,13 +91,13 @@ export const makeGovCommand = (_logger, io = {}) => { * keyringBackend: string, * instanceName?: string, * }} detail - * @param {Awaited>} [optUtils] + * @param {Awaited>} [optUtils] */ const processOffer = async function ( { toOffer, sendFrom, keyringBackend }, optUtils, ) { - const utils = await (optUtils || makeRpcUtils({ fetch }, networkConfig)); + const utils = await (optUtils || makeVstorageKit({ fetch }, networkConfig)); const { agoricNames, readLatestHead } = utils; assert(keyringBackend, 'missing keyring-backend option'); @@ -265,7 +265,7 @@ export const makeGovCommand = (_logger, io = {}) => { ) .requiredOption('--for ', 'description of the invitation') .action(async opts => { - const { agoricNames, readLatestHead } = await makeRpcUtils( + const { agoricNames, readLatestHead } = await makeVstorageKit( { fetch }, networkConfig, ); @@ -294,7 +294,7 @@ export const makeGovCommand = (_logger, io = {}) => { normalizeAddress, ) .action(async opts => { - const { agoricNames, readLatestHead } = await makeRpcUtils( + const { agoricNames, readLatestHead } = await makeVstorageKit( { fetch }, networkConfig, ); @@ -333,7 +333,7 @@ export const makeGovCommand = (_logger, io = {}) => { normalizeAddress, ) .action(async function (opts, options) { - const utils = await makeRpcUtils({ fetch }, networkConfig); + const utils = await makeVstorageKit({ fetch }, networkConfig); const { readLatestHead } = utils; const info = await readLatestHead( diff --git a/packages/agoric-cli/src/commands/inter.js b/packages/agoric-cli/src/commands/inter.js index ac70eca77a9..cf59a2c35e5 100644 --- a/packages/agoric-cli/src/commands/inter.js +++ b/packages/agoric-cli/src/commands/inter.js @@ -4,21 +4,20 @@ */ // @ts-check -import { CommanderError, InvalidArgumentError } from 'commander'; import { makeWalletUtils } from '@agoric/client-utils'; import { makeOfferSpecShape } from '@agoric/inter-protocol/src/auction/auctionBook.js'; import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; import { objectMap } from '@agoric/internal'; import { M, matches } from '@endo/patterns'; - +import { CommanderError, InvalidArgumentError } from 'commander'; import { normalizeAddressWithOptions, pollBlocks } from '../lib/chain.js'; -import { getNetworkConfig } from '../lib/network-config.js'; import { getCurrent, outputActionAndHint, sendAction } from '../lib/wallet.js'; import { asBoardRemote, - makeAmountFormatter, bigintReplacer, + makeAmountFormatter, } from '../lib/format.js'; +import { getNetworkConfig } from '../lib/network-config.js'; const { values } = Object; diff --git a/packages/agoric-cli/src/commands/oracle.js b/packages/agoric-cli/src/commands/oracle.js index 43392ef912c..dea5ed9e04a 100644 --- a/packages/agoric-cli/src/commands/oracle.js +++ b/packages/agoric-cli/src/commands/oracle.js @@ -2,7 +2,7 @@ /* eslint-disable func-names */ /* eslint-env node */ import { - makeRpcUtils, + makeVstorageKit, makeWalletUtils, storageHelper, } from '@agoric/client-utils'; @@ -87,7 +87,7 @@ export const makeOracleCommand = (logger, io = {}) => { const rpcTools = async () => { // XXX pass fetch to getNetworkConfig() explicitly const networkConfig = await getNetworkConfig({ env: process.env, fetch }); - const utils = await makeRpcUtils({ fetch }, networkConfig); + const utils = await makeVstorageKit({ fetch }, networkConfig); const lookupPriceAggregatorInstance = ([brandIn, brandOut]) => { const name = oracleBrandFeedName(brandIn, brandOut); diff --git a/packages/agoric-cli/src/commands/psm.js b/packages/agoric-cli/src/commands/psm.js index 1d00ec839d0..3a601db299a 100644 --- a/packages/agoric-cli/src/commands/psm.js +++ b/packages/agoric-cli/src/commands/psm.js @@ -1,7 +1,7 @@ // @ts-check /* eslint-disable func-names */ /* eslint-env node */ -import { makeRpcUtils, storageHelper } from '@agoric/client-utils'; +import { makeVstorageKit, storageHelper } from '@agoric/client-utils'; import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; import { Command } from 'commander'; import { getNetworkConfig } from '../lib/network-config.js'; @@ -63,7 +63,7 @@ export const makePsmCommand = logger => { ); const rpcTools = async () => { - const utils = await makeRpcUtils({ fetch }, networkConfig); + const utils = await makeVstorageKit({ fetch }, networkConfig); const lookupPsmInstance = ([minted, anchor]) => { const name = `psm-${minted}-${anchor}`; diff --git a/packages/agoric-cli/src/commands/reserve.js b/packages/agoric-cli/src/commands/reserve.js index cb510283952..7c709d0d27f 100644 --- a/packages/agoric-cli/src/commands/reserve.js +++ b/packages/agoric-cli/src/commands/reserve.js @@ -1,7 +1,7 @@ // @ts-check /* eslint-disable func-names */ /* eslint-env node */ -import { makeRpcUtils } from '@agoric/client-utils'; +import { makeVstorageKit } from '@agoric/client-utils'; import { Offers } from '@agoric/inter-protocol/src/clientSupport.js'; import { Command } from 'commander'; import { getNetworkConfig } from '../lib/network-config.js'; @@ -32,7 +32,7 @@ export const makeReserveCommand = (_logger, io = {}) => { * }} opts */ async ({ collateralBrand, ...opts }) => { - const { agoricNames } = await makeRpcUtils({ fetch }, networkConfig); + const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig); const offer = Offers.reserve.AddCollateral(agoricNames, { collateralBrandKey: collateralBrand, @@ -66,7 +66,7 @@ export const makeReserveCommand = (_logger, io = {}) => { 1, ) .action(async function (opts) { - const { agoricNames } = await makeRpcUtils({ fetch }, networkConfig); + const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig); const reserveInstance = agoricNames.instance.reserve; assert(reserveInstance, 'missing reserve in names'); diff --git a/packages/agoric-cli/src/commands/vaults.js b/packages/agoric-cli/src/commands/vaults.js index bc076b0f9bb..185157c1c3d 100644 --- a/packages/agoric-cli/src/commands/vaults.js +++ b/packages/agoric-cli/src/commands/vaults.js @@ -1,7 +1,7 @@ // @ts-check /* eslint-disable func-names */ /* eslint-env node */ -import { makeRpcUtils } from '@agoric/client-utils'; +import { makeVstorageKit } from '@agoric/client-utils'; import { lookupOfferIdForVault, Offers, @@ -39,7 +39,10 @@ export const makeVaultsCommand = logger => { normalizeAddress, ) .action(async function (opts) { - const { readLatestHead } = await makeRpcUtils({ fetch }, networkConfig); + const { readLatestHead } = await makeVstorageKit( + { fetch }, + networkConfig, + ); const current = await getCurrent(opts.from, { readLatestHead, @@ -64,7 +67,7 @@ export const makeVaultsCommand = logger => { .option('--collateralBrand ', 'Collateral brand key', 'ATOM') .action(async function (opts) { logger.warn('running with options', opts); - const { agoricNames } = await makeRpcUtils({ fetch }, networkConfig); + const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig); const offer = Offers.vaults.OpenVault(agoricNames, { giveCollateral: opts.giveCollateral, @@ -99,7 +102,7 @@ export const makeVaultsCommand = logger => { .requiredOption('--vaultId ', 'Key of vault (e.g. vault1)') .action(async function (opts) { logger.warn('running with options', opts); - const { agoricNames, readLatestHead } = await makeRpcUtils( + const { agoricNames, readLatestHead } = await makeVstorageKit( { fetch }, networkConfig, ); @@ -143,7 +146,7 @@ export const makeVaultsCommand = logger => { ) .action(async function (opts) { logger.warn('running with options', opts); - const { agoricNames, readLatestHead } = await makeRpcUtils( + const { agoricNames, readLatestHead } = await makeVstorageKit( { fetch }, networkConfig, ); diff --git a/packages/agoric-cli/src/commands/wallet.js b/packages/agoric-cli/src/commands/wallet.js index a40cd1d1744..480d37f4aa0 100644 --- a/packages/agoric-cli/src/commands/wallet.js +++ b/packages/agoric-cli/src/commands/wallet.js @@ -8,7 +8,7 @@ import { makeLeader, makeLeaderFromRpcAddresses, } from '@agoric/casting'; -import { makeRpcUtils } from '@agoric/client-utils'; +import { makeVstorageKit } from '@agoric/client-utils'; import { execFileSync } from 'child_process'; import fs from 'fs'; import util from 'util'; @@ -105,7 +105,7 @@ export const makeWalletCommand = async command => { .action(async function (opts) { const offerStr = fs.readFileSync(opts.file).toString(); - const { unserializer } = await makeRpcUtils({ fetch }, networkConfig); + const { unserializer } = await makeVstorageKit({ fetch }, networkConfig); const offerObj = unserializer.fromCapData(JSON.parse(offerStr)); console.log(offerObj); @@ -120,7 +120,7 @@ export const makeWalletCommand = async command => { .action(async function (opts) { const offerStr = fs.readFileSync(opts.offer).toString(); - const { unserializer } = await makeRpcUtils({ fetch }, networkConfig); + const { unserializer } = await makeVstorageKit({ fetch }, networkConfig); const offerObj = unserializer.fromCapData(JSON.parse(offerStr)); console.log(offerObj.offer.id); @@ -158,7 +158,7 @@ export const makeWalletCommand = async command => { .command('list') .description('list all wallets in vstorage') .action(async function () { - const { vstorage } = await makeRpcUtils({ fetch }, networkConfig); + const { vstorage } = await makeVstorageKit({ fetch }, networkConfig); const wallets = await vstorage.keys('published.wallet'); process.stdout.write(wallets.join('\n')); }); @@ -172,12 +172,13 @@ export const makeWalletCommand = async command => { normalizeAddress, ) .action(async function (opts) { - const { agoricNames, unserializer, readLatestHead } = await makeRpcUtils( - { - fetch, - }, - networkConfig, - ); + const { agoricNames, unserializer, readLatestHead } = + await makeVstorageKit( + { + fetch, + }, + networkConfig, + ); const leader = makeLeader(networkConfig.rpcAddrs[0]); const follower = await makeFollower( diff --git a/packages/agoric-cli/src/lib/wallet.js b/packages/agoric-cli/src/lib/wallet.js index 63ac4597373..aded59c45fe 100644 --- a/packages/agoric-cli/src/lib/wallet.js +++ b/packages/agoric-cli/src/lib/wallet.js @@ -10,7 +10,7 @@ import { execSwingsetTransaction, pollTx } from './chain.js'; /** * @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js'; * @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js'; - * @import {MinimalNetworkConfig, RpcUtils} from '@agoric/client-utils'; + * @import {MinimalNetworkConfig, WalletUtils} from '@agoric/client-utils'; */ const marshaller = boardSlottingMarshaller(); @@ -25,7 +25,7 @@ const emptyCurrentRecord = { /** * @param {string} addr - * @param {Pick} io + * @param {Pick} io * @returns {Promise} */ export const getCurrent = async (addr, { readLatestHead }) => { @@ -60,7 +60,7 @@ export const getCurrent = async (addr, { readLatestHead }) => { /** * @param {string} addr - * @param {Pick} io + * @param {Pick} io * @returns {Promise} */ export const getLastUpdate = (addr, { readLatestHead }) => { diff --git a/packages/agoric-cli/test/inter-cli.test.js b/packages/agoric-cli/test/inter-cli.test.js index ab3d6c92288..38e3b970feb 100644 --- a/packages/agoric-cli/test/inter-cli.test.js +++ b/packages/agoric-cli/test/inter-cli.test.js @@ -4,9 +4,9 @@ import '@endo/init'; import test from 'ava'; import { CommanderError, createCommand } from 'commander'; -import { boardSlottingMarshaller, makeFromBoard } from '@agoric/client-utils'; import { makeParseAmount } from '@agoric/inter-protocol/src/clientSupport.js'; import { Far } from '@endo/far'; +import { boardSlottingMarshaller, makeFromBoard } from '@agoric/client-utils'; import { fmtBid, makeInterCommand } from '../src/commands/inter.js'; diff --git a/packages/client-utils/src/chain.js b/packages/client-utils/src/chain.js index b42314a63f3..0ac2f32c372 100644 --- a/packages/client-utils/src/chain.js +++ b/packages/client-utils/src/chain.js @@ -1,21 +1,7 @@ /** - * @import {MinimalNetworkConfig} from '@agoric/client-utils'; + * @import {StargateClient} from '@cosmjs/stargate'; */ -import { StargateClient } from '@cosmjs/stargate'; -import { makeTendermint34Client, pickEndpoint } from './rpc.js'; - -/** - * @param {MinimalNetworkConfig} config - * @param {{ fetch: typeof window.fetch }} io - * @returns {Promise} - */ -export const makeStargateClient = async (config, { fetch }) => { - const url = pickEndpoint(config); - const tm = await makeTendermint34Client(url, { fetch }); - return StargateClient.create(tm); -}; - /** * @param {{ * client: StargateClient, diff --git a/packages/client-utils/src/main.js b/packages/client-utils/src/main.js index d22b4429d57..226227b2e25 100644 --- a/packages/client-utils/src/main.js +++ b/packages/client-utils/src/main.js @@ -1,2 +1,4 @@ export * from './rpc.js'; +export * from './sync-tools.js'; +export * from './vstorage-kit.js'; export * from './wallet-utils.js'; diff --git a/packages/client-utils/src/rpc.js b/packages/client-utils/src/rpc.js index 64df53ecee6..7ca6330b0d7 100644 --- a/packages/client-utils/src/rpc.js +++ b/packages/client-utils/src/rpc.js @@ -1,13 +1,7 @@ -/* global Buffer */ -import { - boardSlottingMarshaller, - makeBoardRemote, -} from '@agoric/vats/tools/board-utils.js'; import { makeTendermintRpcClient } from '@agoric/casting'; +import { StargateClient } from '@cosmjs/stargate'; import { Tendermint34Client } from '@cosmjs/tendermint-rpc'; -export { boardSlottingMarshaller }; - /** * @typedef {{ rpcAddrs: string[], chainName: string }} MinimalNetworkConfig */ @@ -15,240 +9,6 @@ export { boardSlottingMarshaller }; // TODO distribute load export const pickEndpoint = ({ rpcAddrs }) => rpcAddrs[0]; -/** - * @param {object} powers - * @param {typeof window.fetch} powers.fetch - * @param {MinimalNetworkConfig} config - */ -export const makeVStorage = (powers, config) => { - /** @param {string} path */ - const getJSON = path => { - const url = config.rpcAddrs[0] + path; - // console.warn('fetching', url); - return powers.fetch(url, { keepalive: true }).then(res => res.json()); - }; - // height=0 is the same as omitting height and implies the highest block - const url = (path = 'published', { kind = 'children', height = 0 } = {}) => - `/abci_query?path=%22/custom/vstorage/${kind}/${path}%22&height=${height}`; - - const readStorage = (path = 'published', { kind = 'children', height = 0 }) => - getJSON(url(path, { kind, height })) - .catch(err => { - throw Error(`cannot read ${kind} of ${path}: ${err.message}`); - }) - .then(data => { - const { - result: { response }, - } = data; - if (response?.code !== 0) { - /** @type {any} */ - const err = Error( - `error code ${response?.code} reading ${kind} of ${path}: ${response.log}`, - ); - err.code = response?.code; - err.codespace = response?.codespace; - throw err; - } - return data; - }); - - return { - url, - decode({ result: { response } }) { - const { code } = response; - if (code !== 0) { - throw response; - } - const { value } = response; - return Buffer.from(value, 'base64').toString(); - }, - /** - * - * @param {string} path - * @returns {Promise} latest vstorage value at path - */ - async readLatest(path = 'published') { - const raw = await readStorage(path, { kind: 'data' }); - return this.decode(raw); - }, - async keys(path = 'published') { - const raw = await readStorage(path, { kind: 'children' }); - return JSON.parse(this.decode(raw)).children; - }, - /** - * @param {string} path - * @param {number} [height] default is highest - * @returns {Promise<{blockHeight: number, values: string[]}>} - */ - async readAt(path, height = undefined) { - const raw = await readStorage(path, { kind: 'data', height }); - const txt = this.decode(raw); - /** @type {{ value: string }} */ - const { value } = JSON.parse(txt); - return JSON.parse(value); - }, - /** - * Read values going back as far as available - * - * @param {string} path - * @param {number | string} [minHeight] - * @returns {Promise} - */ - async readFully(path, minHeight = undefined) { - const parts = []; - // undefined the first iteration, to query at the highest - let blockHeight; - await null; - do { - // console.debug('READING', { blockHeight }); - let values; - try { - ({ blockHeight, values } = await this.readAt( - path, - blockHeight && Number(blockHeight) - 1, - )); - // console.debug('readAt returned', { blockHeight }); - } catch (err) { - if ( - // CosmosSDK ErrInvalidRequest with particular message text; - // misrepresentation of pruned data - // TODO replace after incorporating a fix to - // https://github.com/cosmos/cosmos-sdk/issues/19992 - err.codespace === 'sdk' && - err.code === 18 && - err.message.match(/pruned/) - ) { - // console.error(err); - break; - } - throw err; - } - parts.push(values); - // console.debug('PUSHED', values); - // console.debug('NEW', { blockHeight, minHeight }); - if (minHeight && Number(blockHeight) <= Number(minHeight)) break; - } while (blockHeight > 0); - return parts.flat(); - }, - }; -}; -/** @typedef {ReturnType} VStorage */ - -/** @deprecated */ -export const makeFromBoard = () => { - const cache = new Map(); - const convertSlotToVal = (boardId, iface) => { - if (cache.has(boardId)) { - return cache.get(boardId); - } - const val = makeBoardRemote({ boardId, iface }); - cache.set(boardId, val); - return val; - }; - return harden({ convertSlotToVal }); -}; -/** @typedef {ReturnType} IdMap */ - -/** @deprecated */ -export const storageHelper = { - /** @param { string } txt */ - parseCapData: txt => { - assert(typeof txt === 'string', typeof txt); - /** @type {{ value: string }} */ - const { value } = JSON.parse(txt); - const specimen = JSON.parse(value); - const { blockHeight, values } = specimen; - assert(values, `empty values in specimen ${value}`); - const capDatas = storageHelper.parseMany(values); - return { blockHeight, capDatas }; - }, - /** - * @param {string} txt - * @param {IdMap} ctx - */ - unserializeTxt: (txt, ctx) => { - const { capDatas } = storageHelper.parseCapData(txt); - return capDatas.map(capData => - boardSlottingMarshaller(ctx.convertSlotToVal).fromCapData(capData), - ); - }, - /** @param {string[]} capDataStrings array of stringified capData */ - parseMany: capDataStrings => { - assert(capDataStrings && capDataStrings.length); - /** @type {{ body: string, slots: string[] }[]} */ - const capDatas = capDataStrings.map(s => JSON.parse(s)); - for (const capData of capDatas) { - assert(typeof capData === 'object' && capData !== null); - assert('body' in capData && 'slots' in capData); - assert(typeof capData.body === 'string'); - assert(Array.isArray(capData.slots)); - } - return capDatas; - }, -}; -harden(storageHelper); - -/** - * @deprecated - * @param {IdMap} ctx - * @param {VStorage} vstorage - * @returns {Promise} - */ -export const makeAgoricNames = async (ctx, vstorage) => { - const reverse = {}; - const entries = await Promise.all( - ['brand', 'instance', 'vbankAsset'].map(async kind => { - const content = await vstorage.readLatest( - `published.agoricNames.${kind}`, - ); - /** @type {Array<[string, import('@agoric/vats/tools/board-utils.js').BoardRemote]>} */ - const parts = storageHelper.unserializeTxt(content, ctx).at(-1); - for (const [name, remote] of parts) { - if ('getBoardId' in remote) { - reverse[remote.getBoardId()] = name; - } - } - return [kind, Object.fromEntries(parts)]; - }), - ); - return { ...Object.fromEntries(entries), reverse }; -}; - -/** - * @param {{ fetch: typeof window.fetch }} io - * @param {MinimalNetworkConfig} config - */ -export const makeRpcUtils = async ({ fetch }, config) => { - await null; - try { - const vstorage = makeVStorage({ fetch }, config); - const fromBoard = makeFromBoard(); - const agoricNames = await makeAgoricNames(fromBoard, vstorage); - - const marshaller = boardSlottingMarshaller(fromBoard.convertSlotToVal); - - /** @type {(txt: string) => unknown} */ - const unserializeHead = txt => - storageHelper.unserializeTxt(txt, fromBoard).at(-1); - - /** @type {(path: string) => Promise} */ - const readLatestHead = path => - vstorage.readLatest(path).then(unserializeHead); - - return { - agoricNames, - fromBoard, - marshaller, - readLatestHead, - unserializeHead, - vstorage, - }; - } catch (err) { - throw Error(`RPC failure (${config.rpcAddrs}): ${err.message}`); - } -}; -/** @typedef {Awaited>} RpcUtils */ - /** * @param {string} endpoint * @param {{ fetch: typeof window.fetch }} io @@ -258,3 +18,14 @@ export const makeTendermint34Client = (endpoint, { fetch }) => { const rpcClient = makeTendermintRpcClient(endpoint, fetch); return Tendermint34Client.create(rpcClient); }; + +/** + * @param {MinimalNetworkConfig} config + * @param {{ fetch: typeof window.fetch }} io + * @returns {Promise} + */ +export const makeStargateClient = async (config, { fetch }) => { + const url = pickEndpoint(config); + const tm = await makeTendermint34Client(url, { fetch }); + return StargateClient.create(tm); +}; diff --git a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.js b/packages/client-utils/src/sync-tools.js similarity index 86% rename from a3p-integration/proposals/z:acceptance/test-lib/sync-tools.js rename to packages/client-utils/src/sync-tools.js index dac2ba7e04f..a2aa6db98d8 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.js +++ b/packages/client-utils/src/sync-tools.js @@ -1,5 +1,3 @@ -/* eslint-env node */ - /** * @file The purpose of this file is to bring together a set of tools that * developers can use to synchronize operations they carry out in their tests. @@ -18,8 +16,6 @@ * @typedef {object} RetryOptions * @property {number} [maxRetries] * @property {number} [retryIntervalMs] - * @property {(...arg0: string[]) => void} [log] - * @property {(callback: Function, delay: number) => void} [setTimeout] * * @typedef {RetryOptions & {errorMessage: string}} WaitUntilOptions * @@ -28,15 +24,13 @@ * @property {number} value */ -const ambientSetTimeout = global.setTimeout; - /** * From https://github.com/Agoric/agoric-sdk/blob/442f07c8f0af03281b52b90e90c27131eef6f331/multichain-testing/tools/sleep.ts#L10 * * @param {number} ms - * @param {*} sleepOptions + * @param {{log: (message: string) => void, setTimeout: typeof global.setTimeout}} io */ -export const sleep = (ms, { log = () => {}, setTimeout = ambientSetTimeout }) => +export const sleep = (ms, { log = () => {}, setTimeout }) => new Promise(resolve => { log(`Sleeping for ${ms}ms...`); setTimeout(resolve, ms); @@ -48,7 +42,7 @@ export const sleep = (ms, { log = () => {}, setTimeout = ambientSetTimeout }) => * @param {() => Promise} operation * @param {(result: any) => boolean} condition * @param {string} message - * @param {RetryOptions} options + * @param {RetryOptions & {log?: typeof console.log, setTimeout: typeof global.setTimeout}} options */ export const retryUntilCondition = async ( operation, @@ -59,6 +53,8 @@ export const retryUntilCondition = async ( console.log({ maxRetries, retryIntervalMs, message }); let retries = 0; + await null; // separate sync prologue + while (retries < maxRetries) { try { const result = await operation(); @@ -112,7 +108,7 @@ const makeGetInstances = follow => async () => { /** * * @param {string} contractName - * @param {{follow: () => object, setTimeout: (object) => void}} ambientAuthority + * @param {{ log: (message: string) => void, follow: () => object, setTimeout: typeof global.setTimeout }} ambientAuthority * @param {WaitUntilOptions} options */ export const waitUntilContractDeployed = ( @@ -153,17 +149,12 @@ const checkCosmosBalance = (balances, threshold) => { /** * @param {string} destAcct - * @param {{query: () => Promise, setTimeout: (object) => void}} ambientAuthority + * @param {{ log: (message: string) => void, query: () => Promise, setTimeout: typeof global.setTimeout}} io * @param {{denom: string, value: number}} threshold * @param {WaitUntilOptions} options */ -export const waitUntilAccountFunded = ( - destAcct, - ambientAuthority, - threshold, - options, -) => { - const { query, setTimeout } = ambientAuthority; +export const waitUntilAccountFunded = (destAcct, io, threshold, options) => { + const { query, setTimeout } = io; const queryCosmosBalance = makeQueryCosmosBalance(query); const { maxRetries, retryIntervalMs, errorMessage, log } = overrideDefaultOptions(options); @@ -208,17 +199,17 @@ const checkOfferState = (offerStatus, waitForPayouts, offerId) => { * @param {string} addr * @param {string} offerId * @param {boolean} waitForPayouts - * @param {{follow: () => object, setTimeout: (callback: Function, delay: number) => void}} ambientAuthority + * @param {{ log: typeof console.log, follow: () => object, setTimeout: typeof global.setTimeout }} io * @param {WaitUntilOptions} options */ export const waitUntilOfferResult = ( addr, offerId, waitForPayouts, - ambientAuthority, + io, options, ) => { - const { follow, setTimeout } = ambientAuthority; + const { follow, setTimeout } = io; const queryWallet = makeQueryWallet(follow); const { maxRetries, retryIntervalMs, errorMessage, log } = overrideDefaultOptions(options); @@ -250,15 +241,11 @@ const checkForInvitation = update => { /** * * @param {string} addr - * @param {{follow: () => object, setTimeout: (object) => void}} ambientAuthority + * @param {{ follow: () => object, log: typeof console.log, setTimeout: typeof global.setTimeout}} io * @param {WaitUntilOptions} options */ -export const waitUntilInvitationReceived = ( - addr, - ambientAuthority, - options, -) => { - const { follow, setTimeout } = ambientAuthority; +export const waitUntilInvitationReceived = (addr, io, options) => { + const { follow, setTimeout } = io; const queryWallet = makeQueryWallet(follow); const { maxRetries, retryIntervalMs, errorMessage, log } = overrideDefaultOptions(options); diff --git a/packages/client-utils/src/vstorage-kit.js b/packages/client-utils/src/vstorage-kit.js new file mode 100644 index 00000000000..3dce95e2c64 --- /dev/null +++ b/packages/client-utils/src/vstorage-kit.js @@ -0,0 +1,248 @@ +/* global Buffer */ +import { + boardSlottingMarshaller, + makeBoardRemote, +} from '@agoric/vats/tools/board-utils.js'; + +export { boardSlottingMarshaller }; + +/** + * @import {MinimalNetworkConfig} from './rpc.js'; + */ + +/** + * @param {object} powers + * @param {typeof window.fetch} powers.fetch + * @param {MinimalNetworkConfig} config + */ +export const makeVStorage = (powers, config) => { + /** @param {string} path */ + const getJSON = path => { + const url = config.rpcAddrs[0] + path; + // console.warn('fetching', url); + return powers.fetch(url, { keepalive: true }).then(res => res.json()); + }; + // height=0 is the same as omitting height and implies the highest block + const url = (path = 'published', { kind = 'children', height = 0 } = {}) => + `/abci_query?path=%22/custom/vstorage/${kind}/${path}%22&height=${height}`; + + const readStorage = (path = 'published', { kind = 'children', height = 0 }) => + getJSON(url(path, { kind, height })) + .catch(err => { + throw Error(`cannot read ${kind} of ${path}: ${err.message}`); + }) + .then(data => { + const { + result: { response }, + } = data; + if (response?.code !== 0) { + /** @type {any} */ + const err = Error( + `error code ${response?.code} reading ${kind} of ${path}: ${response.log}`, + ); + err.code = response?.code; + err.codespace = response?.codespace; + throw err; + } + return data; + }); + + return { + url, + decode({ result: { response } }) { + const { code } = response; + if (code !== 0) { + throw response; + } + const { value } = response; + return Buffer.from(value, 'base64').toString(); + }, + /** + * + * @param {string} path + * @returns {Promise} latest vstorage value at path + */ + async readLatest(path = 'published') { + const raw = await readStorage(path, { kind: 'data' }); + return this.decode(raw); + }, + async keys(path = 'published') { + const raw = await readStorage(path, { kind: 'children' }); + return JSON.parse(this.decode(raw)).children; + }, + /** + * @param {string} path + * @param {number} [height] default is highest + * @returns {Promise<{blockHeight: number, values: string[]}>} + */ + async readAt(path, height = undefined) { + const raw = await readStorage(path, { kind: 'data', height }); + const txt = this.decode(raw); + /** @type {{ value: string }} */ + const { value } = JSON.parse(txt); + return JSON.parse(value); + }, + /** + * Read values going back as far as available + * + * @param {string} path + * @param {number | string} [minHeight] + * @returns {Promise} + */ + async readFully(path, minHeight = undefined) { + const parts = []; + // undefined the first iteration, to query at the highest + let blockHeight; + await null; + do { + // console.debug('READING', { blockHeight }); + let values; + try { + ({ blockHeight, values } = await this.readAt( + path, + blockHeight && Number(blockHeight) - 1, + )); + // console.debug('readAt returned', { blockHeight }); + } catch (err) { + if ( + // CosmosSDK ErrInvalidRequest with particular message text; + // misrepresentation of pruned data + // TODO replace after incorporating a fix to + // https://github.com/cosmos/cosmos-sdk/issues/19992 + err.codespace === 'sdk' && + err.code === 18 && + err.message.match(/pruned/) + ) { + // console.error(err); + break; + } + throw err; + } + parts.push(values); + // console.debug('PUSHED', values); + // console.debug('NEW', { blockHeight, minHeight }); + if (minHeight && Number(blockHeight) <= Number(minHeight)) break; + } while (blockHeight > 0); + return parts.flat(); + }, + }; +}; +/** @typedef {ReturnType} VStorage */ + +/** @deprecated */ +export const makeFromBoard = () => { + const cache = new Map(); + const convertSlotToVal = (boardId, iface) => { + if (cache.has(boardId)) { + return cache.get(boardId); + } + const val = makeBoardRemote({ boardId, iface }); + cache.set(boardId, val); + return val; + }; + return harden({ convertSlotToVal }); +}; +/** @typedef {ReturnType} IdMap */ + +/** @deprecated */ +export const storageHelper = { + /** @param { string } txt */ + parseCapData: txt => { + assert(typeof txt === 'string', typeof txt); + /** @type {{ value: string }} */ + const { value } = JSON.parse(txt); + const specimen = JSON.parse(value); + const { blockHeight, values } = specimen; + assert(values, `empty values in specimen ${value}`); + const capDatas = storageHelper.parseMany(values); + return { blockHeight, capDatas }; + }, + /** + * @param {string} txt + * @param {IdMap} ctx + */ + unserializeTxt: (txt, ctx) => { + const { capDatas } = storageHelper.parseCapData(txt); + return capDatas.map(capData => + boardSlottingMarshaller(ctx.convertSlotToVal).fromCapData(capData), + ); + }, + /** @param {string[]} capDataStrings array of stringified capData */ + parseMany: capDataStrings => { + assert(capDataStrings && capDataStrings.length); + /** @type {{ body: string, slots: string[] }[]} */ + const capDatas = capDataStrings.map(s => JSON.parse(s)); + for (const capData of capDatas) { + assert(typeof capData === 'object' && capData !== null); + assert('body' in capData && 'slots' in capData); + assert(typeof capData.body === 'string'); + assert(Array.isArray(capData.slots)); + } + return capDatas; + }, +}; +harden(storageHelper); + +/** + * @deprecated + * @param {IdMap} ctx + * @param {VStorage} vstorage + * @returns {Promise} + */ +export const makeAgoricNames = async (ctx, vstorage) => { + const reverse = {}; + const entries = await Promise.all( + ['brand', 'instance', 'vbankAsset'].map(async kind => { + const content = await vstorage.readLatest( + `published.agoricNames.${kind}`, + ); + /** @type {Array<[string, import('@agoric/vats/tools/board-utils.js').BoardRemote]>} */ + const parts = storageHelper.unserializeTxt(content, ctx).at(-1); + for (const [name, remote] of parts) { + if ('getBoardId' in remote) { + reverse[remote.getBoardId()] = name; + } + } + return [kind, Object.fromEntries(parts)]; + }), + ); + return { ...Object.fromEntries(entries), reverse }; +}; + +/** + * @param {{ fetch: typeof window.fetch }} io + * @param {MinimalNetworkConfig} config + */ +export const makeVstorageKit = async ({ fetch }, config) => { + await null; + try { + const vstorage = makeVStorage({ fetch }, config); + const fromBoard = makeFromBoard(); + const agoricNames = await makeAgoricNames(fromBoard, vstorage); + + const marshaller = boardSlottingMarshaller(fromBoard.convertSlotToVal); + + /** @type {(txt: string) => unknown} */ + const unserializeHead = txt => + storageHelper.unserializeTxt(txt, fromBoard).at(-1); + + /** + * Read latest at path and unmarshal it + * @type {(path: string) => Promise} + */ + const readLatestHead = path => + vstorage.readLatest(path).then(unserializeHead); + + return { + agoricNames, + fromBoard, + marshaller, + readLatestHead, + unserializeHead, + vstorage, + }; + } catch (err) { + throw Error(`RPC failure (${config.rpcAddrs}): ${err.message}`); + } +}; +/** @typedef {Awaited>} VstorageKit */ diff --git a/packages/client-utils/src/wallet-utils.js b/packages/client-utils/src/wallet-utils.js index 151291fbc54..27dc250ce1f 100644 --- a/packages/client-utils/src/wallet-utils.js +++ b/packages/client-utils/src/wallet-utils.js @@ -1,9 +1,11 @@ import { makeWalletStateCoalescer } from '@agoric/smart-wallet/src/utils.js'; -import { makeStargateClient, pollBlocks } from './chain.js'; -import { boardSlottingMarshaller, makeRpcUtils } from './rpc.js'; +import { pollBlocks } from './chain.js'; +import { makeStargateClient } from './rpc.js'; +import { boardSlottingMarshaller, makeVstorageKit } from './vstorage-kit.js'; /** * @import {Amount, Brand} from '@agoric/ertp/src/types.js' + * @import {CurrentWalletRecord, UpdateRecord} from '@agoric/smart-wallet/src/smartWallet.js'; * @import {MinimalNetworkConfig} from './rpc.js'; */ @@ -16,7 +18,7 @@ import { boardSlottingMarshaller, makeRpcUtils } from './rpc.js'; */ export const makeWalletUtils = async ({ fetch, delay }, networkConfig) => { const { agoricNames, fromBoard, marshaller, readLatestHead, vstorage } = - await makeRpcUtils({ fetch }, networkConfig); + await makeVstorageKit({ fetch }, networkConfig); const m = boardSlottingMarshaller(fromBoard.convertSlotToVal); const client = await makeStargateClient(networkConfig, { fetch }); @@ -81,11 +83,22 @@ export const makeWalletUtils = async ({ fetch, delay }, networkConfig) => { /** * @param {string} addr - * @returns {Promise} + * @returns {Promise} */ const getLastUpdate = addr => { - // @ts-expect-error cast - return readLatestHead(`published.wallet.${addr}`); + return /** @type {Promise} */ ( + readLatestHead(`published.wallet.${addr}`) + ); + }; + + /** + * @param {string} addr + * @returns {Promise} + */ + const getCurrentWalletRecord = addr => { + return /** @type {Promise} */ ( + readLatestHead(`published.wallet.${addr}.current`) + ); }; return { @@ -95,6 +108,7 @@ export const makeWalletUtils = async ({ fetch, delay }, networkConfig) => { marshaller, vstorage, getLastUpdate, + getCurrentWalletRecord, readLatestHead, storedWalletState, pollOffer, diff --git a/packages/client-utils/test/snapshots/exports.test.js.md b/packages/client-utils/test/snapshots/exports.test.js.md index 4c9278c387d..8a1c268100a 100644 --- a/packages/client-utils/test/snapshots/exports.test.js.md +++ b/packages/client-utils/test/snapshots/exports.test.js.md @@ -12,9 +12,17 @@ Generated by [AVA](https://avajs.dev). 'boardSlottingMarshaller', 'makeAgoricNames', 'makeFromBoard', - 'makeRpcUtils', + 'makeStargateClient', + 'makeTendermint34Client', 'makeVStorage', + 'makeVstorageKit', 'makeWalletUtils', 'pickEndpoint', + 'retryUntilCondition', + 'sleep', 'storageHelper', + 'waitUntilAccountFunded', + 'waitUntilContractDeployed', + 'waitUntilInvitationReceived', + 'waitUntilOfferResult', ] diff --git a/packages/client-utils/test/snapshots/exports.test.js.snap b/packages/client-utils/test/snapshots/exports.test.js.snap index 69755e0fad0..831d79980ba 100644 Binary files a/packages/client-utils/test/snapshots/exports.test.js.snap and b/packages/client-utils/test/snapshots/exports.test.js.snap differ diff --git a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js b/packages/client-utils/test/sync-tools.test.js similarity index 85% rename from a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js rename to packages/client-utils/test/sync-tools.test.js index 2b0d3603c4b..0c6bfe3f5f0 100644 --- a/a3p-integration/proposals/z:acceptance/test-lib/sync-tools.test.js +++ b/packages/client-utils/test/sync-tools.test.js @@ -1,13 +1,17 @@ /* eslint-env node */ // @ts-check import test from 'ava'; -import '@endo/init/debug.js'; + import { waitUntilAccountFunded, waitUntilContractDeployed, waitUntilInvitationReceived, waitUntilOfferResult, -} from './sync-tools.js'; +} from '../src/sync-tools.js'; + +// keep these small for tests +const retryIntervalMs = 10; +const DEFAULT_TIMEOUT = 30; const makeFakeFollow = () => { let value = [[]]; @@ -48,17 +52,17 @@ test.serial('wait until contract is deployed', async t => { 'name', { follow, + log: t.log, setTimeout, }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'Contract not deployed yet', }, ); - setTimeout(() => setValue([['name', true]]), 3000); // set desired value after third retry + setTimeout(() => setValue([['name', true]]), DEFAULT_TIMEOUT); // set desired value after third retry await t.notThrowsAsync(waitP); }); @@ -68,12 +72,11 @@ test.serial('wait until account funded', async t => { const waitP = waitUntilAccountFunded( 'agoric12345', - { query, setTimeout }, + { log: t.log, query, setTimeout }, { denom: 'ufake', value: 100_000 }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'Account not funded yet', }, ); @@ -98,7 +101,7 @@ test.serial('wait until account funded', async t => { total: '0', }, }; - setTimeout(() => setResult(desiredResult), 3000); // set desired value after third retry + setTimeout(() => setResult(desiredResult), DEFAULT_TIMEOUT); // set desired value after third retry await t.notThrowsAsync(waitP); }); @@ -107,12 +110,11 @@ test.serial('wait until account funded, insufficient balance', async t => { const waitP = waitUntilAccountFunded( 'agoric12345', - { query, setTimeout }, + { log: t.log, query, setTimeout }, { denom: 'ufake', value: 100_000 }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'Account not funded yet', }, ); @@ -137,7 +139,7 @@ test.serial('wait until account funded, insufficient balance', async t => { total: '0', }, }; - setTimeout(() => setResult(desiredResult), 3000); // set desired value after third retry + setTimeout(() => setResult(desiredResult), DEFAULT_TIMEOUT); // set desired value after third retry await t.throwsAsync(waitP, { message: /Account not funded yet/ }); }); @@ -151,11 +153,10 @@ test.serial( 'agoric12345', 'my-offer', false, - { follow, setTimeout }, + { log: t.log, follow, setTimeout }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'Wrong update type', }, ); @@ -172,11 +173,10 @@ test.serial('wait until offer result, wrong id - should throw', async t => { 'agoric12345', 'my-offer', false, - { follow, setTimeout }, + { log: t.log, follow, setTimeout }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'Wrong offer id', }, ); @@ -192,11 +192,10 @@ test.serial('wait until offer result, no "status" - should throw', async t => { 'agoric12345', 'my-offer', false, - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'No "status" object', }, ); @@ -217,11 +216,10 @@ test.serial( 'agoric12345', 'my-offer', false, - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: '"numWantsSatisfied" is not 1', }, ); @@ -238,11 +236,10 @@ test.serial('wait until offer result, do not wait for "payouts"', async t => { 'agoric12345', 'my-offer', false, - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 7, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'offer not resulted on time', }, ); @@ -253,7 +250,7 @@ test.serial('wait until offer result, do not wait for "payouts"', async t => { status: { id: 'my-offer', numWantsSatisfied: 1 }, updated: 'offerStatus', }), - 1000, + 10, ); // First, offer is seated setTimeout( () => @@ -261,7 +258,7 @@ test.serial('wait until offer result, do not wait for "payouts"', async t => { status: { id: 'my-offer', numWantsSatisfied: 1, result: 'thank you' }, updated: 'offerStatus', }), - 3000, + DEFAULT_TIMEOUT, ); // Then offer got results await t.notThrowsAsync(waitP); @@ -275,11 +272,10 @@ test.serial('wait until offer result, wait for "payouts"', async t => { 'agoric12345', 'my-offer', true, - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 7, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'payouts not received on time', }, ); @@ -290,7 +286,7 @@ test.serial('wait until offer result, wait for "payouts"', async t => { status: { id: 'my-offer', numWantsSatisfied: 1 }, updated: 'offerStatus', }), - 1000, + 10, ); // First, offer is seated setTimeout( () => @@ -298,7 +294,7 @@ test.serial('wait until offer result, wait for "payouts"', async t => { status: { id: 'my-offer', numWantsSatisfied: 1, result: 'thank you' }, updated: 'offerStatus', }), - 3000, + 30, ); // Now offer got results setTimeout( () => @@ -311,7 +307,7 @@ test.serial('wait until offer result, wait for "payouts"', async t => { }, updated: 'offerStatus', }), - 4000, + 40, ); // Payouts are received await t.notThrowsAsync(waitP); @@ -325,11 +321,10 @@ test.serial( const waitP = waitUntilInvitationReceived( 'agoric12345', - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 3, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'wrong "updated" value', }, ); @@ -346,18 +341,17 @@ test.serial( const waitP = waitUntilInvitationReceived( 'agoric12345', - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'faulty "currentAmount" object', }, ); setTimeout( () => setValue({ updated: 'balance', currentAmount: { foo: true } }), - 2000, + 20, ); await t.throwsAsync(waitP, { message: /faulty "currentAmount" object/ }); @@ -372,11 +366,10 @@ test.serial( const waitP = waitUntilInvitationReceived( 'agoric12345', - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 3, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'brand string do not match', }, ); @@ -391,11 +384,10 @@ test.serial('wait until invitation recevied', async t => { const waitP = waitUntilInvitationReceived( 'agoric12345', - { follow, setTimeout }, + { follow, log: t.log, setTimeout }, { maxRetries: 5, - retryIntervalMs: 1000, - log: t.log, + retryIntervalMs, errorMessage: 'brand string do not match', }, ); @@ -406,7 +398,7 @@ test.serial('wait until invitation recevied', async t => { updated: 'balance', currentAmount: { brand: '[Alleged: SEVERED: Zoe Invitation brand {}]' }, }), - 2000, + 20, ); await t.notThrowsAsync(waitP);