Skip to content

Commit

Permalink
#20 merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anilhelvaci committed Sep 12, 2022
1 parent fd99203 commit d528f34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contract/test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export const moveFromCentralPriceUp = async (zoe,
swapSecondaryForCentral,
makeCentral,
makeSecondary,
} = await makeLiquidityInvitations(undefined, zoe, ammPublicFacet, secondaryR, centralR, liquidityIssuer);
} = await makeLiquidityInvitations(undefined, zoe, ammPublicFacet, secondaryR, centralR, lpTokenIssuer);

const { amountOut } = await E(ammPublicFacet).getInputPrice(
makeCentral(1n),
Expand Down Expand Up @@ -339,7 +339,7 @@ export const moveFromCentralPriceDown = async (zoe,
swapCentralForSecondary,
makeCentral,
makeSecondary,
} = await makeLiquidityInvitations(undefined, zoe, ammPublicFacet, secondaryR, centralR, liquidityIssuer);
} = await makeLiquidityInvitations(undefined, zoe, ammPublicFacet, secondaryR, centralR, lpTokenIssuer);

const { amountOut } = await E(ammPublicFacet).getInputPrice(makeCentral(1n), makeSecondary(0n));
let inputPriceAmountOut = amountOut;
Expand Down
9 changes: 6 additions & 3 deletions contract/test/test-stopLoss.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ test('Test lock additional LP Tokens to contract', async (t) => {
const additionalSecondaryValue = 40n;

const additionalPayout = await addLiquidityToPool(
t,
zoe,
ammPublicFacet,
centralR,
Expand Down Expand Up @@ -1491,7 +1492,7 @@ test('boundaryWatcher-failed-no-tokens-locked', async (t) => {
t.deepEqual(initialNotification.phase, ALLOCATION_PHASE.SCHEDULED);

E(devPriceAuthority).setPrice(undefined);
await waitForPromisesToSettle();
await eventLoopIteration();

const [lpTokenAmountAllocated, lpTokenBrand, centralAmountAllocated, secondaryAmountAllocated, { value: notificationAfterBadPrice }] = await Promise.all([
E(publicFacet).getBalanceByBrand('Liquidity', lpTokenIssuer),
Expand Down Expand Up @@ -1626,6 +1627,7 @@ test('Test withdraw Liquidity', async (t) => {
},
});

/** @type UserSeat */
const withdrawSeat = E(zoe).offer(
withdrawLiquidityInvitation,
withdrawProposal,
Expand All @@ -1635,7 +1637,7 @@ test('Test withdraw Liquidity', async (t) => {
const withdrawLiquidityMessage = await E(withdrawSeat).getOfferResult();
t.deepEqual(withdrawLiquidityMessage, 'Liquidity withdraw to creator seat');

const withdrawSeatAllocation = await E(withdrawSeat).getCurrentAllocation();
const withdrawSeatAllocation = await E(withdrawSeat).getCurrentAllocationJig();
t.deepEqual(withdrawSeatAllocation.Central, centralInUnit(30n));
t.deepEqual(withdrawSeatAllocation.Secondary, secondaryInUnit(60n))

Expand Down Expand Up @@ -1756,14 +1758,15 @@ test('Test withdraw LP Tokens while locked', async (t) => {
const withdrawLpTokensInvitation = await E(creatorFacet).makeWithdrawLpTokensInvitation();
const withdrawProposal = harden({want: { Liquidity: AmountMath.makeEmpty(lpTokenBrand)}});

/** @type UserSeat */
const withdrawLpSeat = E(zoe).offer(
withdrawLpTokensInvitation,
withdrawProposal,
);

const [withdrawLpTokenMessage, withdrawLpSeatAllocation] = await Promise.all([
E(withdrawLpSeat).getOfferResult(),
E(withdrawLpSeat).getCurrentAllocation(),
E(withdrawLpSeat).getCurrentAllocationJig(),
]);

// Check Offer result and creator seat allocation
Expand Down

0 comments on commit d528f34

Please sign in to comment.