agoric 0.21.1 → 0.21.2-dev-8c14632.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agoric",
3
- "version": "0.21.1",
3
+ "version": "0.21.2-dev-8c14632.0+8c14632",
4
4
  "description": "Manage the Agoric Javascript smart contract platform",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -24,25 +24,25 @@
24
24
  "lint:eslint": "eslint ."
25
25
  },
26
26
  "devDependencies": {
27
- "@agoric/deploy-script-support": "^0.10.3",
28
- "ava": "^5.2.0",
27
+ "@agoric/deploy-script-support": "0.10.4-dev-8c14632.0+8c14632",
28
+ "ava": "^5.3.0",
29
29
  "c8": "^7.13.0"
30
30
  },
31
31
  "dependencies": {
32
- "@agoric/access-token": "^0.4.21",
33
- "@agoric/assert": "^0.6.0",
34
- "@agoric/cache": "^0.3.2",
35
- "@agoric/casting": "^0.4.2",
36
- "@agoric/cosmic-proto": "^0.3.0",
37
- "@agoric/ertp": "^0.16.2",
38
- "@agoric/inter-protocol": "^0.16.1",
39
- "@agoric/internal": "^0.3.2",
40
- "@agoric/smart-wallet": "^0.5.3",
41
- "@agoric/store": "^0.9.2",
42
- "@agoric/swingset-vat": "^0.32.2",
43
- "@agoric/vats": "^0.15.1",
44
- "@agoric/zoe": "^0.26.2",
45
- "@agoric/zone": "^0.2.2",
32
+ "@agoric/access-token": "0.4.22-dev-8c14632.0+8c14632",
33
+ "@agoric/assert": "0.6.1-dev-8c14632.0+8c14632",
34
+ "@agoric/cache": "0.3.3-dev-8c14632.0+8c14632",
35
+ "@agoric/casting": "0.4.3-dev-8c14632.0+8c14632",
36
+ "@agoric/cosmic-proto": "0.3.1-dev-8c14632.0+8c14632",
37
+ "@agoric/ertp": "0.16.3-dev-8c14632.0+8c14632",
38
+ "@agoric/inter-protocol": "0.16.2-dev-8c14632.0+8c14632",
39
+ "@agoric/internal": "0.3.3-dev-8c14632.0+8c14632",
40
+ "@agoric/smart-wallet": "0.5.4-dev-8c14632.0+8c14632",
41
+ "@agoric/store": "0.9.3-dev-8c14632.0+8c14632",
42
+ "@agoric/swingset-vat": "0.32.3-dev-8c14632.0+8c14632",
43
+ "@agoric/vats": "0.15.2-dev-8c14632.0+8c14632",
44
+ "@agoric/zoe": "0.26.3-dev-8c14632.0+8c14632",
45
+ "@agoric/zone": "0.2.3-dev-8c14632.0+8c14632",
46
46
  "@confio/relayer": "^0.9.0",
47
47
  "@cosmjs/crypto": "^0.30.1",
48
48
  "@cosmjs/encoding": "^0.30.1",
@@ -88,5 +88,5 @@
88
88
  "timeout": "2m",
89
89
  "workerThreads": false
90
90
  },
91
- "gitHead": "ba3b776444425bbcb275ce918794d9259f8e15da"
91
+ "gitHead": "8c14632298cfb982f91dc0ef271681703237a93f"
92
92
  }
package/src/bin-agops.js CHANGED
@@ -2,12 +2,14 @@
2
2
  // @ts-check
3
3
  // @jessie-check
4
4
 
5
- /* eslint-disable @jessie.js/no-nested-await */
6
5
  /* global fetch, setTimeout */
7
6
 
7
+ import '@endo/init/pre.js';
8
+
8
9
  import '@agoric/casting/node-fetch-shim.js';
9
10
  import '@endo/init';
10
- import '@endo/init/pre.js';
11
+
12
+ import { E } from '@endo/far';
11
13
 
12
14
  import { execFileSync } from 'child_process';
13
15
  import path from 'path';
@@ -74,13 +76,11 @@ program.addCommand(makeAuctionCommand(logger, { ...procIO, fetch }));
74
76
  program.addCommand(makeInterCommand(procIO, { fetch }));
75
77
  program.addCommand(makeTestCommand(procIO, { fetch }));
76
78
 
77
- try {
78
- await program.parseAsync(process.argv);
79
- } catch (err) {
79
+ E.when(program.parseAsync(process.argv), undefined, err => {
80
80
  if (err instanceof CommanderError) {
81
81
  console.error(err.message);
82
82
  } else {
83
83
  console.error(err); // CRASH! show stack trace
84
84
  }
85
85
  process.exit(1);
86
- }
86
+ });
@@ -1,4 +1,3 @@
1
- /* eslint-disable @jessie.js/no-nested-await */
2
1
  // @ts-check
3
2
  /* eslint-disable func-names */
4
3
  import { InvalidArgumentError } from 'commander';
@@ -1,4 +1,3 @@
1
- /* eslint-disable @jessie.js/no-nested-await */
2
1
  // @ts-check
3
2
  /* eslint-disable func-names */
4
3
  /* global globalThis, process, setTimeout */
@@ -238,7 +238,6 @@ export const makeInterCommand = (
238
238
  try {
239
239
  // XXX pass fetch to getNetworkConfig() explicitly
240
240
  // await null above makes this await safe
241
- // eslint-disable-next-line @jessie.js/no-nested-await
242
241
  const networkConfig = await getNetworkConfig(env);
243
242
  return makeWalletUtils({ fetch, execFileSync, delay }, networkConfig);
244
243
  } catch (err) {
@@ -1,5 +1,3 @@
1
- /* eslint-disable no-await-in-loop */
2
- /* eslint-disable @jessie.js/no-nested-await */
3
1
  // @ts-check
4
2
  /* eslint-disable func-names */
5
3
  /* global fetch, setTimeout, process */
@@ -9,6 +7,7 @@ import { Nat } from '@endo/nat';
9
7
  import { Command } from 'commander';
10
8
  import * as cp from 'child_process';
11
9
  import { inspect } from 'util';
10
+ import { instanceNameFor } from '@agoric/inter-protocol/src/proposals/price-feed-proposal.js';
12
11
  import { normalizeAddressWithOptions } from '../lib/chain.js';
13
12
  import { getNetworkConfig, makeRpcUtils, storageHelper } from '../lib/rpc.js';
14
13
  import {
@@ -77,7 +76,7 @@ export const makeOracleCommand = (logger, io = {}) => {
77
76
  const utils = await makeRpcUtils({ fetch });
78
77
 
79
78
  const lookupPriceAggregatorInstance = ([brandIn, brandOut]) => {
80
- const name = `${brandIn}-${brandOut} price feed`;
79
+ const name = instanceNameFor(brandIn, brandOut);
81
80
  const instance = utils.agoricNames.instance[name];
82
81
  if (!instance) {
83
82
  logger.debug('known instances:', utils.agoricNames.instance);
@@ -1,5 +1,3 @@
1
- /* eslint-disable no-await-in-loop */
2
- /* eslint-disable @jessie.js/no-nested-await */
3
1
  // @ts-check
4
2
  /* eslint-disable func-names */
5
3
  /* global process */
@@ -1,5 +1,3 @@
1
- /* eslint-disable no-await-in-loop */
2
- /* eslint-disable @jessie.js/no-nested-await */
3
1
  // @ts-check
4
2
  /* eslint-disable func-names */
5
3
  /* global fetch, process */
@@ -1,4 +1,3 @@
1
- /* eslint-disable @jessie.js/no-nested-await */
2
1
  // @ts-check
3
2
  /* eslint-disable func-names */
4
3
  /* global fetch, process */
@@ -38,7 +38,6 @@ export const makeTestCommand = (
38
38
  try {
39
39
  // XXX pass fetch to getNetworkConfig() explicitly
40
40
  // await null above makes this await safe
41
- // eslint-disable-next-line @jessie.js/no-nested-await
42
41
  const networkConfig = await getNetworkConfig(env);
43
42
  return makeWalletUtils({ fetch, execFileSync, delay }, networkConfig);
44
43
  } catch (err) {
@@ -1,5 +1,3 @@
1
- /* eslint-disable no-await-in-loop */
2
- /* eslint-disable @jessie.js/no-nested-await */
3
1
  // @ts-check
4
2
  /* eslint-disable func-names */
5
3
  /* global fetch, process */
package/src/helpers.js CHANGED
@@ -13,8 +13,7 @@ export const getSDKBinaries = ({
13
13
  return {
14
14
  agSolo: new URL(`${jsPfx}/solo/src/entrypoint.js`, myUrl).pathname,
15
15
  agSoloBuild: ['yarn', '--cwd', xsnap, `build:from-env`],
16
- cosmosChain: new URL(`${jsPfx}/cosmic-swingset/bin/ag-chain-cosmos`, myUrl)
17
- .pathname,
16
+ cosmosChain: new URL(`${goPfx}/cosmos/build/agd`, myUrl).pathname,
18
17
  cosmosChainBuild: cosmosBuild,
19
18
  cosmosClientBuild: cosmosBuild,
20
19
  cosmosHelper: new URL(`${goPfx}/cosmos/build/agd`, myUrl).pathname,
package/src/init.js CHANGED
@@ -60,7 +60,6 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
60
60
  const path = `${DIR}/${dir}package.json`;
61
61
  log('rewriting ', path);
62
62
 
63
- // eslint-disable-next-line no-await-in-loop
64
63
  const contents = await fs.readFile(path, 'utf-8');
65
64
  const pkg = JSON.parse(contents.replace(/@DIR@/g, DIR));
66
65
  if (dir === '') {
@@ -74,7 +73,6 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
74
73
  pkg.name = `${DIR}${pkg.name.substr(topLevelName.length)}`;
75
74
  const json = JSON.stringify(pkg, undefined, 2);
76
75
 
77
- // eslint-disable-next-line no-await-in-loop
78
76
  await fs.writeFile(path, json);
79
77
  }
80
78
 
package/src/install.js CHANGED
@@ -61,7 +61,6 @@ export default async function installMain(progname, rawArgs, powers, opts) {
61
61
  const yarnInstallEachWorktree = async (phase, ...flags) => {
62
62
  for await (const workTree of workTrees) {
63
63
  log.info(`yarn install ${phase} in ${workTree}`);
64
- // eslint-disable-next-line no-await-in-loop
65
64
  const yarnInstall = await pspawn(
66
65
  'yarn',
67
66
  [...linkFlags, 'install', ...flags],
@@ -288,6 +287,7 @@ export default async function installMain(progname, rawArgs, powers, opts) {
288
287
  await Promise.all(
289
288
  [...sdkPackageToPath.entries()].map(async ([pjName, dir]) => {
290
289
  const SUBOPTIMAL = false;
290
+ await null;
291
291
  if (SUBOPTIMAL) {
292
292
  // This use of yarn is noisy and slow.
293
293
  await pspawn('yarn', [...linkFlags, 'unlink', pjName]);
package/src/lib/chain.js CHANGED
@@ -122,7 +122,6 @@ export const pollBlocks = opts => async lookup => {
122
122
  } = status;
123
123
  try {
124
124
  // see await null above
125
- // eslint-disable-next-line @jessie.js/no-nested-await, no-await-in-loop
126
125
  const result = await lookup({ time, height });
127
126
  return result;
128
127
  } catch (_err) {
@@ -132,7 +131,6 @@ export const pollBlocks = opts => async lookup => {
132
131
  height,
133
132
  'retrying...',
134
133
  );
135
- // eslint-disable-next-line @jessie.js/no-nested-await, no-await-in-loop
136
134
  await delay(period);
137
135
  }
138
136
  }
package/src/lib/rpc.js CHANGED
@@ -1,5 +1,4 @@
1
1
  // @ts-check
2
- /* eslint-disable @jessie.js/no-nested-await */
3
2
  /* global Buffer, fetch, process */
4
3
 
5
4
  import { NonNullish } from '@agoric/assert';
@@ -50,7 +49,8 @@ export const getNetworkConfig = async env => {
50
49
  };
51
50
 
52
51
  /** @type {MinimalNetworkConfig} */
53
- export const networkConfig = await getNetworkConfig(process.env);
52
+ const networkConfig = await getNetworkConfig(process.env);
53
+ export { networkConfig };
54
54
  // console.warn('networkConfig', networkConfig);
55
55
 
56
56
  /**
@@ -132,11 +132,11 @@ export const makeVStorage = (powers, config = networkConfig) => {
132
132
  const parts = [];
133
133
  // undefined the first iteration, to query at the highest
134
134
  let blockHeight;
135
+ await null;
135
136
  do {
136
137
  // console.debug('READING', { blockHeight });
137
138
  let values;
138
139
  try {
139
- // eslint-disable-next-line no-await-in-loop
140
140
  ({ blockHeight, values } = await this.readAt(
141
141
  path,
142
142
  blockHeight && Number(blockHeight) - 1,
@@ -242,6 +242,7 @@ export const makeAgoricNames = async (ctx, vstorage) => {
242
242
  * @param {MinimalNetworkConfig} config
243
243
  */
244
244
  export const makeRpcUtils = async ({ fetch }, config = networkConfig) => {
245
+ await null;
245
246
  try {
246
247
  const vstorage = makeVStorage({ fetch }, config);
247
248
  const fromBoard = makeFromBoard();
package/src/lib/wallet.js CHANGED
@@ -247,7 +247,6 @@ export const makeWalletUtils = async (
247
247
  untilNumWantsSatisfied = false,
248
248
  ) => {
249
249
  const lookup = async () => {
250
- // eslint-disable-next-line @jessie.js/no-nested-await, no-await-in-loop
251
250
  const { offerStatuses } = await storedWalletState(from, minHeight);
252
251
  const offerStatus = [...offerStatuses.values()].find(s => s.id === id);
253
252
  if (!offerStatus) throw Error('retry');
@@ -31,9 +31,9 @@ const publishMain = async (progname, rawArgs, powers, opts) => {
31
31
  chainID,
32
32
  };
33
33
 
34
+ await null;
34
35
  for (const bundlePath of rawArgs.slice(1)) {
35
36
  // AWAIT
36
- // eslint-disable-next-line no-await-in-loop,@jessie.js/no-nested-await
37
37
  const bundleText = await fs.readFile(bundlePath, 'utf-8');
38
38
  const bundle = parseLocatedJson(bundleText, bundlePath);
39
39
 
@@ -53,7 +53,6 @@ const publishMain = async (progname, rawArgs, powers, opts) => {
53
53
  });
54
54
 
55
55
  // AWAIT
56
- // eslint-disable-next-line no-await-in-loop,@jessie.js/no-nested-await
57
56
  const hashedBundle = await publishBundle(bundle, connectionSpec);
58
57
  process.stdout.write(`${JSON.stringify(hashedBundle)}\n`);
59
58
  }
package/src/main.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint-disable @jessie.js/no-nested-await */
2
1
  /* global process */
3
2
  import { Command } from 'commander';
4
3
  import path from 'path';
@@ -36,6 +35,7 @@ const main = async (progname, rawArgs, powers) => {
36
35
  const program = new Command();
37
36
 
38
37
  async function isNotBasedir() {
38
+ await null;
39
39
  try {
40
40
  await fs.stat(STAMP);
41
41
  return false;
package/src/publish.js CHANGED
@@ -289,14 +289,12 @@ export const makeCosmosBundlePublisher = ({
289
289
  const endpoint = urlForRpcAddress(rpcAddress);
290
290
 
291
291
  // AWAIT
292
- // eslint-disable-next-line no-await-in-loop,@jessie.js/no-nested-await
293
292
  const stargateClient = await connectWithSigner(endpoint, wallet, {
294
293
  gasPrice: Agoric.gasPrice,
295
294
  registry,
296
295
  });
297
296
 
298
297
  // AWAIT
299
- // eslint-disable-next-line no-await-in-loop,@jessie.js/no-nested-await
300
298
  const result = await stargateClient
301
299
  .signAndBroadcast(from.address, encodeObjects, Agoric.fee)
302
300
  .catch(error => {
@@ -312,7 +310,6 @@ export const makeCosmosBundlePublisher = ({
312
310
  }
313
311
 
314
312
  // AWAIT
315
- // eslint-disable-next-line no-await-in-loop,@jessie.js/no-nested-await
316
313
  await E(leader).jitter('agoric CLI deploy');
317
314
  }
318
315
 
@@ -426,6 +423,7 @@ const publishBundle = async (
426
423
  )}, publishBundle supports only "endoZipBase64" with "endoZipBase64Sha512"`;
427
424
  }
428
425
 
426
+ await null;
429
427
  if (connectionSpec === undefined && getDefaultConnection !== undefined) {
430
428
  connectionSpec = await getDefaultConnection();
431
429
  }
@@ -42,6 +42,7 @@ export default async function setDefaultsMain(progname, rawArgs, powers, opts) {
42
42
  return fs.writeFile(fileName, contents);
43
43
  };
44
44
 
45
+ await null;
45
46
  if (appFile) {
46
47
  log(`read ${appFile}`);
47
48
  const appToml = await fs.readFile(appFile, 'utf-8');
package/src/start.js CHANGED
@@ -151,6 +151,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {
151
151
  ]);
152
152
 
153
153
  const exists = async file => {
154
+ await null;
154
155
  try {
155
156
  await fs.stat(file);
156
157
  return true;
@@ -173,6 +174,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {
173
174
 
174
175
  const agServer = `_agstate/agoric-servers/${profileName}`;
175
176
 
177
+ await null;
176
178
  if (popts.reset) {
177
179
  log(chalk.green(`removing ${agServer}`));
178
180
  // rm is available on all the unix-likes, so use it for speed.
@@ -246,6 +248,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {
246
248
  }
247
249
 
248
250
  const { cosmosChain, cosmosChainBuild } = getSDKBinaries(sdkPrefixes);
251
+ await null;
249
252
  if (popts.pull || popts.rebuild) {
250
253
  if (popts.dockerTag) {
251
254
  const exitStatus = await pspawn('docker', ['pull', SDK_IMAGE]);
@@ -308,7 +311,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
308
311
  // Get or create the essential addresses.
309
312
  const addrs = {};
310
313
  for (const keyName of ['provision', 'delegate0']) {
311
- /* eslint-disable no-await-in-loop */
312
314
  let statusOut = showKey(keyName);
313
315
  const exitStatusOut = await statusOut[0];
314
316
  if (exitStatusOut) {
@@ -449,6 +451,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {
449
451
  const agServer = `_agstate/agoric-servers/${profileName}-${portNum}`;
450
452
 
451
453
  const { cosmosClientBuild } = getSDKBinaries(sdkPrefixes);
454
+ await null;
452
455
  if (popts.pull || popts.rebuild) {
453
456
  if (popts.dockerTag) {
454
457
  const exitStatus = await pspawn('docker', ['pull', SDK_IMAGE]);
@@ -555,7 +558,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
555
558
  for await (const _ of untilTrue(() => hasGci)) {
556
559
  process.stdout.write('.');
557
560
 
558
- // eslint-disable-next-line no-await-in-loop
559
561
  await new Promise((resolve, reject) => {
560
562
  fs.stat(gciFile).then(
561
563
  _2 => {
@@ -590,7 +592,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
590
592
  let bestRpcAddr;
591
593
  for await (const _ of untilTrue(() => bestRpcAddr)) {
592
594
  for await (const rpcAddr of rpcAddrs) {
593
- // eslint-disable-next-line no-await-in-loop
594
595
  exitStatus = await keysSpawn([
595
596
  'query',
596
597
  'swingset',
@@ -639,7 +640,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
639
640
  ];
640
641
  for (/* await */ const cmd of provCmds) {
641
642
  const statusOut = capture(keysSpawn, cmd, true);
642
- // eslint-disable-next-line no-await-in-loop
643
643
  exitStatus = await statusOut[0];
644
644
  if (!exitStatus) {
645
645
  const json = statusOut[1].replace(/^gas estimate: \d+$/m, '');
@@ -664,7 +664,6 @@ export default async function startMain(progname, rawArgs, powers, opts) {
664
664
  }
665
665
  }
666
666
  if (!bestRpcAddr) {
667
- // eslint-disable-next-line no-await-in-loop
668
667
  await delay(2000);
669
668
  }
670
669
  }
@@ -690,6 +689,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {
690
689
  }
691
690
 
692
691
  async function startTestnetDocker(profileName, startArgs, popts) {
692
+ await null;
693
693
  if (popts.dockerTag && popts.pull) {
694
694
  const exitStatus = await pspawn('docker', ['pull', SOLO_IMAGE]);
695
695
  if (exitStatus) {
@@ -729,6 +729,7 @@ export default async function startMain(progname, rawArgs, powers, opts) {
729
729
  const netconfig = startArgs[1] || DEFAULT_NETCONFIG;
730
730
  const agServer = `_agstate/agoric-servers/${profileName}-${port}`;
731
731
 
732
+ await null;
732
733
  if (popts.reset) {
733
734
  log(chalk.green(`removing ${agServer}`));
734
735
  // rm is available on all the unix-likes, so use it for speed.