From 554a868dc93cddeb5bcacbede6eef7d3cf709673 Mon Sep 17 00:00:00 2001 From: Chris Hibbert Date: Tue, 11 May 2021 16:52:46 -0700 Subject: [PATCH] chore: clean-up a work-around for a bug that's been fixed A bug was reported in #3032, #3034 worked around it, and #3033 fixed it. This removes the test and workaround. Removing the test seems to suppress the failure reported in #3079. That's good in reducing (possibly) spurious failures in CI, but may make it harder and less urgent to track down #3079. --- .../zoe/src/contracts/newSwap/collectFees.js | 14 +++------ .../contracts/newSwap/test-newSwap-swap.js | 31 ------------------- 2 files changed, 4 insertions(+), 41 deletions(-) diff --git a/packages/zoe/src/contracts/newSwap/collectFees.js b/packages/zoe/src/contracts/newSwap/collectFees.js index b2d78524b0b..2aec69e3e3a 100644 --- a/packages/zoe/src/contracts/newSwap/collectFees.js +++ b/packages/zoe/src/contracts/newSwap/collectFees.js @@ -6,16 +6,10 @@ export const makeMakeCollectFeesInvitation = (zcf, feeSeat, centralBrand) => { const collectFees = seat => { const allocation = feeSeat.getAmountAllocated('RUN', centralBrand); - // This check works around - // https://github.com/Agoric/agoric-sdk/issues/3033 - // when that bug is fixed, the reallocate can be moved outside the check and - // the check dropped. - if (!AmountMath.isEmpty(allocation)) { - zcf.reallocate( - seat.stage({ RUN: allocation }), - feeSeat.stage({ RUN: AmountMath.makeEmpty(centralBrand) }), - ); - } + zcf.reallocate( + seat.stage({ RUN: allocation }), + feeSeat.stage({ RUN: AmountMath.makeEmpty(centralBrand) }), + ); seat.exit(); return `paid out ${allocation.value}`; }; diff --git a/packages/zoe/test/unitTests/contracts/newSwap/test-newSwap-swap.js b/packages/zoe/test/unitTests/contracts/newSwap/test-newSwap-swap.js index 97be9d633ce..5261e37fba2 100644 --- a/packages/zoe/test/unitTests/contracts/newSwap/test-newSwap-swap.js +++ b/packages/zoe/test/unitTests/contracts/newSwap/test-newSwap-swap.js @@ -1024,34 +1024,3 @@ test('newSwap jig - breaking scenario', async t => { // This demonstrates that we've worked around // https://github.com/Agoric/agoric-sdk/issues/3033. When that is fixed, the // work-around in collectFees should be cleaned up. -test('newSwap workaround zoe Bug', async t => { - const zoe = makeZoe(fakeVatAdmin); - - // Set up central token - const centralR = makeIssuerKit('central'); - - // Alice creates an autoswap instance - const bundle = await bundleSource(newSwapRoot); - - const installation = await zoe.install(bundle); - // This timer is only used to build quotes. Let's make it non-zero - const fakeTimer = buildManualTimer(console.log, 30n); - const { creatorFacet } = await zoe.startInstance( - installation, - harden({ Central: centralR.issuer }), - { timer: fakeTimer, poolFee: 24n, protocolFee: 6n }, - ); - - const collectFeesInvitation2 = E(creatorFacet).makeCollectFeesInvitation(); - const collectFeesSeat2 = await zoe.offer( - collectFeesInvitation2, - undefined, - undefined, - ); - - const payout = await E(collectFeesSeat2).getPayout('RUN'); - const result = await E(collectFeesSeat2).getOfferResult(); - - t.deepEqual(payout, undefined); - t.deepEqual(result, 'paid out 0'); -});