diff --git a/packages/SwingSet/misc-tools/extract-xs-snapshot.js b/packages/SwingSet/misc-tools/extract-xs-snapshot.js index 75fde2527620..0fd5da580424 100644 --- a/packages/SwingSet/misc-tools/extract-xs-snapshot.js +++ b/packages/SwingSet/misc-tools/extract-xs-snapshot.js @@ -55,7 +55,7 @@ if (!vatIDToExtract) { const { snapPos, hash } = info; const snapshot = snapStore.loadSnapshot(vatIDToExtract); const fn = `${vatIDToExtract}-${snapPos}-${hash}.xss`; - E.when(fs.promises.writeFile(fn, snapshot), () => + void E.when(fs.promises.writeFile(fn, snapshot), () => console.log(`wrote snapshot to ${fn}`), ); } diff --git a/packages/SwingSet/test/test-vat-timer.js b/packages/SwingSet/test/test-vat-timer.js index d5d6d2f37f1a..ef1a5b305add 100644 --- a/packages/SwingSet/test/test-vat-timer.js +++ b/packages/SwingSet/test/test-vat-timer.js @@ -269,8 +269,8 @@ test('brand', async t => { const whenNobrand = 123n; const delayNobrand = 123n; ts.setWakeup(whenNobrand, handler); - ts.wakeAt(whenNobrand); - ts.delay(delayNobrand); + void ts.wakeAt(whenNobrand); + void ts.delay(delayNobrand); ts.makeRepeater(delayNobrand, delayNobrand); ts.repeatAfter(delayNobrand, delayNobrand, handler); ts.makeNotifier(delayNobrand, delayNobrand); diff --git a/packages/SwingSet/test/transcript/test-state-sync-reload.js b/packages/SwingSet/test/transcript/test-state-sync-reload.js index 1eb72d925804..7174c5cd54bf 100644 --- a/packages/SwingSet/test/transcript/test-state-sync-reload.js +++ b/packages/SwingSet/test/transcript/test-state-sync-reload.js @@ -59,7 +59,7 @@ test('state-sync reload', async t => { const { commit } = hostStorage; const initOpts = { addComms: false, addVattp: false, addTimer: false }; await initializeSwingset(config, [], kernelStorage, initOpts); - commit(); + void commit(); const { runtimeOptions } = t.context.data; const c1 = await makeSwingsetController(kernelStorage, {}, runtimeOptions); @@ -82,7 +82,7 @@ test('state-sync reload', async t => { t.is(res, i); } - commit(); + void commit(); await c1.shutdown(); const exporter = makeSwingStoreExporter(dbDir); diff --git a/packages/SwingSet/test/transcript/test-transcript-entries.js b/packages/SwingSet/test/transcript/test-transcript-entries.js index 636b9a16353d..dd2aecb63c9c 100644 --- a/packages/SwingSet/test/transcript/test-transcript-entries.js +++ b/packages/SwingSet/test/transcript/test-transcript-entries.js @@ -117,12 +117,12 @@ test('transcript spans', async t => { const { commit } = hostStorage; const initOpts = { addComms: false, addVattp: false, addTimer: false }; await initializeSwingset(config, [], kernelStorage, initOpts); - commit(); + void commit(); let c; const restart = async () => { if (c) { - commit(); + void commit(); await c.shutdown(); } const { runtimeOptions } = t.context.data; diff --git a/packages/cosmic-swingset/scripts/clean-core-eval.js b/packages/cosmic-swingset/scripts/clean-core-eval.js index 5cd036e3cf3c..b982b66415f9 100755 --- a/packages/cosmic-swingset/scripts/clean-core-eval.js +++ b/packages/cosmic-swingset/scripts/clean-core-eval.js @@ -62,7 +62,7 @@ export const main = async (argv, { readFile, stdout }) => { if (isEntrypoint(import.meta.url)) { /* global process */ - farExports.E.when( + void farExports.E.when( import('fs/promises'), fsp => main([...process.argv], { diff --git a/packages/internal/src/queue.js b/packages/internal/src/queue.js index fbff279c8900..6f9e8e2d0ed8 100644 --- a/packages/internal/src/queue.js +++ b/packages/internal/src/queue.js @@ -17,7 +17,7 @@ export const makeWithQueue = () => { } const [thunk, resolve, reject] = queue[0]; // Run the thunk in a new turn. - Promise.resolve() + void Promise.resolve() .then(thunk) // Resolve or reject our caller with the thunk's value. .then(resolve, reject) diff --git a/packages/solo/public/main.js b/packages/solo/public/main.js index 291740ffb3b6..8306003dfb2d 100644 --- a/packages/solo/public/main.js +++ b/packages/solo/public/main.js @@ -266,7 +266,7 @@ function run() { commands[commands.length - 1] = inp.value; commands[commands.length] = ''; inp.value = ''; - call({ type: 'doEval', number, body: command }); + void call({ type: 'doEval', number, body: command }); } function inputKeyup(ev) { diff --git a/packages/solo/src/captp.js b/packages/solo/src/captp.js index d949a327331f..2052d954553e 100644 --- a/packages/solo/src/captp.js +++ b/packages/solo/src/captp.js @@ -43,7 +43,9 @@ export const getCapTPHandler = (send, getLocalBootstrap, fallback) => { dispatch, abort, }); - doFallback('onOpen', obj, meta); + doFallback('onOpen', obj, meta).catch(e => { + console.error(`Error in fallback onOpen`, e); + }); }, onClose(obj, meta) { console.debug(`Finishing CapTP`, meta); @@ -53,7 +55,9 @@ export const getCapTPHandler = (send, getLocalBootstrap, fallback) => { abort(); } chans.delete(meta.channelHandle); - doFallback('onClose', obj, meta); + doFallback('onClose', obj, meta).catch(e => { + console.error(`Error in fallback onClose`, e); + }); }, onError(obj, meta) { console.debug(`Error in CapTP`, meta, obj.error); @@ -62,7 +66,9 @@ export const getCapTPHandler = (send, getLocalBootstrap, fallback) => { const { abort } = chan; abort(obj.error); } - doFallback('onError', obj, meta); + doFallback('onError', obj, meta).catch(e => { + console.error(`Error in fallback onError`, e); + }); }, async onMessage(obj, meta) { console.debug('processing inbound', obj); diff --git a/packages/solo/src/chain-cosmos-sdk.js b/packages/solo/src/chain-cosmos-sdk.js index c6b287aa3609..c4f4c3342bee 100644 --- a/packages/solo/src/chain-cosmos-sdk.js +++ b/packages/solo/src/chain-cosmos-sdk.js @@ -258,7 +258,7 @@ export async function connectToChain( */ const getMailboxNotifier = () => { const { notifier, updater } = makeNotifierKit(); - retryRpcHref(async rpcHref => { + void retryRpcHref(async rpcHref => { // Every time we enter this function, we are establishing a // new websocket to a potentially different RPC server. // @@ -486,7 +486,7 @@ export async function connectToChain( waitForTxHash = subscribeAndWaitForTxHash; if (postponedTxHash) { - subscribeAndWaitForTxHash(postponedTxHash); + void subscribeAndWaitForTxHash(postponedTxHash); } subscribeToStorage(`mailbox.${clientAddr}`, (err, storageValue) => { @@ -692,15 +692,20 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress( // Wait for the transaction to be included in a block. const txHash = out.txhash; - waitForTxHash(txHash).then(txResult => { - // The result had an error code (not 0 or undefined for success). - if (txResult.code) { + waitForTxHash(txHash) + .then(txResult => { + // The result had an error code (not 0 or undefined for success). + if (txResult.code) { + // eslint-disable-next-line no-use-before-define + failedSend( + assert.error(`Error in tx processing: ${txResult.log}`), + ); + } + }) + .catch(err => // eslint-disable-next-line no-use-before-define - failedSend( - assert.error(`Error in tx processing: ${txResult.log}`), - ); - } - }); + failedSend(assert.error(`Error in tx processing: ${err}`)), + ); // We submitted the transaction to the mempool successfully. // Preemptively increment our sequence number to avoid needing to @@ -778,7 +783,7 @@ ${chainID} chain does not yet know of address ${clientAddr}${adviseEgress( updateCount || Fail`Sending unexpectedly finished!`; await sendFromMessagePool().then(successfulSend, failedSend); - recurseEachSend(updateCount); + void recurseEachSend(updateCount); }; // Begin the sender when we get the first (empty) mailbox update. diff --git a/packages/solo/src/vat-http.js b/packages/solo/src/vat-http.js index 58fb4d29fa42..70e638e6ff3d 100644 --- a/packages/solo/src/vat-http.js +++ b/packages/solo/src/vat-http.js @@ -108,7 +108,7 @@ export function buildRootObject(vatPowers) { commandDevice = d; const replHandler = getReplHandler(replObjects, send); - registerURLHandler(replHandler, '/private/repl'); + void registerURLHandler(replHandler, '/private/repl'); // Assign the captp handler. const captpHandler = Far('captpHandler', { @@ -127,7 +127,7 @@ export function buildRootObject(vatPowers) { return harden(exported); }, }); - registerURLHandler(captpHandler, '/private/captp'); + void registerURLHandler(captpHandler, '/private/captp'); }, registerURLHandler, diff --git a/packages/solo/test/captp-fixture.js b/packages/solo/test/captp-fixture.js index 999d87081b49..38632f9fd90f 100644 --- a/packages/solo/test/captp-fixture.js +++ b/packages/solo/test/captp-fixture.js @@ -109,7 +109,7 @@ export async function makeFixture(PORT, noisy = false) { // We only reject if the child exits before CapTP is established. reject(Error(`CapTP fixture exited with ${code}`)); }); - tryConnect(resolve, reject); + void tryConnect(resolve, reject); }); } diff --git a/packages/swingset-liveslots/src/liveslots.js b/packages/swingset-liveslots/src/liveslots.js index a6d6a7fe849c..63ea6dd0d50e 100644 --- a/packages/swingset-liveslots/src/liveslots.js +++ b/packages/swingset-liveslots/src/liveslots.js @@ -1602,7 +1602,7 @@ function build( // *not* directly wait for the userspace function to complete, nor for // any promise it returns to fire. const p = Promise.resolve(delivery).then(unmeteredDispatch); - p.finally(() => (complete = true)); + void p.finally(() => (complete = true)); // Instead, we wait for userspace to become idle by draining the // promise queue. We clean up and then examine/return 'p' so any diff --git a/packages/xsnap/src/xsnap.js b/packages/xsnap/src/xsnap.js index 5d605d581f2f..804b90efbb4d 100644 --- a/packages/xsnap/src/xsnap.js +++ b/packages/xsnap/src/xsnap.js @@ -152,7 +152,7 @@ export async function xsnap(options) { sourceStream.pipe(destStream, { end: false }); done = finished(sourceStream); - done.catch(noop).then(() => sourceStream.unpipe(destStream)); + done.catch(noop).then(() => sourceStream.unpipe(destStream), noop); }; return harden({ @@ -264,7 +264,7 @@ export async function xsnap(options) { loadSnapshotHandler = undefined; return cleanup(); } - }); + }, noop); } /** @type {Promise} */ @@ -458,10 +458,10 @@ export async function xsnap(options) { const handle = await fs.open(snapPath, 'w+'); // @ts-expect-error 'close' event added in Node 15.4 handle.on('close', () => { - fs.unlink(snapPath); + void fs.unlink(snapPath); }); sourceStream = handle.createReadStream(); - finished(output).finally(() => sourceStream.destroy()); + void finished(output).finally(() => sourceStream.destroy()); } else { sourceStream = snapshotSaveStream; snapPath = `@${SNAPSHOT_SAVE_FD}`; @@ -470,7 +470,7 @@ export async function xsnap(options) { // ensuring that any previous save stream usage has ended. However we // must start the flow before receiving the command's response or the // xsnap process would block on a full pipe, causing an IPC deadlock. - batonKit.promise.then(maybePipe); + batonKit.promise.then(maybePipe, noop); } const cleanup = () => { diff --git a/packages/xsnap/src/xsrepl.js b/packages/xsnap/src/xsrepl.js index 0f2e5b6f7b7a..c5c5f6cfb584 100755 --- a/packages/xsnap/src/xsrepl.js +++ b/packages/xsnap/src/xsrepl.js @@ -97,4 +97,4 @@ async function main() { return vat.close(); } -main(); +await main(); diff --git a/packages/xsnap/test/fixture-xsnap-script.js b/packages/xsnap/test/fixture-xsnap-script.js index 170883f397e2..d2c06c4e9357 100644 --- a/packages/xsnap/test/fixture-xsnap-script.js +++ b/packages/xsnap/test/fixture-xsnap-script.js @@ -1,5 +1,5 @@ /* eslint @typescript-eslint/no-floating-promises: "warn" */ /* global issueCommand */ -(async () => { +void (async () => { issueCommand(new TextEncoder().encode('Hello, World!').buffer); })();