@agoric/solo 0.10.4-dev-5dc325b.0 → 0.10.4-getting-started-dev-d127d1d.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/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [0.10.4-u12.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/solo@0.10.4-u11wf.0...@agoric/solo@0.10.4-u12.0) (2023-11-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **solo:** correct lookup of wallet-ui ([670fc25](https://github.com/Agoric/agoric-sdk/commit/670fc25f30964c40fc887fac77ebf54bf58c7b8e))
12
+ * **solo:** use alternative endo init ([60a680a](https://github.com/Agoric/agoric-sdk/commit/60a680a2124ee9868ba3b8352a3a5a9f30ce7ab6))
13
+
14
+
15
+
16
+ ### [0.10.4-u11wf.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/solo@0.10.4-u11.0...@agoric/solo@0.10.4-u11wf.0) (2023-09-23)
17
+
18
+ **Note:** Version bump only for package @agoric/solo
19
+
20
+
21
+
22
+
23
+
24
+ ### [0.10.4-u11.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/solo@0.10.3...@agoric/solo@0.10.4-u11.0) (2023-08-24)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **solo:** let `init` tolerate existing `html` directory ([fa942e2](https://github.com/Agoric/agoric-sdk/commit/fa942e2f17026635e70e9f618bc1f9005498c862))
30
+
31
+
32
+
6
33
  ### [0.10.3](https://github.com/Agoric/agoric-sdk/compare/@agoric/solo@0.10.2...@agoric/solo@0.10.3) (2023-06-09)
7
34
 
8
35
  **Note:** Version bump only for package @agoric/solo
@@ -2,7 +2,6 @@
2
2
  {
3
3
  "extends": "../../tsconfig.json",
4
4
  "compilerOptions": {
5
- "allowSyntheticDefaultImports": true,
6
5
  "checkJs": false,
7
6
  },
8
7
  "include": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/solo",
3
- "version": "0.10.4-dev-5dc325b.0+5dc325b",
3
+ "version": "0.10.4-getting-started-dev-d127d1d.0+d127d1d",
4
4
  "description": "Agoric's Solo vat runner",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,33 +15,34 @@
15
15
  "test:xs": "exit 0",
16
16
  "lint-fix": "yarn lint:eslint --fix",
17
17
  "lint": "run-s --continue-on-error lint:*",
18
- "lint:types": "tsc",
18
+ "lint:types": "tsc -p jsconfig.json",
19
19
  "lint:eslint": "eslint ."
20
20
  },
21
21
  "keywords": [],
22
22
  "author": "Agoric",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@agoric/access-token": "0.4.22-dev-5dc325b.0+5dc325b",
26
- "@agoric/assert": "0.6.1-dev-5dc325b.0+5dc325b",
27
- "@agoric/cache": "0.3.3-dev-5dc325b.0+5dc325b",
28
- "@agoric/cosmic-swingset": "0.41.4-dev-5dc325b.0+5dc325b",
29
- "@agoric/internal": "0.3.3-dev-5dc325b.0+5dc325b",
30
- "@agoric/notifier": "0.6.3-dev-5dc325b.0+5dc325b",
31
- "@agoric/spawner": "0.6.9-dev-5dc325b.0+5dc325b",
32
- "@agoric/store": "0.9.3-dev-5dc325b.0+5dc325b",
33
- "@agoric/swing-store": "0.9.2-dev-5dc325b.0+5dc325b",
34
- "@agoric/swingset-vat": "0.32.3-dev-5dc325b.0+5dc325b",
35
- "@agoric/telemetry": "0.6.3-dev-5dc325b.0+5dc325b",
36
- "@agoric/time": "0.3.3-dev-5dc325b.0+5dc325b",
37
- "@agoric/vats": "0.15.2-dev-5dc325b.0+5dc325b",
38
- "@agoric/wallet": "0.18.4-dev-5dc325b.0+5dc325b",
39
- "@endo/captp": "^3.1.4",
40
- "@endo/eventual-send": "^0.17.5",
41
- "@endo/import-bundle": "^0.4.1",
42
- "@endo/init": "^0.5.59",
43
- "@endo/marshal": "^0.8.8",
44
- "@endo/promise-kit": "^0.2.59",
25
+ "@agoric/access-token": "0.4.22-getting-started-dev-d127d1d.0+d127d1d",
26
+ "@agoric/assert": "0.6.1-getting-started-dev-d127d1d.0+d127d1d",
27
+ "@agoric/cache": "0.3.3-getting-started-dev-d127d1d.0+d127d1d",
28
+ "@agoric/cosmic-swingset": "0.42.0-getting-started-dev-d127d1d.0+d127d1d",
29
+ "@agoric/internal": "0.4.0-getting-started-dev-d127d1d.0+d127d1d",
30
+ "@agoric/notifier": "0.6.3-getting-started-dev-d127d1d.0+d127d1d",
31
+ "@agoric/spawner": "0.6.9-getting-started-dev-d127d1d.0+d127d1d",
32
+ "@agoric/store": "0.9.3-getting-started-dev-d127d1d.0+d127d1d",
33
+ "@agoric/swing-store": "0.9.2-getting-started-dev-d127d1d.0+d127d1d",
34
+ "@agoric/swingset-vat": "0.32.3-getting-started-dev-d127d1d.0+d127d1d",
35
+ "@agoric/telemetry": "0.6.3-getting-started-dev-d127d1d.0+d127d1d",
36
+ "@agoric/time": "0.3.3-getting-started-dev-d127d1d.0+d127d1d",
37
+ "@agoric/vats": "0.15.2-getting-started-dev-d127d1d.0+d127d1d",
38
+ "@agoric/wallet": "0.18.4-getting-started-dev-d127d1d.0+d127d1d",
39
+ "@endo/captp": "3.1.1",
40
+ "@endo/eventual-send": "0.17.2",
41
+ "@endo/import-bundle": "0.3.4",
42
+ "@endo/init": "0.5.56",
43
+ "@endo/marshal": "0.8.5",
44
+ "@endo/promise-kit": "0.2.56",
45
+ "agoric": "0.21.2-getting-started-dev-d127d1d.0+d127d1d",
45
46
  "anylogger": "^0.21.0",
46
47
  "deterministic-json": "^1.0.5",
47
48
  "esm": "agoric-labs/esm#Agoric-built",
@@ -49,16 +50,16 @@
49
50
  "http-proxy-middleware": "^2.0.6",
50
51
  "import-meta-resolve": "^2.2.1",
51
52
  "minimist": "^1.2.0",
52
- "morgan": "^1.10.0",
53
+ "morgan": "^1.9.1",
53
54
  "node-fetch": "^2.6.0",
54
55
  "temp": "^0.9.1",
55
56
  "tmp": "^0.2.1",
56
57
  "ws": "^7.2.0"
57
58
  },
58
59
  "devDependencies": {
59
- "@agoric/ertp": "0.16.3-dev-5dc325b.0+5dc325b",
60
- "@endo/bundle-source": "^2.7.0",
61
- "ava": "^5.3.0",
60
+ "@agoric/ertp": "0.16.3-getting-started-dev-d127d1d.0+d127d1d",
61
+ "@endo/bundle-source": "2.5.2-upstream-rollup",
62
+ "ava": "^5.2.0",
62
63
  "c8": "^7.13.0"
63
64
  },
64
65
  "publishConfig": {
@@ -71,14 +72,8 @@
71
72
  "files": [
72
73
  "test/**/test-*.js"
73
74
  ],
74
- "require": [
75
- "@endo/init/debug.js"
76
- ],
77
75
  "timeout": "20m",
78
76
  "workerThreads": false
79
77
  },
80
- "typeCoverage": {
81
- "atLeast": 68.59
82
- },
83
- "gitHead": "5dc325b8cc1d94f46ecc18a7c67a14989feade11"
78
+ "gitHead": "d127d1db6a8d22a5c56c6408f69ae753c8215372"
84
79
  }
package/public/main.js CHANGED
@@ -1,5 +1,4 @@
1
1
  /* global setTimeout */
2
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
3
2
  // NOTE: Runs outside SES
4
3
 
5
4
  /* global WebSocket fetch document window walletFrame localStorage */
@@ -266,7 +265,7 @@ function run() {
266
265
  commands[commands.length - 1] = inp.value;
267
266
  commands[commands.length] = '';
268
267
  inp.value = '';
269
- void call({ type: 'doEval', number, body: command });
268
+ call({ type: 'doEval', number, body: command });
270
269
  }
271
270
 
272
271
  function inputKeyup(ev) {
package/src/add-chain.js CHANGED
@@ -13,7 +13,7 @@ const DEFAULT_CHAIN_CONFIG = 'https://testnet.agoric.com/network-config';
13
13
  /**
14
14
  * @param {string} basedir
15
15
  * @param {string} [chainConfig]
16
- * @param {boolean} [force]
16
+ * @param {boolean} [force=false]
17
17
  */
18
18
  async function addChain(basedir, chainConfig, force = false) {
19
19
  let actualConfig = chainConfig;
@@ -29,7 +29,6 @@ async function addChain(basedir, chainConfig, force = false) {
29
29
  const url = new URL(actualConfig, `file://${process.cwd()}`);
30
30
  console.log('downloading netconfig from', url.href);
31
31
  let netconf;
32
- await null;
33
32
  if (url.protocol === 'file:') {
34
33
  const f = fs.readFileSync(url.pathname, 'utf-8');
35
34
  netconf = JSON.parse(f);
package/src/captp.js CHANGED
@@ -1,5 +1,4 @@
1
1
  // @ts-check
2
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
3
2
  import { E, makeCapTP } from '@endo/captp';
4
3
  import { Far } from '@endo/marshal';
5
4
 
@@ -43,9 +42,7 @@ export const getCapTPHandler = (send, getLocalBootstrap, fallback) => {
43
42
  dispatch,
44
43
  abort,
45
44
  });
46
- doFallback('onOpen', obj, meta).catch(e => {
47
- console.error(`Error in fallback onOpen`, e);
48
- });
45
+ doFallback('onOpen', obj, meta);
49
46
  },
50
47
  onClose(obj, meta) {
51
48
  console.debug(`Finishing CapTP`, meta);
@@ -55,9 +52,7 @@ export const getCapTPHandler = (send, getLocalBootstrap, fallback) => {
55
52
  abort();
56
53
  }
57
54
  chans.delete(meta.channelHandle);
58
- doFallback('onClose', obj, meta).catch(e => {
59
- console.error(`Error in fallback onClose`, e);
60
- });
55
+ doFallback('onClose', obj, meta);
61
56
  },
62
57
  onError(obj, meta) {
63
58
  console.debug(`Error in CapTP`, meta, obj.error);
@@ -66,9 +61,7 @@ export const getCapTPHandler = (send, getLocalBootstrap, fallback) => {
66
61
  const { abort } = chan;
67
62
  abort(obj.error);
68
63
  }
69
- doFallback('onError', obj, meta).catch(e => {
70
- console.error(`Error in fallback onError`, e);
71
- });
64
+ doFallback('onError', obj, meta);
72
65
  },
73
66
  async onMessage(obj, meta) {
74
67
  console.debug('processing inbound', obj);
@@ -1,5 +1,4 @@
1
1
  /* global clearTimeout setTimeout Buffer */
2
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
3
2
  import path from 'path';
4
3
  import fs from 'fs';
5
4
  import url from 'url';
@@ -178,6 +177,7 @@ export async function connectToChain(
178
177
  const thisRpcHref = rpcHrefs[rpcHrefIndex];
179
178
 
180
179
  // tryOnce will either throw if cancelled (which rejects this promise),
180
+ // eslint-disable-next-line no-await-in-loop
181
181
  const ret = await tryOnce(thisRpcHref);
182
182
  if (ret !== undefined) {
183
183
  // Or returns non-undefined, which we should resolve.
@@ -186,6 +186,7 @@ export async function connectToChain(
186
186
  }
187
187
 
188
188
  // It was undefined, so wait, then retry.
189
+ // eslint-disable-next-line no-await-in-loop
189
190
  await new Promise(resolve => setTimeout(resolve, 5000));
190
191
  rpcHrefIndex = (rpcHrefIndex + 1) % rpcHrefs.length;
191
192
  }
@@ -258,7 +259,7 @@ export async function connectToChain(
258
259
  */
259
260
  const getMailboxNotifier = () => {
260
261
  const { notifier, updater } = makeNotifierKit();
261
- void retryRpcHref(async rpcHref => {
262
+ retryRpcHref(async rpcHref => {
262
263
  // Every time we enter this function, we are establishing a
263
264
  // new websocket to a potentially different RPC server.
264
265
  //
@@ -486,7 +487,7 @@ export async function connectToChain(
486
487
 
487
488
  waitForTxHash = subscribeAndWaitForTxHash;
488
489
  if (postponedTxHash) {
489
- void subscribeAndWaitForTxHash(postponedTxHash);
490
+ subscribeAndWaitForTxHash(postponedTxHash);
490
491
  }
491
492
 
492
493
  subscribeToStorage(`mailbox.${clientAddr}`, (err, storageValue) => {
@@ -660,6 +661,7 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress(
660
661
  let retry = true;
661
662
  for await (const _ of whileTrue(() => retry)) {
662
663
  retry = false;
664
+ // eslint-disable-next-line no-await-in-loop
663
665
  const { stderr, stdout } = await runHelper([
664
666
  ...txArgs,
665
667
  `--sequence=${sequenceNumber}`,
@@ -692,20 +694,15 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress(
692
694
  // Wait for the transaction to be included in a block.
693
695
  const txHash = out.txhash;
694
696
 
695
- waitForTxHash(txHash)
696
- .then(txResult => {
697
- // The result had an error code (not 0 or undefined for success).
698
- if (txResult.code) {
699
- // eslint-disable-next-line no-use-before-define
700
- failedSend(
701
- assert.error(`Error in tx processing: ${txResult.log}`),
702
- );
703
- }
704
- })
705
- .catch(err =>
697
+ waitForTxHash(txHash).then(txResult => {
698
+ // The result had an error code (not 0 or undefined for success).
699
+ if (txResult.code) {
706
700
  // eslint-disable-next-line no-use-before-define
707
- failedSend(assert.error(`Error in tx processing: ${err}`)),
708
- );
701
+ failedSend(
702
+ assert.error(`Error in tx processing: ${txResult.log}`),
703
+ );
704
+ }
705
+ });
709
706
 
710
707
  // We submitted the transaction to the mempool successfully.
711
708
  // Preemptively increment our sequence number to avoid needing to
@@ -727,8 +724,9 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress(
727
724
  * @param {bigint} [lastMailboxUpdate]
728
725
  */
729
726
  const recurseEachMailboxUpdate = async (lastMailboxUpdate = undefined) => {
730
- const { updateCount, value: mailbox } =
731
- await mbNotifier.getUpdateSince(lastMailboxUpdate);
727
+ const { updateCount, value: mailbox } = await mbNotifier.getUpdateSince(
728
+ lastMailboxUpdate,
729
+ );
732
730
  updateCount || Fail`${GCI} unexpectedly finished!`;
733
731
  if (mailbox) {
734
732
  const { outbox, ack } = mailbox;
@@ -782,7 +780,7 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress(
782
780
  updateCount || Fail`Sending unexpectedly finished!`;
783
781
 
784
782
  await sendFromMessagePool().then(successfulSend, failedSend);
785
- void recurseEachSend(updateCount);
783
+ recurseEachSend(updateCount);
786
784
  };
787
785
 
788
786
  // Begin the sender when we get the first (empty) mailbox update.
package/src/main.js CHANGED
@@ -55,7 +55,6 @@ start
55
55
  `);
56
56
  }
57
57
 
58
- await null;
59
58
  switch (argv[0]) {
60
59
  case 'setup': {
61
60
  const { netconfig } = parseArgs(argv.slice(1));
@@ -33,7 +33,6 @@ const main = async () => {
33
33
  deliverator(...as).then(() => send('go'));
34
34
  });
35
35
 
36
- await null;
37
36
  switch (method) {
38
37
  case 'connectToFakeChain': {
39
38
  const [basedir, GCI, delay] = margs;
@@ -59,13 +58,7 @@ const main = async () => {
59
58
  send('go');
60
59
  };
61
60
 
62
- process.exitCode = 1;
63
- main().then(
64
- () => {
65
- process.exitCode = 0;
66
- },
67
- err => {
68
- console.error('Failed with', err);
69
- process.exit(process.exitCode || 1);
70
- },
71
- );
61
+ main().catch(e => {
62
+ console.error(e);
63
+ process.exitCode = 1;
64
+ });
package/src/start.js CHANGED
@@ -262,7 +262,6 @@ const buildSwingset = async (
262
262
  async function deliverInboundToMbx(sender, messages, ack) {
263
263
  Array.isArray(messages) || Fail`inbound given non-Array: ${messages}`;
264
264
  // console.debug(`deliverInboundToMbx`, messages, ack);
265
- await null;
266
265
  if (mb.deliverInbound(sender, messages, ack)) {
267
266
  await processKernel();
268
267
  }
@@ -317,7 +316,6 @@ const buildSwingset = async (
317
316
  const queuedMoveTimeForward = withInputQueue(
318
317
  async function moveTimeForward() {
319
318
  const now = Date.now();
320
- await null;
321
319
  try {
322
320
  if (timer.poll(now)) {
323
321
  await processKernel();
@@ -497,7 +495,6 @@ const start = async (basedir, argv) => {
497
495
  let hostport;
498
496
  await Promise.all(
499
497
  connections.map(async c => {
500
- await null;
501
498
  switch (c.type) {
502
499
  case 'chain-cosmos-sdk':
503
500
  {
package/src/vat-http.js CHANGED
@@ -1,4 +1,3 @@
1
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
1
  import { makeNotifierKit } from '@agoric/notifier';
3
2
  import { makeCache } from '@agoric/cache';
4
3
  import { E } from '@endo/eventual-send';
@@ -107,8 +106,8 @@ export function buildRootObject(vatPowers) {
107
106
  setCommandDevice(d) {
108
107
  commandDevice = d;
109
108
 
110
- const replHandler = getReplHandler(replObjects, send);
111
- void registerURLHandler(replHandler, '/private/repl');
109
+ const replHandler = getReplHandler(replObjects, send, vatPowers);
110
+ registerURLHandler(replHandler, '/private/repl');
112
111
 
113
112
  // Assign the captp handler.
114
113
  const captpHandler = Far('captpHandler', {
@@ -127,7 +126,7 @@ export function buildRootObject(vatPowers) {
127
126
  return harden(exported);
128
127
  },
129
128
  });
130
- void registerURLHandler(captpHandler, '/private/captp');
129
+ registerURLHandler(captpHandler, '/private/captp');
131
130
  },
132
131
 
133
132
  registerURLHandler,
@@ -199,7 +198,6 @@ export function buildRootObject(vatPowers) {
199
198
  dispatcher = 'onMessage',
200
199
  } = rawMeta;
201
200
 
202
- await null;
203
201
  try {
204
202
  let channelHandle = channelIdToHandle.get(rawChannelID);
205
203
  if (dispatcher === 'onOpen') {
package/src/web.js CHANGED
@@ -353,7 +353,6 @@ export async function makeHTTPListener(
353
353
 
354
354
  ws.on('message', async message => {
355
355
  let obj = {};
356
- await null;
357
356
  try {
358
357
  obj = JSON.parse(message);
359
358
  const res = await inboundCommand(obj, meta, id);
@@ -1,5 +1,4 @@
1
1
  /* global process setTimeout */
2
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
3
2
  import { spawn } from 'child_process';
4
3
  import WebSocket from 'ws';
5
4
  import { makeCapTP, E } from '@endo/captp';
@@ -66,6 +65,7 @@ export async function makeFixture(PORT, noisy = false) {
66
65
  let lastUpdateCount;
67
66
  for (;;) {
68
67
  process.stdout.write('o');
68
+ // eslint-disable-next-line no-await-in-loop
69
69
  const update = await E(E.get(bootP).loadingNotifier).getUpdateSince(
70
70
  lastUpdateCount,
71
71
  );
@@ -109,7 +109,7 @@ export async function makeFixture(PORT, noisy = false) {
109
109
  // We only reject if the child exits before CapTP is established.
110
110
  reject(Error(`CapTP fixture exited with ${code}`));
111
111
  });
112
- void tryConnect(resolve, reject);
112
+ tryConnect(resolve, reject);
113
113
  });
114
114
  }
115
115
 
package/test/test-home.js CHANGED
@@ -5,6 +5,7 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js';
5
5
  import bundleSourceAmbient from '@endo/bundle-source';
6
6
  import { AmountMath } from '@agoric/ertp';
7
7
  import { TimeMath } from '@agoric/time';
8
+ import { Stable } from '@agoric/vats/src/tokens.js';
8
9
  import { Far } from '@endo/marshal';
9
10
  import { resolve as importMetaResolve } from 'import-meta-resolve';
10
11
 
@@ -12,21 +13,6 @@ import { makeFixture, E } from './captp-fixture.js';
12
13
 
13
14
  const SOLO_PORT = 7999;
14
15
 
15
- // XXX test depends on this exact value from the Inter Protocol economy,
16
- // by way of agoric-cli (which this test covertly depends upon)
17
- export const Stable = harden(
18
- /** @type {const } */ ({
19
- symbol: 'IST',
20
- denom: 'uist',
21
- proposedName: 'Agoric stable token',
22
- assetKind: 'nat',
23
- displayInfo: {
24
- decimalPlaces: 6,
25
- assetKind: 'nat',
26
- },
27
- }),
28
- );
29
-
30
16
  //#region setup (ambient authority is confined to this region)
31
17
  test.before('setup', async t => {
32
18
  const loadBundle = async specifier => {
@@ -95,8 +81,9 @@ test.serial('home.wallet - receive zoe invite', async t => {
95
81
  '@agoric/zoe/src/contracts/automaticRefund.js',
96
82
  );
97
83
  const installationHandle = await E(zoe).install(bundle);
98
- const { creatorInvitation: invite } =
99
- await E(zoe).startInstance(installationHandle);
84
+ const { creatorInvitation: invite } = await E(zoe).startInstance(
85
+ installationHandle,
86
+ );
100
87
 
101
88
  // Check that the wallet knows about the Zoe invite issuer and starts out
102
89
  // with a default Zoe invite issuer purse.
@@ -154,7 +141,7 @@ test.serial('home.localTimerService makeNotifier', async t => {
154
141
  const notifier = E(localTimerService).makeNotifier(1n, 1n);
155
142
  const update1 = await E(notifier).getUpdateSince();
156
143
  const firstUpdate = update1.updateCount;
157
- t.true(firstUpdate > 0);
144
+ t.truthy(firstUpdate > 0);
158
145
  const update2 = await E(notifier).getUpdateSince(update1.updateCount);
159
146
  t.truthy(BigInt(update2.updateCount) > BigInt(firstUpdate));
160
147