Skip to content

Commit

Permalink
Fix StabilityPool_SPWithdrawalToCDPTest
Browse files Browse the repository at this point in the history
  • Loading branch information
RickGriff committed Jan 30, 2024
1 parent 37ca5ad commit 30cbd43
Show file tree
Hide file tree
Showing 2 changed files with 559 additions and 537 deletions.
6 changes: 3 additions & 3 deletions contracts/test/StabilityPool_SPWithdrawalTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ contract('StabilityPool - Withdrawal of stability deposit - Reward calculations'
// price drops by 50%
await priceFeed.setPrice(dec(100, 18));

// Defaulter 1 liquidated. Value of P updated to to 9999999, i.e. in decimal, ~1e-10
// Defaulter 1 liquidated. Value of P updated to 1e13
const txL1 = await troveManager.liquidate(defaulter_1, { from: owner });
th.logBN("P", await stabilityPool.P()); // P = 0.000009999999999999, i.e. 1 wei less than expected
assert.equal(await stabilityPool.P(), dec(1, 13)) // P decreases. Expect P = 1e(18-5) = 1e13
Expand Down Expand Up @@ -1497,7 +1497,7 @@ contract('StabilityPool - Withdrawal of stability deposit - Reward calculations'
await boldToken.transfer(alice, dec(10000, 18), { from: whale })
await stabilityPool.provideToSP(dec(10000, 18), { from: alice })

// Defaulter 1 liquidated.
// Defaulter 1 liquidated. P updated to 1e13
const txL1 = await troveManager.liquidate(defaulter_1, { from: owner });
assert.isTrue(txL1.receipt.status)
th.logBN("P", await stabilityPool.P()) // P 0.000009999999999999, 1 wei less than expecteed
Expand Down Expand Up @@ -1704,7 +1704,7 @@ contract('StabilityPool - Withdrawal of stability deposit - Reward calculations'
await boldToken.transfer(alice, dec(10000, 18), { from: whale })
await stabilityPool.provideToSP(dec(10000, 18), { from: alice })

// Defaulter 1 liquidated.
// Defaulter 1 liquidated. P updated to 1e13
const txL1 = await troveManager.liquidate(defaulter_1, { from: owner });
assert.isTrue(txL1.receipt.status)
th.logBN("P", await stabilityPool.P()); // P = 0.000009999999999999, 1 wei less than expected
Expand Down
Loading

0 comments on commit 30cbd43

Please sign in to comment.