Skip to content

Commit

Permalink
refactor: use satisfiesWant to build wasWantSatisfied.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Hibbert committed Aug 8, 2022
1 parent 2c876c3 commit 84486bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/zoe/src/zoeService/zoeSeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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),
);
},
});
Expand Down
1 change: 1 addition & 0 deletions packages/zoe/test/unitTests/zcf/test-zcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 84486bf

Please sign in to comment.