Skip to content

Commit 95fd333

Browse files
committed
test: small changes
1 parent e109e89 commit 95fd333

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

test/general.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ const generalTest = (id: string) => {
4141

4242
assert.approximately(Number(createLoanPrices[0]), Number(userPrices[0]), 1e-2, 'price 0');
4343
assert.approximately(Number(createLoanPrices[1]), Number(userPrices[1]), 1e-2, 'price 1');
44-
assert.approximately(Number(createLoanFullHealth), Number(fullHealth), 1e-4, 'full health');
44+
assert.approximately(Number(createLoanFullHealth), Number(fullHealth), 1e-3, 'full health');
4545
assert.approximately(Number(createLoanHealth), Number(health), 1e-4, 'health');
4646
assert.equal(Number(balances.collateral), Number(initialBalances.collateral) - Number(collateralAmount), 'wallet collateral');
47-
assert.equal(Number(balances.stablecoin), Number(initialBalances.stablecoin) + Number(debtAmount), 'wallet stablecoin');
47+
assert.approximately(Number(balances.stablecoin), BN(initialBalances.stablecoin).plus(Number(debtAmount)).toNumber(), 1e-12, 'wallet stablecoin');
4848
assert.equal(Number(state.collateral), Number(collateralAmount), 'state collateral');
4949
assert.equal(Number(state.debt), Number(debtAmount), 'state debt');
5050
});

test/selfLiquidate.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ const selfLiquidationTest = (id: string) => {
1212
llamma = getLlamma(id);
1313
const maxDebt = await llamma.createLoanMaxRecv(0.3, 10);
1414
await llamma.createLoan(0.3, maxDebt, 10);
15-
16-
const balances = await llamma.wallet.balances();
17-
const swapAmount = Math.min(
18-
Number(await llamma.maxSwappable(0, 1)),
19-
Number(Object.values(balances)[0])
20-
) / 2;
21-
await llamma.swap(0, 1, swapAmount, 0.05);
15+
await llamma.swap(0, 1, Number(maxDebt) * 10, 0.05);
2216
});
2317

2418
it('Self-liquidations', async function () {

0 commit comments

Comments
 (0)