diff --git a/packages/zoe/src/contractFacet/zcfMint.js b/packages/zoe/src/contractFacet/zcfMint.js index 7fbd2772b729..e6cf7833950e 100644 --- a/packages/zoe/src/contractFacet/zcfMint.js +++ b/packages/zoe/src/contractFacet/zcfMint.js @@ -106,7 +106,7 @@ export const prepareZcMint = ( // committed atomically, but it is not a disaster if they are // not. If we minted only, no one would ever get those // invisibly-minted assets. - E(zoeMint).mintAndEscrow(totalToMint); + void E(zoeMint).mintAndEscrow(totalToMint); reallocator.reallocate(zcfSeat, allocationPlusGains); return zcfSeat; }, @@ -143,7 +143,7 @@ export const prepareZcMint = ( // not. If we only commit the allocationMinusLosses no one would // ever get the unburned assets. reallocator.reallocate(zcfSeat, allocationMinusLosses); - E(zoeMint).withdrawAndBurn(totalToBurn); + void E(zoeMint).withdrawAndBurn(totalToBurn); }, }, ); diff --git a/packages/zoe/src/contractFacet/zcfSeat.js b/packages/zoe/src/contractFacet/zcfSeat.js index 452477c943d7..898a635c67f9 100644 --- a/packages/zoe/src/contractFacet/zcfSeat.js +++ b/packages/zoe/src/contractFacet/zcfSeat.js @@ -167,7 +167,10 @@ export const createSeatManager = ( assertActive(self); assertNoStagedAllocation(self); doExitSeat(self); - E(zoeInstanceAdmin).exitSeat(zcfSeatToSeatHandle.get(self), completion); + void E(zoeInstanceAdmin).exitSeat( + zcfSeatToSeatHandle.get(self), + completion, + ); zcfSeatToSeatHandle.delete(self); }, fail( @@ -185,7 +188,7 @@ export const createSeatManager = ( } if (!hasExited(self)) { doExitSeat(self); - E(zoeInstanceAdmin).failSeat( + void E(zoeInstanceAdmin).failSeat( zcfSeatToSeatHandle.get(self), harden(reason), ); diff --git a/packages/zoe/src/contractFacet/zcfZygote.js b/packages/zoe/src/contractFacet/zcfZygote.js index bfd7f3bffba1..49384f0b8b4d 100644 --- a/packages/zoe/src/contractFacet/zcfZygote.js +++ b/packages/zoe/src/contractFacet/zcfZygote.js @@ -78,7 +78,7 @@ export const makeZCFZygote = async ( /** @type {import('@agoric/swingset-vat').ShutdownWithFailure} */ const shutdownWithFailure = reason => { - E(zoeInstanceAdmin).failAllSeats(reason); + void E(zoeInstanceAdmin).failAllSeats(reason); seatManager.dropAllReferences(); // https://github.com/Agoric/agoric-sdk/issues/3239 powers.exitVatWithFailure(reason); @@ -114,7 +114,7 @@ export const makeZCFZygote = async ( const zcfSeat = seatManager.makeZCFSeat(seatData); const exiter = makeExiter(seatData.proposal, zcfSeat); - E(zoeInstanceAdmin) + void E(zoeInstanceAdmin) .makeNoEscrowSeat(initialAllocation, proposal, exiter, seatHandle) .then(userSeat => userSeatPromiseKit.resolve(userSeat)); @@ -326,7 +326,7 @@ export const makeZCFZygote = async ( }, // Shutdown the entire vat and give payouts shutdown: completion => { - E(zoeInstanceAdmin).exitAllSeats(completion); + void E(zoeInstanceAdmin).exitAllSeats(completion); seatManager.dropAllReferences(); powers.exitVat(completion); }, diff --git a/packages/zoe/src/contractSupport/priceAuthority.js b/packages/zoe/src/contractSupport/priceAuthority.js index ba779438a940..75c454a55e6b 100644 --- a/packages/zoe/src/contractSupport/priceAuthority.js +++ b/packages/zoe/src/contractSupport/priceAuthority.js @@ -199,7 +199,7 @@ export const makeOnewayPriceAuthorityKit = opts => { ); amountIn = coercedAmountIn; amountOutLimit = coercedAmountOutLimit; - fireTriggers(createQuote); + void fireTriggers(createQuote); }, getPromise: () => triggerPK.promise, }); diff --git a/packages/zoe/src/contractSupport/priceAuthorityInitial.js b/packages/zoe/src/contractSupport/priceAuthorityInitial.js index 30bf50381582..110c5affc9bb 100644 --- a/packages/zoe/src/contractSupport/priceAuthorityInitial.js +++ b/packages/zoe/src/contractSupport/priceAuthorityInitial.js @@ -104,7 +104,7 @@ export const makeInitialTransform = ( assert.equal(bOut, brandOut); const quoteP = E(priceAuthority).quoteGiven(amountIn, brandOut); - quoteP.then(() => (initialMode = false)); + void quoteP.then(() => (initialMode = false)); return initialMode ? mintCurrentQuote(amountIn, multiplyBy(amountIn, priceOutPerIn)) : quoteP; diff --git a/packages/zoe/src/contractSupport/zoeHelpers.js b/packages/zoe/src/contractSupport/zoeHelpers.js index 01c38791321a..74c4b683a6e0 100644 --- a/packages/zoe/src/contractSupport/zoeHelpers.js +++ b/packages/zoe/src/contractSupport/zoeHelpers.js @@ -365,7 +365,7 @@ export const offerTo = async ( depositedPromiseKit.resolve(mappedAmounts); }; - E(userSeatPromise).getPayouts().then(doDeposit); + void E(userSeatPromise).getPayouts().then(doDeposit); // TODO rename return key; userSeatPromise is a remote UserSeat return harden({ userSeatPromise, deposited: depositedPromiseKit.promise }); diff --git a/packages/zoe/src/contracts/auction/index.js b/packages/zoe/src/contracts/auction/index.js index cfeed7ca0b96..149699f2c7c1 100644 --- a/packages/zoe/src/contracts/auction/index.js +++ b/packages/zoe/src/contracts/auction/index.js @@ -127,8 +127,7 @@ const start = zcf => { }); assertBidSeat(zcf, sellSeat, seat); - // XXX await make function hanging - startWakeupTimerIfNeeded(); + void startWakeupTimerIfNeeded(); bidSeats.push(seat); return defaultAcceptanceMsg; diff --git a/packages/zoe/src/contracts/callSpread/payoffHandler.js b/packages/zoe/src/contracts/callSpread/payoffHandler.js index 40b854dec8ef..e8b6619e443e 100644 --- a/packages/zoe/src/contracts/callSpread/payoffHandler.js +++ b/packages/zoe/src/contracts/callSpread/payoffHandler.js @@ -40,7 +40,7 @@ function makePayoffHandler(zcf, seatPromiseKits, collateralSeat) { } function reallocateToSeat(seatPromise, seatPortion) { - E.when(seatPromise, seat => { + void E.when(seatPromise, seat => { atomicTransfer(zcf, collateralSeat, seat, { Collateral: seatPortion }); seat.exit(); seatsExited += 1; diff --git a/packages/zoe/src/contracts/callSpread/pricedCallSpread.js b/packages/zoe/src/contracts/callSpread/pricedCallSpread.js index 451170bb31de..929a2c0da4ff 100644 --- a/packages/zoe/src/contracts/callSpread/pricedCallSpread.js +++ b/packages/zoe/src/contracts/callSpread/pricedCallSpread.js @@ -81,7 +81,7 @@ const start = zcf => { 'strikePrice2 must be greater than strikePrice1', ); - zcf.saveIssuer(zcf.getInvitationIssuer(), 'Options'); + void zcf.saveIssuer(zcf.getInvitationIssuer(), 'Options'); // We will create the two options early and allocate them to this seat. const { zcfSeat: collateralSeat } = zcf.makeEmptySeatKit(); diff --git a/packages/zoe/src/contracts/loan/scheduleLiquidation.js b/packages/zoe/src/contracts/loan/scheduleLiquidation.js index 8d61a9f6e85a..6ec50838cb12 100644 --- a/packages/zoe/src/contracts/loan/scheduleLiquidation.js +++ b/packages/zoe/src/contracts/loan/scheduleLiquidation.js @@ -44,7 +44,7 @@ export const scheduleLiquidation = (zcf, configWithBorrower) => { const currentCollateral = collateralSeat.getAmountAllocated('Collateral'); if (AmountMath.isEqual(amountIn, currentCollateral)) { liquidationPromiseKit.resolve(priceQuote); - liquidate(zcf, configWithBorrower); + void liquidate(zcf, configWithBorrower); } }) .catch(err => { diff --git a/packages/zoe/src/contracts/oracle.js b/packages/zoe/src/contracts/oracle.js index 17f91caa8e19..a15bcc11184a 100644 --- a/packages/zoe/src/contracts/oracle.js +++ b/packages/zoe/src/contracts/oracle.js @@ -75,7 +75,7 @@ const start = async zcf => { Fail`Oracle required a fee but the query had none`; return reply; } catch (e) { - E(handler).onError(query, e); + void E(handler).onError(query, e); throw e; } }, @@ -91,10 +91,10 @@ const start = async zcf => { atomicTransfer(zcf, querySeat, feeSeat, { Fee: requiredFee }); } querySeat.exit(); - E(handler).onReply(query, reply, requiredFee); + void E(handler).onReply(query, reply, requiredFee); return reply; } catch (e) { - E(handler).onError(query, e); + void E(handler).onError(query, e); throw e; } }; diff --git a/packages/zoe/src/contracts/priceAggregator.js b/packages/zoe/src/contracts/priceAggregator.js index 9d0ad6a39048..81be2fb4ecf0 100644 --- a/packages/zoe/src/contracts/priceAggregator.js +++ b/packages/zoe/src/contracts/priceAggregator.js @@ -159,7 +159,7 @@ const start = async (zcf, privateArgs) => { await Promise.all(querierPs).catch(console.error); }, }); - E(repeaterP).schedule(waker); + void E(repeaterP).schedule(waker); /** * @param {object} param0 @@ -231,17 +231,20 @@ const start = async (zcf, privateArgs) => { }); // for each new quote from the priceAuthority, publish it to off-chain storage - observeNotifier(priceAuthority.makeQuoteNotifier(unitAmountIn, brandOut), { - updateState: quote => { - publisher.publish(priceDescriptionFromQuote(quote)); - }, - fail: reason => { - throw Error(`priceAuthority observer failed: ${reason}`); - }, - finish: done => { - throw Error(`priceAuthority observer died: ${done}`); + void observeNotifier( + priceAuthority.makeQuoteNotifier(unitAmountIn, brandOut), + { + updateState: quote => { + publisher.publish(priceDescriptionFromQuote(quote)); + }, + fail: reason => { + throw Error(`priceAuthority observer failed: ${reason}`); + }, + finish: done => { + throw Error(`priceAuthority observer died: ${done}`); + }, }, - }); + ); /** * @param {Ratio} r @@ -388,7 +391,7 @@ const start = async (zcf, privateArgs) => { return; } // Queue the next update. - E(oracleNotifier).getUpdateSince(updateCount).then(recurse); + void E(oracleNotifier).getUpdateSince(updateCount).then(recurse); // See if we have associated parameters or just a raw value. /** @type {Ratio | undefined} */ @@ -424,7 +427,7 @@ const start = async (zcf, privateArgs) => { }; // Start the notifier. - E(oracleNotifier).getUpdateSince().then(recurse); + void E(oracleNotifier).getUpdateSince().then(recurse); }; const creatorFacet = Far('PriceAggregatorCreatorFacet', { @@ -463,7 +466,7 @@ const start = async (zcf, privateArgs) => { assertParsableNumber(price); return zcf.makeInvitation(cSeat => { cSeat.exit(); - admin.pushResult(price); + void admin.pushResult(price); }, 'PushPrice'); }, }); diff --git a/packages/zoe/src/contracts/sellItems.js b/packages/zoe/src/contracts/sellItems.js index 5aa7a7574094..c4dd855922cd 100644 --- a/packages/zoe/src/contracts/sellItems.js +++ b/packages/zoe/src/contracts/sellItems.js @@ -52,7 +52,7 @@ const start = zcf => { const sell = seat => { sellerSeat = seat; - observeIteration( + void observeIteration( subscribeLatest(sellerSeat.getSubscriber()), harden({ updateState: sellerSeatAllocation => diff --git a/packages/zoe/src/zoeService/instanceAdminStorage.js b/packages/zoe/src/zoeService/instanceAdminStorage.js index ab6b9da38e4e..75061fc4aeb4 100644 --- a/packages/zoe/src/zoeService/instanceAdminStorage.js +++ b/packages/zoe/src/zoeService/instanceAdminStorage.js @@ -178,7 +178,7 @@ const makeInstanceAdminBehavior = (zoeBaggage, makeZoeSeatAdminKit) => { state.zoeSeatAdmins.add(zoeSeatAdmin); state.handleOfferObj || Fail`incomplete setup of zoe seat`; - E.when( + void E.when( E(state.handleOfferObj).handleOffer(invitationHandle, seatData), /** @param {HandleOfferResult} result */ result => zoeSeatAdmin.resolveExitAndResult(result), diff --git a/packages/zoe/src/zoeService/originalZoeSeat.js b/packages/zoe/src/zoeService/originalZoeSeat.js index 68a2ed2d92fa..7970d07ec5b7 100644 --- a/packages/zoe/src/zoeService/originalZoeSeat.js +++ b/packages/zoe/src/zoeService/originalZoeSeat.js @@ -169,7 +169,7 @@ export const declareOldZoeSeatAdminKind = (baggage, makeDurablePublishKit) => { assertHasNotExited(this, 'Cannot exit seat. Seat has already exited'); state.exiting = true; - E.when( + void E.when( doExit( facets.zoeSeatAdmin, state.currentAllocation, @@ -190,7 +190,7 @@ export const declareOldZoeSeatAdminKind = (baggage, makeDurablePublishKit) => { assertHasNotExited(this, 'Cannot fail seat. Seat has already exited'); state.exiting = true; - E.when( + void E.when( doExit( facets.zoeSeatAdmin, state.currentAllocation, diff --git a/packages/zoe/src/zoeService/zoeSeat.js b/packages/zoe/src/zoeService/zoeSeat.js index 31abb4aa8c84..926537792df3 100644 --- a/packages/zoe/src/zoeService/zoeSeat.js +++ b/packages/zoe/src/zoeService/zoeSeat.js @@ -228,7 +228,7 @@ export const makeZoeSeatAdminFactory = baggage => { ); state.exiting = true; - E.when( + void E.when( doExit( facets.zoeSeatAdmin, state.currentAllocation, diff --git a/packages/zoe/test/swingsetTests/brokenContracts/crashingContract.test.js b/packages/zoe/test/swingsetTests/brokenContracts/crashingContract.test.js index eb42b4b63ec2..806527aa9a4b 100644 --- a/packages/zoe/test/swingsetTests/brokenContracts/crashingContract.test.js +++ b/packages/zoe/test/swingsetTests/brokenContracts/crashingContract.test.js @@ -59,10 +59,10 @@ const throwInAPILog = [ '=> alice is set up', '=> alice.doThrowInApiCall called', 'counter: 3', + 'Swap outcome is an invitation (true).', 'throwingAPI should throw Error: someException', 'counter: 5', 'counter: 6', - 'Swap outcome is an invitation (true).', 'newCounter: 2', 'counter: 7', 'outcome correctly resolves: "The offer has been accepted. Once the contract has been completed, please check your payout"', diff --git a/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js b/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js index da1a5ee37378..8d8cc1673042 100644 --- a/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js +++ b/packages/zoe/test/swingsetTests/brokenContracts/vat-alice.js @@ -1,5 +1,4 @@ // @ts-nocheck -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; @@ -42,7 +41,7 @@ const build = async (log, zoe, issuers, payments, installations) => { }); const alicePayments = { Asset: moolaPayment }; - logCounter(log, publicFacet); + await logCounter(log, publicFacet); const invitation = await E(publicFacet).makeThrowingInvitation(); const seat = await E(zoe).offer(invitation, proposal, alicePayments); @@ -52,7 +51,7 @@ const build = async (log, zoe, issuers, payments, installations) => { () => assert(false, ' expected outcome to fail'), e => log(`outcome correctly resolves to broken: ${e}`), ); - logCounter(log, publicFacet); + await logCounter(log, publicFacet); const moolaPayout = await E(seat).getPayout('Asset'); const simoleanPayout = await E(seat).getPayout('Price'); @@ -60,7 +59,7 @@ const build = async (log, zoe, issuers, payments, installations) => { await E(simoleanPurseP).deposit(simoleanPayout); await showPurseBalance(moolaPurseP, 'aliceMoolaPurse', log); await showPurseBalance(simoleanPurseP, 'aliceSimoleanPurse', log); - logCounter(log, publicFacet); + await logCounter(log, publicFacet); // zoe should still be able to make new vats. const { publicFacet: publicFacet2 } = await E(zoe).startInstance( @@ -87,9 +86,9 @@ const build = async (log, zoe, issuers, payments, installations) => { E(newPurse).deposit(swapMoolaPayout); E(simoleanPurseP).deposit(swapSimoleanPayout); - showPurseBalance(newPurse, 'new Purse', log); - showPurseBalance(simoleanPurseP, 'aliceSimoleanPurse', log); - logCounter(log, publicFacet); + await showPurseBalance(newPurse, 'new Purse', log); + await showPurseBalance(simoleanPurseP, 'aliceSimoleanPurse', log); + await logCounter(log, publicFacet); }; const doThrowInApiCall = async () => { @@ -124,7 +123,7 @@ const build = async (log, zoe, issuers, payments, installations) => { .getOfferResult() .then( o => { - E(invitationIssuer) + return E(invitationIssuer) .isLive(o) .then(val => { swapInvitationTwo = o; @@ -133,7 +132,7 @@ const build = async (log, zoe, issuers, payments, installations) => { }, e => assert(false, X`expected outcome not to resolve yet ${e}`), ); - logCounter(log, publicFacet); + await logCounter(log, publicFacet); E(publicFacet) .throwSomething() @@ -141,10 +140,10 @@ const build = async (log, zoe, issuers, payments, installations) => { () => assert(false, 'expecting this to throw'), e => log(`throwingAPI should throw ${e}`), ); - logCounter(log, publicFacet); + await logCounter(log, publicFacet); // These should not resolve at this point, the funds are still escrowed - E(swapSeat) + void E(swapSeat) .getPayouts() .then(async swapPayout => { const moolaSwapPayout = await swapPayout.Asset; @@ -157,7 +156,7 @@ const build = async (log, zoe, issuers, payments, installations) => { }); // show that the contract is still responsive. - logCounter(log, publicFacet); + await logCounter(log, publicFacet); // zoe should still be able to make new vats. const { publicFacet: publicFacet2 } = await E(zoe).startInstance( @@ -178,7 +177,7 @@ const build = async (log, zoe, issuers, payments, installations) => { swapTwoProposal, aliceSwapTwoPayments, ); - logCounter(log, publicFacet); + await logCounter(log, publicFacet); E(swapSeatTwo) .getOfferResult() diff --git a/packages/zoe/test/types.test-d.ts b/packages/zoe/test/types.test-d.ts index 517f2ae3ee2c..cb4098079fed 100644 --- a/packages/zoe/test/types.test-d.ts +++ b/packages/zoe/test/types.test-d.ts @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ /** * @file uses .ts syntax to be able to declare types (e.g. of kit.creatorFacet as {}) * because "there is no JavaScript syntax for passing a a type argument" @@ -93,7 +92,7 @@ const mock = null as any; // XXX remote method requires E() const pf1 = await zoe.getPublicFacet(instance); - pf1.getPriceAuthority(); + void pf1.getPriceAuthority(); // @ts-expect-error pf1.notInPublicFacet; @@ -101,7 +100,7 @@ const mock = null as any; rf.getPublicFacet; const pf2 = await E(zoe).getPublicFacet(instance); - pf2.getPriceAuthority(); + void pf2.getPriceAuthority(); // @ts-expect-error pf2.notInPublicFacet; } diff --git a/packages/zoe/test/unitTests/contracts/atomicSwap.test.js b/packages/zoe/test/unitTests/contracts/atomicSwap.test.js index 0d05695ddb0e..ae03d3a71556 100644 --- a/packages/zoe/test/unitTests/contracts/atomicSwap.test.js +++ b/packages/zoe/test/unitTests/contracts/atomicSwap.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import path from 'path'; @@ -218,7 +217,7 @@ test('zoe - non-fungible atomicSwap', async t => { const seat = await E(zoe).offer(firstInvitation, proposal, payments); - seat + void seat .getPayout('Asset') .then(payment => ccPurse.deposit(payment)) .then(amountDeposited => @@ -229,7 +228,7 @@ test('zoe - non-fungible atomicSwap', async t => { ), ); - seat + void seat .getPayout('Price') .then(payment => rpgPurse.deposit(payment)) .then(amountDeposited => @@ -442,7 +441,7 @@ test('zoe - atomicSwap like-for-like', async t => { ); // Alice didn't get any of what Alice put in - assertAmountsEqual( + await assertAmountsEqual( t, await moolaIssuer.getAmountOf(aliceAssetPayout), moola(0n), diff --git a/packages/zoe/test/unitTests/contracts/coveredCall.test.js b/packages/zoe/test/unitTests/contracts/coveredCall.test.js index d88810be8779..6a6d6f788bc8 100644 --- a/packages/zoe/test/unitTests/contracts/coveredCall.test.js +++ b/packages/zoe/test/unitTests/contracts/coveredCall.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import path from 'path'; @@ -784,7 +783,11 @@ test('zoe - coveredCall with coveredCall for invitation', async t => { t.is(daveOptionValue.installation, coveredCallInstallation); t.is(daveOptionValue.description, 'exerciseOption'); - assertAmountsEqual(t, daveCustomDetails.strikePrice.StrikePrice, bucks(1n)); + await assertAmountsEqual( + t, + daveCustomDetails.strikePrice.StrikePrice, + bucks(1n), + ); t.deepEqual(daveCustomDetails.expirationDate, toTS(100n)); t.deepEqual(daveCustomDetails.timeAuthority, timer); @@ -798,7 +801,7 @@ test('zoe - coveredCall with coveredCall for invitation', async t => { .expirationDate, toTS(100n), ); - assertAmountsEqual( + await assertAmountsEqual( t, daveCustomDetails.underlyingAssets.UnderlyingAsset.value[0].customDetails .strikePrice.StrikePrice, @@ -1002,12 +1005,12 @@ test('zoe - coveredCall non-fungible', async t => { t.is(optionValue.installation, coveredCallInstallation); t.is(optionValue.description, 'exerciseOption'); - assertAmountsEqual( + await assertAmountsEqual( t, customDetails.underlyingAssets.UnderlyingAsset, growlTigerAmount, ); - assertAmountsEqual( + await assertAmountsEqual( t, customDetails.strikePrice.StrikePrice, aGloriousShieldAmount, diff --git a/packages/zoe/test/unitTests/contracts/loan/borrow.test.js b/packages/zoe/test/unitTests/contracts/loan/borrow.test.js index f393a48a1cd6..5869457a4d83 100644 --- a/packages/zoe/test/unitTests/contracts/loan/borrow.test.js +++ b/packages/zoe/test/unitTests/contracts/loan/borrow.test.js @@ -1,5 +1,4 @@ // @ts-nocheck -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { AmountMath } from '@agoric/ertp'; @@ -148,7 +147,7 @@ test('borrow not enough collateral', async t => { // collateral is 0 const { borrowSeat, borrowFacet } = await setupBorrowFacet(0n); // Sink unhandled rejection - E.when( + void E.when( borrowFacet, () => {}, () => {}, @@ -181,13 +180,13 @@ test('borrow getDebtNotifier', async t => { const { borrowFacet, maxLoan } = await setupBorrowFacet(); const debtNotifier = await E(borrowFacet).getDebtNotifier(); const state = await debtNotifier.getUpdateSince(); - assertAmountsEqual(t, state.value, maxLoan); + await assertAmountsEqual(t, state.value, maxLoan); }); test('borrow getRecentCollateralAmount', async t => { const { borrowFacet, collateral } = await setupBorrowFacet(); const collateralAmount = await E(borrowFacet).getRecentCollateralAmount(); - assertAmountsEqual(t, collateralAmount, collateral); + await assertAmountsEqual(t, collateralAmount, collateral); }); test('borrow getLiquidationPromise', async t => { @@ -211,8 +210,8 @@ test('borrow getLiquidationPromise', async t => { const { quoteAmount, quotePayment } = await liquidationPromise; const quoteAmount2 = await E(quoteIssuer).getAmountOf(quotePayment); - assertAmountsEqual(t, quoteAmount, quoteAmount2); - assertAmountsEqual( + await assertAmountsEqual(t, quoteAmount, quoteAmount2); + await assertAmountsEqual( t, quoteAmount, AmountMath.make( @@ -275,8 +274,8 @@ test('borrow, then addCollateral, then getLiquidationPromise', async t => { const quoteBrand = await E(quoteIssuer).getBrand(); - assertAmountsEqual(t, quoteAmount, quoteAmount2); - assertAmountsEqual( + await assertAmountsEqual(t, quoteAmount, quoteAmount2); + await assertAmountsEqual( t, quoteAmount, AmountMath.make( @@ -317,13 +316,13 @@ test('getDebtNotifier with interest', async t => { const { value: originalDebt, updateCount } = await E(debtNotifier).getUpdateSince(); - assertAmountsEqual(t, originalDebt, maxLoan); + await assertAmountsEqual(t, originalDebt, maxLoan); periodUpdater.updateState(6n); const { value: debtCompounded1, updateCount: updateCount1 } = await E(debtNotifier).getUpdateSince(updateCount); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded1, AmountMath.make(loanKit.brand, 40020n), @@ -333,7 +332,7 @@ test('getDebtNotifier with interest', async t => { const { value: debtCompounded2 } = await E(debtNotifier).getUpdateSince(updateCount1); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded2, AmountMath.make(loanKit.brand, 40041n), @@ -371,7 +370,7 @@ test('borrow collateral just too low', async t => { await setupBorrowFacet(74n); // Sink unhandled rejection - E.when( + void E.when( borrowFacetBad, () => {}, () => {}, @@ -392,13 +391,13 @@ test('aperiodic interest', async t => { const { value: originalDebt, updateCount } = await E(debtNotifier).getUpdateSince(); - assertAmountsEqual(t, originalDebt, maxLoan); + await assertAmountsEqual(t, originalDebt, maxLoan); periodUpdater.updateState(6n); const { value: debtCompounded1, updateCount: updateCount1 } = await E(debtNotifier).getUpdateSince(updateCount); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded1, AmountMath.make(loanKit.brand, 40020n), @@ -411,7 +410,7 @@ test('aperiodic interest', async t => { const { value: debtCompounded2, updateCount: updateCount2 } = await E(debtNotifier).getUpdateSince(updateCount1); t.deepEqual(await E(borrowFacet).getLastCalculationTimestamp(), toTS(16n)); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded2, AmountMath.make(loanKit.brand, 40062n), @@ -420,7 +419,7 @@ test('aperiodic interest', async t => { periodUpdater.updateState(21n); const { value: debtCompounded3 } = await E(debtNotifier).getUpdateSince(updateCount2); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded3, AmountMath.make(loanKit.brand, 40083n), @@ -488,7 +487,7 @@ test('short periods', async t => { const { value: originalDebt, updateCount } = await E(debtNotifier).getUpdateSince(); - assertAmountsEqual(t, originalDebt, maxLoan); + await assertAmountsEqual(t, originalDebt, maxLoan); periodUpdater.updateState(5n); t.deepEqual(await E(borrowFacet).getLastCalculationTimestamp(), toTS(1n)); @@ -496,7 +495,7 @@ test('short periods', async t => { periodUpdater.updateState(9n); const { value: debtCompounded1, updateCount: updateCount1 } = await E(debtNotifier).getUpdateSince(updateCount); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded1, AmountMath.make(loanKit.brand, 40020n), @@ -506,7 +505,7 @@ test('short periods', async t => { periodUpdater.updateState(14n); const { value: debtCompounded2, updateCount: updateCount2 } = await E(debtNotifier).getUpdateSince(updateCount1); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded2, AmountMath.make(loanKit.brand, 40041n), @@ -516,7 +515,7 @@ test('short periods', async t => { periodUpdater.updateState(17n); const { value: debtCompounded3, updateCount: updateCount3 } = await E(debtNotifier).getUpdateSince(updateCount2); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded3, AmountMath.make(loanKit.brand, 40062n), @@ -526,7 +525,7 @@ test('short periods', async t => { periodUpdater.updateState(21n); const { value: debtCompounded4, updateCount: updateCount4 } = await E(debtNotifier).getUpdateSince(updateCount3); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded4, AmountMath.make(loanKit.brand, 40083n), @@ -539,7 +538,7 @@ test('short periods', async t => { periodUpdater.updateState(29n); const { value: debtCompounded5 } = await E(debtNotifier).getUpdateSince(updateCount4); - assertAmountsEqual( + await assertAmountsEqual( t, debtCompounded5, AmountMath.make(loanKit.brand, 40104n), diff --git a/packages/zoe/test/unitTests/contracts/loan/helpers.js b/packages/zoe/test/unitTests/contracts/loan/helpers.js index b954a86791b9..74df0dadd927 100644 --- a/packages/zoe/test/unitTests/contracts/loan/helpers.js +++ b/packages/zoe/test/unitTests/contracts/loan/helpers.js @@ -1,5 +1,4 @@ // @ts-nocheck -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import '@agoric/swingset-liveslots/tools/prepare-test-env.js'; import path from 'path'; @@ -80,7 +79,7 @@ export const checkPayouts = async ( const kit = kitKeywordRecord[keyword]; const amount = await kit.issuer.getAmountOf(paymentP); const expected = expectedKeywordRecord[keyword]; - assertAmountsEqual(t, amount, expected); + await assertAmountsEqual(t, amount, expected); t.truthy( AmountMath.isEqual(amount, expected), `amount value: ${amount.value}, expected value: ${expected.value}, message: ${message}`, diff --git a/packages/zoe/test/unitTests/contracts/priceAggregator.test.js b/packages/zoe/test/unitTests/contracts/priceAggregator.test.js index 004fdadeffe0..dc8282c77546 100644 --- a/packages/zoe/test/unitTests/contracts/priceAggregator.test.js +++ b/packages/zoe/test/unitTests/contracts/priceAggregator.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test as unknownTest } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import path from 'path'; @@ -618,7 +617,13 @@ test('quoteAtTime', async t => { /** @type {PriceQuote | undefined} */ let priceQuote; - t.notThrowsAsync(quoteAtTime.then(result => (priceQuote = result))); + + // t.notThrowsAsync() returns a floating promise. We can't await here, because the quote won't be produced until time + // ticks on. Save the promises, and ensure they resolve before the test finishes. + const results = []; + results.push( + t.notThrowsAsync(quoteAtTime.then(result => (priceQuote = result))), + ); /** @type {PromiseRecord} */ const userQuotePK = makePromiseKit(); @@ -637,7 +642,9 @@ test('quoteAtTime', async t => { /** @type {PriceQuote | undefined} */ let userPriceQuote; - t.notThrowsAsync(quoteAtUserTime.then(result => (userPriceQuote = result))); + results.push( + t.notThrowsAsync(quoteAtUserTime.then(result => (userPriceQuote = result))), + ); await E(aggregator.creatorFacet).initOracle(price1000.instance, { increment: 10n, @@ -701,6 +708,7 @@ test('quoteAtTime', async t => { t.deepEqual(timestamp, toTS(7n)); t.is(amountIn.value, 41n); t.is(amountOut.value / 41n, 960n); + await Promise.all(results); }); test('quoteWhen', async t => { @@ -732,7 +740,12 @@ test('quoteWhen', async t => { /** @type {PriceQuote | undefined} */ let abovePriceQuote; - t.notThrowsAsync(quoteWhenGTE.then(result => (abovePriceQuote = result))); + // t.notThrowsAsync() returns a floating promise. We can't await here, because the quote won't be produced until time + // ticks on. Save the promises, and ensure they resolve before the test finishes. + const results = []; + results.push( + t.notThrowsAsync(quoteWhenGTE.then(result => (abovePriceQuote = result))), + ); const quoteWhenLTE = E(pa).quoteWhenLTE( AmountMath.make(brandIn, 29n), AmountMath.make(brandOut, 974n * 29n), @@ -740,7 +753,9 @@ test('quoteWhen', async t => { /** @type {PriceQuote | undefined} */ let belowPriceQuote; - t.notThrowsAsync(quoteWhenLTE.then(result => (belowPriceQuote = result))); + results.push( + t.notThrowsAsync(quoteWhenLTE.then(result => (belowPriceQuote = result))), + ); await E(aggregator.creatorFacet).initOracle(price1000.instance, { increment: 10n, @@ -813,6 +828,8 @@ test('quoteWhen', async t => { t.deepEqual(belowTimestamp, toTS(6n)); t.is(belowIn.value, 29n); t.is(belowOut.value / 29n, 960n); + + await Promise.all(results); }); test('mutableQuoteWhen no replacement', async t => { @@ -844,7 +861,14 @@ test('mutableQuoteWhen no replacement', async t => { /** @type {PriceQuote | undefined} */ let abovePriceQuote; const abovePriceQuoteP = E(mutableQuoteWhenGTE).getPromise(); - t.notThrowsAsync(abovePriceQuoteP.then(result => (abovePriceQuote = result))); + // t.notThrowsAsync() returns a floating promise. We can't await here, because the quote won't be produced until time + // ticks on. Save the promises, and ensure they resolve before the test finishes. + const results = []; + results.push( + t.notThrowsAsync( + abovePriceQuoteP.then(result => (abovePriceQuote = result)), + ), + ); const mutableQuoteWhenLTE = E(pa).mutableQuoteWhenLTE( AmountMath.make(brandIn, 29n), @@ -854,7 +878,11 @@ test('mutableQuoteWhen no replacement', async t => { /** @type {PriceQuote | undefined} */ let belowPriceQuote; const belowPriceQuoteP = E(mutableQuoteWhenLTE).getPromise(); - t.notThrowsAsync(belowPriceQuoteP.then(result => (belowPriceQuote = result))); + results.push( + t.notThrowsAsync( + belowPriceQuoteP.then(result => (belowPriceQuote = result)), + ), + ); await E(aggregator.creatorFacet).initOracle(price1000.instance, { increment: 10n, @@ -931,6 +959,8 @@ test('mutableQuoteWhen no replacement', async t => { t.deepEqual(belowTimestamp, TimeMath.coerceTimestampRecord(6n, timerBrand)); t.is(belowIn.value, 29n); t.is(belowOut.value / 29n, 960n); + + await Promise.all(results); }); test('mutableQuoteWhen with update', async t => { @@ -961,7 +991,11 @@ test('mutableQuoteWhen with update', async t => { /** @type {PriceQuote | undefined} */ let abovePriceQuote; const abovePriceQuoteP = E(mutableQuoteWhenGTE).getPromise(); - t.notThrowsAsync(abovePriceQuoteP.then(result => (abovePriceQuote = result))); + // t.notThrowsAsync() returns a floating promise. We can't await here, because the quote won't be produced until time + // ticks on. Save the promises, and ensure they resolve before the test finishes. + const results = t.notThrowsAsync( + abovePriceQuoteP.then(result => (abovePriceQuote = result)), + ); await E(aggregator.creatorFacet).initOracle(price1200.instance, { increment: 10n, @@ -1001,6 +1035,7 @@ test('mutableQuoteWhen with update', async t => { t.deepEqual(aboveTimestamp, toTS(4n)); t.is(aboveIn.value, 25n); t.is(aboveOut.value / 25n, 1250n); + await results; }); test('cancel mutableQuoteWhen', async t => { diff --git a/packages/zoe/test/unitTests/fakePriceAuthority.test.js b/packages/zoe/test/unitTests/fakePriceAuthority.test.js index 1f24594e29bf..12150ed6620d 100644 --- a/packages/zoe/test/unitTests/fakePriceAuthority.test.js +++ b/packages/zoe/test/unitTests/fakePriceAuthority.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { E } from '@endo/eventual-send'; @@ -42,8 +41,8 @@ test('priceAuthority quoteAtTime', async t => { const done = E(priceAuthority) .quoteAtTime(toTS(2n), moola(5n), bucksBrand) .then(async quote => { - assertAmountsEqual(t, moola(5n), getAmountIn(quote)); - assertAmountsEqual(t, bucks(55n * 5n), getAmountOut(quote)); + await assertAmountsEqual(t, moola(5n), getAmountIn(quote)); + await assertAmountsEqual(t, bucks(55n * 5n), getAmountOut(quote)); t.deepEqual(toTS(2n), getTimestamp(quote)); }); @@ -89,8 +88,8 @@ test('priceAuthority quoteWanted', async t => { const quote = await E(priceAuthority).quoteWanted(moolaBrand, bucks(400n)); const quoteAmount = quote.quoteAmount.value[0]; t.deepEqual(toTS(1n), quoteAmount.timestamp); - assertAmountsEqual(t, bucks(400n), quoteAmount.amountOut); - assertAmountsEqual(t, moola(20n), quoteAmount.amountIn); + await assertAmountsEqual(t, bucks(400n), quoteAmount.amountOut); + await assertAmountsEqual(t, moola(20n), quoteAmount.amountIn); }); test('priceAuthority paired quotes', async t => { @@ -112,14 +111,14 @@ test('priceAuthority paired quotes', async t => { const quoteOut = await E(priceAuthority).quoteWanted(moolaBrand, bucks(400n)); const quoteOutAmount = quoteOut.quoteAmount.value[0]; t.deepEqual(toTS(1n), quoteOutAmount.timestamp); - assertAmountsEqual(t, bucks(400n), quoteOutAmount.amountOut); - assertAmountsEqual(t, moola(20n), quoteOutAmount.amountIn); + await assertAmountsEqual(t, bucks(400n), quoteOutAmount.amountOut); + await assertAmountsEqual(t, moola(20n), quoteOutAmount.amountIn); const quoteIn = await E(priceAuthority).quoteGiven(moola(22n), bucksBrand); const quoteInAmount = quoteIn.quoteAmount.value[0]; t.deepEqual(toTS(1n), quoteInAmount.timestamp); - assertAmountsEqual(t, bucks(20n * 22n), quoteInAmount.amountOut); - assertAmountsEqual(t, moola(22n), quoteInAmount.amountIn); + await assertAmountsEqual(t, bucks(20n * 22n), quoteInAmount.amountOut); + await assertAmountsEqual(t, moola(22n), quoteInAmount.amountIn); }); test('priceAuthority quoteWhenGTE', async t => { @@ -132,14 +131,14 @@ test('priceAuthority quoteWhenGTE', async t => { manualTimer, ); - E(priceAuthority) + const result = E(priceAuthority) .quoteWhenGTE(moola(1n), bucks(40n)) - .then(quote => { + .then(async quote => { const quoteInAmount = quote.quoteAmount.value[0]; t.deepEqual(toTS(4n), manualTimer.getCurrentTimestamp()); t.deepEqual(toTS(4n), quoteInAmount.timestamp); - assertAmountsEqual(t, bucks(40n), quoteInAmount.amountOut); - assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); + await assertAmountsEqual(t, bucks(40n), quoteInAmount.amountOut); + await assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); }); await E(manualTimer).tick(); @@ -147,6 +146,7 @@ test('priceAuthority quoteWhenGTE', async t => { await E(manualTimer).tick(); await E(manualTimer).tick(); await E(manualTimer).tick(); + await result; }); test('priceAuthority quoteWhenLT', async t => { @@ -159,20 +159,22 @@ test('priceAuthority quoteWhenLT', async t => { manualTimer, ); - E(priceAuthority) + const result = E(priceAuthority) .quoteWhenLT(moola(1n), bucks(30n)) - .then(quote => { + .then(async quote => { const quoteInAmount = quote.quoteAmount.value[0]; t.deepEqual(toTS(3n), manualTimer.getCurrentTimestamp()); t.deepEqual(toTS(3n), quoteInAmount.timestamp); - assertAmountsEqual(t, bucks(29n), quoteInAmount.amountOut); - assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); + await assertAmountsEqual(t, bucks(29n), quoteInAmount.amountOut); + await assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); }); await E(manualTimer).tick(); await E(manualTimer).tick(); await E(manualTimer).tick(); await E(manualTimer).tick(); + + await result; }); test('priceAuthority quoteWhenGT', async t => { @@ -185,20 +187,21 @@ test('priceAuthority quoteWhenGT', async t => { manualTimer, ); - E(priceAuthority) + const result = E(priceAuthority) .quoteWhenGT(moola(1n), bucks(40n)) - .then(quote => { + .then(async quote => { const quoteInAmount = quote.quoteAmount.value[0]; t.deepEqual(toTS(3n), manualTimer.getCurrentTimestamp()); t.deepEqual(toTS(3n), quoteInAmount.timestamp); - assertAmountsEqual(t, bucks(41n), quoteInAmount.amountOut); - assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); + await assertAmountsEqual(t, bucks(41n), quoteInAmount.amountOut); + await assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); }); await E(manualTimer).tick(); await E(manualTimer).tick(); await E(manualTimer).tick(); await E(manualTimer).tick(); + await result; }); test('priceAuthority quoteWhenLTE', async t => { @@ -211,18 +214,19 @@ test('priceAuthority quoteWhenLTE', async t => { manualTimer, ); - E(priceAuthority) + const result = E(priceAuthority) .quoteWhenLTE(moola(1n), bucks(25n)) - .then(quote => { + .then(async quote => { const quoteInAmount = quote.quoteAmount.value[0]; t.deepEqual(toTS(4n), quoteInAmount.timestamp); t.deepEqual(toTS(4n), manualTimer.getCurrentTimestamp()); - assertAmountsEqual(t, bucks(25n), quoteInAmount.amountOut); - assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); + await assertAmountsEqual(t, bucks(25n), quoteInAmount.amountOut); + await assertAmountsEqual(t, moola(1n), quoteInAmount.amountIn); }); await E(manualTimer).tick(); await E(manualTimer).tick(); await E(manualTimer).tick(); await E(manualTimer).tick(); + await result; }); diff --git a/packages/zoe/test/unitTests/manualTimer.test.js b/packages/zoe/test/unitTests/manualTimer.test.js index 9ed76e880df1..f40655e825e7 100644 --- a/packages/zoe/test/unitTests/manualTimer.test.js +++ b/packages/zoe/test/unitTests/manualTimer.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { E } from '@endo/eventual-send'; @@ -78,7 +77,7 @@ test('tick does not flush by default', async t => { const handler = Far('handler', { wake: scheduled => { woken = scheduled; - stallLots().then(() => (later = true)); + void stallLots().then(() => (later = true)); }, }); manualTimer.setWakeup(toTS(1n), handler); @@ -105,7 +104,7 @@ test('tick can flush promise queue', async t => { const handler = Far('handler', { wake: scheduled => { woken = scheduled; - stallLots().then(() => (later = true)); + void stallLots().then(() => (later = true)); }, }); manualTimer.setWakeup(toTS(1n), handler); @@ -134,7 +133,7 @@ test('tick does not await makeRepeater by default', async t => { const handler = Far('handler', { wake: scheduled => { woken = scheduled; - stallLots().then(() => (later = true)); + void stallLots().then(() => (later = true)); }, }); @@ -163,7 +162,7 @@ test('tick can flush makeRepeater', async t => { const handler = Far('handler', { wake: scheduled => { woken = scheduled; - stallLots().then(() => (later = true)); + void stallLots().then(() => (later = true)); }, }); diff --git a/packages/zoe/test/unitTests/zcf/zcf.test.js b/packages/zoe/test/unitTests/zcf/zcf.test.js index 9859a0500f7d..5f6900bb1142 100644 --- a/packages/zoe/test/unitTests/zcf/zcf.test.js +++ b/packages/zoe/test/unitTests/zcf/zcf.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { Far } from '@endo/marshal'; @@ -442,7 +441,7 @@ test(`zcf.makeZCFMint - mintGains - no seat`, async t => { const { brand } = zcfMint.getIssuerRecord(); const zcfSeat = zcfMint.mintGains(harden({ A: AmountMath.make(brand, 4n) })); t.truthy(zcfSeat); - assertAmountsEqual( + await assertAmountsEqual( t, zcfSeat.getAmountAllocated('A', brand), AmountMath.make(brand, 4n), @@ -516,7 +515,7 @@ test(`zcf.makeZCFMint - mintGains - right issuer`, async t => { zcfSeat, ); t.is(zcfSeat2, zcfSeat); - assertAmountsEqual( + await assertAmountsEqual( t, zcfSeat.getAmountAllocated('A', brand), AmountMath.make(brand, 4n), @@ -534,7 +533,7 @@ test(`zcf.makeZCFMint - burnLosses - right issuer`, async t => { zcfSeat, ); t.is(zcfSeat2, zcfSeat); - assertAmountsEqual( + await assertAmountsEqual( t, zcfSeat.getAmountAllocated('A', brand), AmountMath.make(brand, 4n), @@ -546,7 +545,7 @@ test(`zcf.makeZCFMint - burnLosses - right issuer`, async t => { zcfSeat, ); t.is(result, undefined); - assertAmountsEqual( + await assertAmountsEqual( t, zcfSeat.getAmountAllocated('A', brand), AmountMath.make(brand, 3n), @@ -577,7 +576,7 @@ test(`zcf.makeZCFMint - burnLosses - seat exited`, async t => { zcfSeat, ); t.is(zcfSeat2, zcfSeat); - assertAmountsEqual( + await assertAmountsEqual( t, zcfSeat.getAmountAllocated('A', brand), AmountMath.make(brand, 4n), @@ -840,7 +839,7 @@ test(`zcfSeat.getAmountAllocated from zcf.makeEmptySeatKit`, async t => { // Mint some gains to change the allocation. const { brand: brand1 } = await allocateEasy(zcf, 'Stuff', zcfSeat, 'A', 3n); - assertAmountsEqual(t, zcfSeat.getAmountAllocated('A', brand1), { + await assertAmountsEqual(t, zcfSeat.getAmountAllocated('A', brand1), { brand: brand1, value: 3n, }); @@ -848,12 +847,12 @@ test(`zcfSeat.getAmountAllocated from zcf.makeEmptySeatKit`, async t => { // Again, mint some gains to change the allocation. const { brand: brand2 } = await allocateEasy(zcf, 'Stuff2', zcfSeat, 'B', 6n); - assertAmountsEqual(t, zcfSeat.getAmountAllocated('B'), { + await assertAmountsEqual(t, zcfSeat.getAmountAllocated('B'), { brand: brand2, value: 6n, }); - assertAmountsEqual(t, zcfSeat.getAmountAllocated('B', brand2), { + await assertAmountsEqual(t, zcfSeat.getAmountAllocated('B', brand2), { brand: brand2, value: 6n, }); @@ -976,11 +975,11 @@ test(`userSeat.getPayouts, getPayout from zcf.makeEmptySeatKit`, async t => { t.deepEqual(await payoutPs.A, await payoutAP); t.deepEqual(await payoutPs.B, await payoutBP); - assertAmountsEqual(t, await E(issuer1).getAmountOf(payoutAP), { + await assertAmountsEqual(t, await E(issuer1).getAmountOf(payoutAP), { brand: brand1, value: 3n, }); - assertAmountsEqual(t, await E(issuer2).getAmountOf(payoutBP), { + await assertAmountsEqual(t, await E(issuer2).getAmountOf(payoutBP), { brand: brand2, value: 6n, }); diff --git a/packages/zoe/test/unitTests/zoe/escrowStorage.test.js b/packages/zoe/test/unitTests/zoe/escrowStorage.test.js index 46c36d2147c3..13b4c7d52c1d 100644 --- a/packages/zoe/test/unitTests/zoe/escrowStorage.test.js +++ b/packages/zoe/test/unitTests/zoe/escrowStorage.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { AmountMath, makeIssuerKit, AssetKind } from '@agoric/ertp'; @@ -97,13 +96,17 @@ test('provideEscrowStorage', async t => { Money: payout.Money, }); - Object.entries(initialAllocation).forEach(([keyword, amount]) => { - assertAmountsEqual(t, amount, initialAllocation2[keyword]); - }); + await Promise.all( + Object.entries(initialAllocation).map(([keyword, amount]) => + assertAmountsEqual(t, amount, initialAllocation2[keyword]), + ), + ); - Object.entries(initialAllocation2).forEach(([keyword, amount]) => { - assertAmountsEqual(t, amount, initialAllocation[keyword]); - }); + await Promise.all( + Object.entries(initialAllocation2).map(([keyword, amount]) => + assertAmountsEqual(t, amount, initialAllocation[keyword]), + ), + ); }); const setupPurses = async createPurse => { diff --git a/packages/zoe/test/unitTests/zoe/instanceAdminStorage.test.js b/packages/zoe/test/unitTests/zoe/instanceAdminStorage.test.js index 33cbfacab011..252369b21076 100644 --- a/packages/zoe/test/unitTests/zoe/instanceAdminStorage.test.js +++ b/packages/zoe/test/unitTests/zoe/instanceAdminStorage.test.js @@ -1,4 +1,3 @@ -/* eslint @typescript-eslint/no-floating-promises: "warn" */ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava.js'; import { Far } from '@endo/marshal'; @@ -32,7 +31,7 @@ test('makeInstanceAdminStorage', async t => { getOfferFilter: () => ['filter'], }); - ias.updater.initInstanceAdmin(mockInstance1, mockInstanceAdmin); + void ias.updater.initInstanceAdmin(mockInstance1, mockInstanceAdmin); t.is(await ias.accessor.getInstallation(mockInstance1), mockInstallation1); t.is(await ias.accessor.getBrands(mockInstance1), mockBrandRecord); t.is(await ias.accessor.getPublicFacet(mockInstance1), mockFacet); @@ -56,7 +55,7 @@ test('add another instance admin for same instance', async t => { getOfferFilter: () => 'filter', }); - ias.updater.initInstanceAdmin(mockInstance1, mockInstanceAdmin1); + void ias.updater.initInstanceAdmin(mockInstance1, mockInstanceAdmin1); t.is(await ias.accessor.getInstallation(mockInstance1), mockInstallation1); const mockInstanceAdmin2 = Far('mockInstanceAdmin', {}); diff --git a/packages/zoe/tools/manualPriceAuthority.js b/packages/zoe/tools/manualPriceAuthority.js index 856258cdb6a6..0e0c71308ac7 100644 --- a/packages/zoe/tools/manualPriceAuthority.js +++ b/packages/zoe/tools/manualPriceAuthority.js @@ -92,7 +92,7 @@ export function makeManualPriceAuthority(options) { setPrice: newPrice => { currentPrice = newPrice; updater.updateState(currentPrice); - fireTriggers(createQuote); + void fireTriggers(createQuote); }, disable: () => { disabled = true; diff --git a/packages/zoe/tools/scriptedPriceAuthority.js b/packages/zoe/tools/scriptedPriceAuthority.js index 14cc036d9835..0d5350860c73 100644 --- a/packages/zoe/tools/scriptedPriceAuthority.js +++ b/packages/zoe/tools/scriptedPriceAuthority.js @@ -91,10 +91,10 @@ export function makeScriptedPriceAuthority(options) { currentPrice = priceList[Number(Number(t / quoteInterval) % priceList.length)]; - fireTriggers(createQuote); + void fireTriggers(createQuote); }, }); - observeNotifier(notifier, priceObserver); + void observeNotifier(notifier, priceObserver); return priceAuthority; }