-
Notifications
You must be signed in to change notification settings - Fork 41
test: delegator from v0 flows #45
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
base: main
Are you sure you want to change the base?
Conversation
| staker_address: staker.staker.address, | ||
| staking_contract: system.staking.address, | ||
| minting_curve_contract: system.minting_curve.address, | ||
| ); |
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.
| staker_address: staker.staker.address, | ||
| staking_contract: system.staking.address, | ||
| minting_curve_contract: system.minting_curve.address, | ||
| ); |
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.
Bug: Incorrect V2 reward calculation in V3 flow
The test uses calculate_strk_pool_rewards_v2 (epoch-based) to calculate expected rewards for a V3 period (block-based), instead of calculate_strk_pool_rewards_v3. This occurs in the second reward update of the DelegatorFromV0Flow test and will lead to incorrect expected values.
4e31646 to
9b801e3
Compare
|
|
||
| let expected_rewards = self.expected_rewards.unwrap() + expected_rewards_v1; | ||
| self.expected_rewards = Option::Some(expected_rewards); | ||
| } |
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.
Bug: Missing setup method for version 2
The DelegatorFromV0Flow comment indicates attestations should occur in V2 ("Attest in V2 (pool gets rewards)"), but the implementation lacks a setup_v2 method. When test_flow_mainnet executes this flow, it upgrades through V0→V1→V2→V3, calling setup, setup_v1, setup_v2, then test. Without setup_v2, no operations occur in V2, causing the flow to skip V2 attestations and pool rewards entirely, making the test incomplete and rewards calculations incorrect.
9b801e3 to
0cbc327
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
==========================================
+ Coverage 95.43% 95.54% +0.10%
==========================================
Files 45 45
Lines 9446 9674 +228
==========================================
+ Hits 9015 9243 +228
Misses 431 431 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Note
Add new delegator V0/cross-version flow tests and hook them into mainnet fork tests; minor test utils import tweak and flow ideas note update.
src/flow_test/flows.cairo):DelegatorChangeBalanceOverVersionsFlow(V0→V1→V3 with balance changes, reward checks).DelegatorFromV0Flow(V0 entry, rewards across V1/V3, mid-V3 balance change).DelegatorV0ChangeBalanceBeforeRewardsFlow(V0 entry, V3 balance change prior to rewards).calculate_strk_pool_rewards_v1alongside existing V2 helpers.src/flow_test/fork_test.cairo):delegator_change_balance_over_versions_flow_test,delegator_from_v0_flow_test,delegator_v0_change_balance_before_rewards_flow_test.src/flow_test/flow_ideas.md):V0.Written by Cursor Bugbot for commit 0cbc327. This will update automatically on new commits. Configure here.
This change is