-
Notifications
You must be signed in to change notification settings - Fork 42
test: add update_rewards toggle tokens flow test #57
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
test: add update_rewards toggle tokens flow test #57
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
==========================================
+ Coverage 95.77% 95.81% +0.03%
==========================================
Files 42 42
Lines 10102 10194 +92
==========================================
+ Hits 9675 9767 +92
Misses 427 427 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
17f1baf to
a3d9239
Compare
1765bb9 to
3573ad2
Compare
noa-starkware
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.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @arad-starkware)
src/flow_test/test.cairo line 3039 at r3 (raw file):
/// Advance K epochs /// Enable token A, disable token B /// update_rewards
I think we need this test for both v2 rewards and consensus rewards, please update the test
src/flow_test/flows.cairo line 7070 at r3 (raw file):
/// Add tokens A and B /// Enable token B /// Advance epoch
rebase issues?
484a333 to
215d37b
Compare
arad-starkware
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.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @noa-starkware)
src/flow_test/test.cairo line 3039 at r3 (raw file):
Previously, noa-starkware wrote…
I think we need this test for both v2 rewards and consensus rewards, please update the test
I'm not sure about the flow you're describing, do you mean specifically v2 rewards and consensus in the same test? we have MultipleTokensDelegationFlow for v2 rewards otherwise
src/flow_test/flows.cairo line 7070 at r3 (raw file):
Previously, noa-starkware wrote…
rebase issues?
yes
550520d to
a9c72c0
Compare
894e551 to
38e57fd
Compare
a9c72c0 to
1d21b45
Compare
65039fa to
d3ed532
Compare
1d21b45 to
943c3b0
Compare
arad-starkware
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.
Reviewable status: 0 of 3 files reviewed, 7 unresolved discussions (waiting on @noa-starkware)
src/flow_test/test.cairo line 3094 at r6 (raw file):
Previously, noa-starkware wrote…
test also staker rewards please
Done.
src/flow_test/test.cairo line 3111 at r6 (raw file):
Previously, noa-starkware wrote…
test also staker rewards please
Done.
src/flow_test/test.cairo line 3120 at r6 (raw file):
Previously, noa-starkware wrote…
test also staker rewards please
Done.
src/flow_test/test.cairo line 3128 at r6 (raw file):
Previously, noa-starkware wrote…
// Enable token B, disable token A
Done
src/flow_test/test.cairo line 3148 at r6 (raw file):
Previously, noa-starkware wrote…
test also staker rewards please
Done.
src/flow_test/test.cairo line 3156 at r6 (raw file):
Previously, noa-starkware wrote…
test also staker rewards please
Done.
ea98f96 to
96cb2c9
Compare
d3ed532 to
071a55d
Compare
625acb6 to
d3512f2
Compare
6ad074b to
5f4a056
Compare
d3512f2 to
5270e9e
Compare
5f4a056 to
3ee5f59
Compare
5270e9e to
8a0dadc
Compare
8a0dadc to
bbf04ed
Compare
bbf04ed to
eb7dc58
Compare
noa-starkware
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.
@noa-starkware reviewed 1 of 2 files at r11.
Reviewable status: 1 of 3 files reviewed, 3 unresolved discussions (waiting on @arad-starkware)
src/flow_test/test.cairo line 3244 at r11 (raw file):
system.staking.disable_token(token_address: token_a.contract_address()); // Calculate rewards for consensus rewards
- only for one token enabled
src/flow_test/test.cairo line 3269 at r11 (raw file):
// update_rewards - test rewards only for token A system.update_rewards(:staker, disable_rewards: false);
update_rewards twice before advance epoch?
eb7dc58 to
41be9ca
Compare
arad-starkware
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.
Reviewable status: 1 of 3 files reviewed, all discussions resolved
src/flow_test/test.cairo line 3244 at r11 (raw file):
Previously, noa-starkware wrote…
- only for one token enabled
Done
src/flow_test/test.cairo line 3269 at r11 (raw file):
Previously, noa-starkware wrote…
update_rewards twice before advance epoch?
Done
ddcbf57 to
0b18f21
Compare
Merge activity
|
129a1c6 to
ca85233
Compare
ca85233 to
2dc8dac
Compare

This change is
Note
Adds a comprehensive flow test that toggles enabled BTC tokens across attestation and consensus epochs and validates rewards behavior with update_rewards.
update_rewards_token_enable_disable_flow_testinsrc/flow_test/test.cairo:update_rewards(including twice in same epoch), and asserts staker/delegator rewards per token in attestation (v2) and consensus (v3) modes.NormalizedAmountTraitand v2/v3 reward calculators for STRK/BTC.NormalizedAmountTrait; switch to/usecalculate_staker_btc_pool_rewards_v3,calculate_staker_strk_rewards_v2, etc.src/flow_test/flow_ideas.mdby simplifying the k=1 -> k=2 token item.Written by Cursor Bugbot for commit 2dc8dac. This will update automatically on new commits. Configure here.