Skip to content

Commit

Permalink
chore: prune LP test that used test-only methods
Browse files Browse the repository at this point in the history
"LP deposits, earns fees, withdraws" is overtaken by
"LPs deposit USDC" and "LP withdraws part; collects fees on 100 USDC"
  • Loading branch information
dckc committed Nov 26, 2024
1 parent 1719797 commit ee4a817
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions packages/fast-usdc/test/fast-usdc.contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,50 +320,6 @@ const makeLP = async (
return me;
};

test.skip('LP deposits, earns fees, withdraws', async t => {
const common = await commonSetup(t);
const {
commonPrivateArgs,
brands: { usdc },
utils,
} = common;

const { instance, creatorFacet, zoe, terms } = await startContract(common);
const usdcPurse = purseOf(terms.issuers.USDC, utils);
const lps = {
alice: makeLP('Alice', usdcPurse(60n), zoe, instance, t),
bob: makeLP('Bob', usdcPurse(50n), zoe, instance, t),
};

await Promise.all([E(lps.alice).deposit(60n), E(lps.bob).deposit(40n)]);

{
t.log('simulate borrow and repay so pool accrues fees');
const feeTools = makeFeeTools(commonPrivateArgs.feeConfig);
const requestedAmount = usdc.make(50n);
const splits = feeTools.calculateSplit(requestedAmount);

const amt = await E(creatorFacet).testBorrow({ USDC: splits.Principal });
t.deepEqual(
amt.USDC,
splits.Principal,
'testBorrow returns requested amount',
);
const repayPayments = await deeplyFulfilledObject(
objectMap(splits, utils.pourPayment),
);
const remaining = await E(creatorFacet).testRepay(splits, repayPayments);
for (const r of Object.values(remaining)) {
t.is(r.value, 0n, 'testRepay consumes all payments');
}
}
const actual = await Promise.all([
E(lps.alice).withdraw(0.2),
E(lps.bob).withdraw(0.8),
]);
t.like(actual, [{ value: BigInt(60 * 0.2) }]);
});

test.skip('LP borrow', async t => {
const common = await commonSetup(t);
const {
Expand Down

0 comments on commit ee4a817

Please sign in to comment.