test: add get stakers delegation undelegation flow#30
Conversation
49148e3 to
6a1d9d3
Compare
53c0237 to
357c939
Compare
6a1d9d3 to
ee75727
Compare
357c939 to
00bbd36
Compare
ee75727 to
ef727cc
Compare
f3f562a to
83822a4
Compare
ef727cc to
daaced7
Compare
767967b to
7f4eda4
Compare
5df2adb to
544506f
Compare
7f4eda4 to
59470a4
Compare
noa-starkware
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware)
workspace/apps/staking/contracts/src/flow_test/test.cairo line 2138 at r2 (raw file):
(staker_1.staker.address, STRK_WEIGHT_FACTOR / 2, Option::None), (staker_2.staker.address, STRK_WEIGHT_FACTOR / 2, Option::None), ]
same as above
Code quote:
let expected_stakers = array![
(staker_1.staker.address, STRK_WEIGHT_FACTOR / 2, Option::None),
(staker_2.staker.address, STRK_WEIGHT_FACTOR / 2, Option::None),
]544506f to
5569d00
Compare
arad-starkware
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @arad-starkware)
workspace/apps/staking/contracts/src/flow_test/test.cairo line 2138 at r2 (raw file):
Previously, noa-starkware wrote…
same as above
Done
5569d00 to
d3893e2
Compare
59470a4 to
d05bb77
Compare
d3893e2 to
6165b21
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
==========================================
+ Coverage 95.43% 95.46% +0.03%
==========================================
Files 45 45
Lines 9446 9510 +64
==========================================
+ Hits 9015 9079 +64
Misses 431 431 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
noa-starkware
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware)
workspace/apps/staking/contracts/src/flow_test/test.cairo line 2157 at r3 (raw file):
assert!(stakers == expected_stakers); // Undelegate
Maybe test partial intent?
6165b21 to
a9d619f
Compare
53d30f3 to
1542855
Compare
There was a problem hiding this comment.
Bug: Missing exit wait window before delegator exit action
The test calls delegator_exit_action without advancing time by the exit wait window after delegator_exit_intent. The exit_delegation_pool_action function requires that sufficient time has passed (the exit wait window) since the intent, but the test only calls advance_k_epochs which advances K epochs. The exit wait window is typically longer than K epochs, so this call will fail with INTENT_WINDOW_NOT_FINISHED error. Other tests in the codebase consistently call advance_time(time: system.staking.get_exit_wait_window()) between intent and action calls.
workspace/apps/staking/contracts/src/flow_test/test.cairo#L2201-L2202
starknet-staking/workspace/apps/staking/contracts/src/flow_test/test.cairo
Lines 2201 to 2202 in 1542855
1542855 to
14bd004
Compare
arad-starkware
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, all discussions resolved
workspace/apps/staking/contracts/src/flow_test/test.cairo line 2157 at r3 (raw file):
Previously, noa-starkware wrote…
Maybe test partial intent?
Done
14bd004 to
317aefb
Compare
317aefb to
c460717
Compare
noa-starkware
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware)
workspace/apps/staking/contracts/src/flow_test/test.cairo line 2116 at r5 (raw file):
let mut system = SystemConfigTrait::basic_stake_flow_cfg(:cfg).deploy(); let stake_amount = system.staking.get_min_stake(); let strk_delegation_amount = STRK_CONFIG.min_for_rewards * 3;
why?
Code quote:
* 3
noa-starkware
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware)
Merge activity
|

This change is
Note
Add a new end-to-end test validating get_stakers across delegation and undelegation intents/actions over epochs, and prune one obsolete idea from flow_ideas.
get_stakers_delegation_undelegation_flow_testinworkspace/apps/staking/contracts/src/flow_test/test.cairo:get_stakersweights at current and subsequent K-epochs, verifying staking-power redistribution viamul_wide_and_divandSTRK_WEIGHT_FACTOR.- Undelegate, get stakers.fromflow_test/flow_ideas.md.Written by Cursor Bugbot for commit c460717. This will update automatically on new commits. Configure here.