-
Notifications
You must be signed in to change notification settings - Fork 262
More integration tests #1552
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
More integration tests #1552
Conversation
Hardhat Unit Tests Coverage SummaryDiff against masterResults for commit: b0a7bec Minimum allowed coverage is ♻️ This comment has been updated with latest results |
folkyatina
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
| }); | ||
|
|
||
| describe("Oracle fee reporting", () => { | ||
| it("reverts when oracle attempts to decrease cumulative fees", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
high border sanity check test
| await vaultHub.connect(agentSigner).grantRole(await vaultHub.VAULT_MASTER_ROLE(), vaultMaster); | ||
|
|
||
| // loosen sanity checks to bypass fee increase rate limit | ||
| await ctx.contracts.lazyOracle.connect(agentSigner).updateSanityParams(days(30n), 1000n, 1000000000000000000n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not disable a sanity check
| const treasuryBefore = await ethers.provider.getBalance(await ctx.contracts.locator.treasury()); | ||
|
|
||
| const tx = await vaultHub.settleLidoFees(stakingVault); | ||
| await tx.wait(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| await tx.wait(); |
| expect(treasuryAfter - treasuryBefore).to.equal(ether("2")); | ||
| }); | ||
|
|
||
| it("respects locked balance", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add locked+redemptions case
| expect(await vaultHub.isPendingDisconnect(stakingVault)).to.be.true; | ||
| }); | ||
|
|
||
| it("allows fee settlement during disconnect process", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe delete?
| }); | ||
|
|
||
| describe("Bad debt scenarios", () => { | ||
| it("handles large unpaid fees with bad debt", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| it("handles large unpaid fees with bad debt", async () => { | |
| it("revert settling if bad debt", async () => { |
| waitForNextRefSlot: true, | ||
| }); | ||
|
|
||
| const maxLockableAfter = await vaultHub.maxLockableValue(stakingVault); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to check capacity not maxLockable value
| const obligationsAfter = await vaultHub.obligations(stakingVault); | ||
| expect(obligationsAfter.feesToSettle).to.equal(0n); // All fees settled | ||
|
|
||
| const maxLockableAfter = await vaultHub.maxLockableValue(stakingVault); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check capacity here too?
https://www.notion.so/Testnet-3-test-plan-27dbf633d0c98068b1f3f261b9c0e712#28dbf633d0c9809ba6d4de23a29baad0