diff --git a/packages/zoe/src/zoeService/zoeSeat.js b/packages/zoe/src/zoeService/zoeSeat.js index abf3199c6e86..824637d153ba 100644 --- a/packages/zoe/src/zoeService/zoeSeat.js +++ b/packages/zoe/src/zoeService/zoeSeat.js @@ -4,9 +4,9 @@ import { makePromiseKit } from '@endo/promise-kit'; import { makeNotifierKit } from '@agoric/notifier'; import { E } from '@endo/eventual-send'; import { Far } from '@endo/marshal'; -import { AmountMath } from '@agoric/ertp'; import { handlePKitWarning } from '../handleWarning.js'; +import { satisfiesWant } from '../contractFacet/offerSafety.js'; import '../types.js'; import '../internal-types.js'; @@ -99,9 +99,7 @@ export const makeZoeSeatAdminKit = ( wasWantSatisfied: async () => { return E.when(payoutPromiseKit.promise, () => - Object.keys(proposal.want).every(kwd => - AmountMath.isGTE(currentAllocation[kwd], proposal.want[kwd]), - ), + satisfiesWant(proposal, currentAllocation), ); }, }); diff --git a/packages/zoe/test/unitTests/zcf/test-zcf.js b/packages/zoe/test/unitTests/zcf/test-zcf.js index a22ceb5c16e2..2a4b77017c46 100644 --- a/packages/zoe/test/unitTests/zcf/test-zcf.js +++ b/packages/zoe/test/unitTests/zcf/test-zcf.js @@ -933,6 +933,7 @@ test(`userSeat from zcf.makeEmptySeatKit - only these properties exist`, async t 'tryExit', 'getCurrentAllocationJig', 'getAllocationNotifierJig', + 'wasWantSatisfied', ]; const { zcf } = await setupZCFTest(); const { userSeat: userSeatP } = zcf.makeEmptySeatKit();