Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌙 Add closeVessel fees tests #9

Merged
merged 3 commits into from
Apr 29, 2024
Merged

Conversation

MiksuJak
Copy link
Member

No description provided.


const treasuryBalanceAfter = await debtToken.balanceOf(treasury)

assert.isTrue(treasuryBalanceBefore.eq(treasuryBalanceAfter))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer us to use assert.equal(A, B), so the errors will be more descriptive and better than: True is not False

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert.equal matcher does not work on the BN type that they use

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert.equal(before.toString(), after.toString())

Comment on lines 211 to 227
it('does not add fees mid epoch', async () => {
const {erc20, debtToken, borrowerOperations} = contracts.core
await openVessel(alice)
await openVessel(bob)
await skipToNextEpoch()

await borrowerOperations.collectVesselFee(erc20.address, alice)

const treasuryBalanceBefore = await debtToken.balanceOf(treasury)

await mintDebtTokens(alice, vesselTotalDebt)
await closeVessel(alice)

const treasuryBalanceAfter = await debtToken.balanceOf(treasury)

assert.equal(treasuryBalanceBefore.toString(), treasuryBalanceAfter.toString())
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will also pass after splitting treasury into treasury and distributor

@Szymx95 Szymx95 merged commit f69d51b into main Apr 29, 2024
1 check passed
@Szymx95 Szymx95 deleted the MiksuJak/add_closeVessel_fee_tests branch April 29, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants