Skip to content

Commit

Permalink
fix: userSeat.hasExited was returning the opposite of its intent
Browse files Browse the repository at this point in the history
This is mostly test updates, but it fixes one actual bug

fixes: #1729

revive some zoeHelper tests
zoeHelper trade with same handle
Turning eslint back on required cleaning up a bunch of dead code.
  • Loading branch information
Chris-Hibbert committed Sep 11, 2020
1 parent 3ce5e78 commit 76f3b00
Show file tree
Hide file tree
Showing 4 changed files with 416 additions and 582 deletions.
8 changes: 7 additions & 1 deletion packages/zoe/src/contractSupport/zoeHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export const assertIssuerKeywords = (zcf, expected) => {
);
};

/**
* @typedef {Object} ZcfSeatPartial
* @property {() => ProposalRecord} getProposal
* @property {() => Allocation} getCurrentAllocation
*/

/**
* Check whether an update to currentAllocation satisfies
* proposal.want. Note that this is half of the offer safety
Expand All @@ -101,7 +107,7 @@ export const assertIssuerKeywords = (zcf, expected) => {
* (update's values prevailing if the keywords are the same)
* to produce the newAllocation.
* @param {ContractFacet} zcf
* @param {ZCFSeat} seat
* @param {ZcfSeatPartial} seat
* @param {AmountKeywordRecord} update
* @returns {boolean}
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/zoe/src/zoeService/zoeSeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const makeZoeSeatAdminKit = (
getPayouts: async () => payoutPromiseKit.promise,
getPayout: async keyword => E.G(payoutPromiseKit.promise)[keyword],
getOfferResult: async () => offerResult,
hasExited: async () => instanceAdmin.hasZoeSeatAdmin(zoeSeatAdmin),
hasExited: async () => !instanceAdmin.hasZoeSeatAdmin(zoeSeatAdmin),
tryExit: async () => E(exitObj).exit(),
getNotifier: async () => notifier,
});
Expand Down
Loading

0 comments on commit 76f3b00

Please sign in to comment.