test(vaults): add zero-balance, rounding, and lockup tests - #868
Open
mikwansa wants to merge 3 commits into
Open
test(vaults): add zero-balance, rounding, and lockup tests#868mikwansa wants to merge 3 commits into
mikwansa wants to merge 3 commits into
Conversation
…ay#737) Covers the 0-amount deposit and 0-amount withdrawal revert paths, including on an empty vault before any shares exist, and asserts the failed calls leave vault state untouched. Closes BCPathway#737 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Deposits prime-number amounts, distributes a reward that does not divide evenly, and asserts each payout never exceeds the user's pro-rata entitlement and the vault pays out no more than it received. Closes BCPathway#738 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…athway#739) unwrap() bypassed the deposit time lockup because only withdraw() ran the require_unlocked guard, letting a time-locked depositor exit early. Adds the guard to unwrap() and tests the full deposit -> locked withdraw -> advance time -> withdraw cycle, plus the unwrap bypass path. Closes BCPathway#739 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@mikwansa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the three Testing-bucket deliverables for the Yield-Bearing Fee Vaults epic to the wrapper contract (the epic's real vault implementation, matching how #736 was resolved in #863):
unwrap()did not run therequire_unlockedguard (onlywithdraw()did), so a time-locked depositor could exit early viaunwrap— the guard now applies to both paths, and a test covers it.Changes
contracts/wrapper/src/test.rs: 4 new tests across three themed sections (mirrors the existing#736/#730test-section convention).contracts/wrapper/src/lib.rs:unwrap()now enforces the deposit time lockup viarequire_unlocked, matchingwithdraw().Closes #737
Closes #738
Closes #739