Skip to content

Conversation

@arad-starkware
Copy link
Collaborator

@arad-starkware arad-starkware commented Nov 19, 2025

This change is Reviewable


Note

Introduce a new flow test validating get_stakers weighting across epochs when BTC tokens (8d/18d) are enabled/disabled and re-enabled.

  • Tests:
    • Add get_stakers_enable_disable_btc_tokens_flow_test in workspace/apps/staking/contracts/src/flow_test/test.cairo:
      • Sets up STRK and two BTC tokens (8 and 18 decimals), delegates to different stakers, advances epochs, and asserts get_stakers weights.
      • Toggles BTC tokens (disable 8d, swap enable/disable between 8d and 18d, disable both, re-enable both) and verifies staking power redistribution in the current and subsequent K epochs.
  • Docs:
    • Tweak flow_ideas.md under get_stakers list.

Written by Cursor Bugbot for commit 26ceb20. This will update automatically on new commits. Configure here.

@arad-starkware arad-starkware self-assigned this Nov 19, 2025
@arad-starkware arad-starkware marked this pull request as ready for review November 19, 2025 12:33
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from ee75727 to ef727cc Compare November 19, 2025 12:36
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from ca15f24 to 6f0f17d Compare November 19, 2025 12:36
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from ef727cc to daaced7 Compare November 19, 2025 12:41
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from 6f0f17d to 32dbbd3 Compare November 19, 2025 12:42
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from daaced7 to 5df2adb Compare November 19, 2025 12:44
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from 32dbbd3 to b4e51a1 Compare November 19, 2025 12:45
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from 5df2adb to 544506f Compare November 19, 2025 12:49
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from b4e51a1 to 6b110ac Compare November 19, 2025 12:49
Copy link
Collaborator

@noa-starkware noa-starkware left a 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 r1.
Reviewable status: 1 of 2 files reviewed, 4 unresolved discussions (waiting on @arad-starkware)


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2280 at r1 (raw file):

    assert!(stakers == expected_stakers);

    // Disable btc 8 decimals

test here its the same


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2299 at r1 (raw file):

    // Enable btc 8 decimals and disable btc 18 decimals
    system.staking.enable_token(token_address: btc_8d.contract_address());
    system.staking.disable_token(token_address: btc_18d.contract_address());

test here its the same


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2316 at r1 (raw file):

    // Disable both btc tokens
    system.staking.disable_token(token_address: btc_8d.contract_address());

tese here its the same


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2330 at r1 (raw file):

    // Enable both btc tokens
    system.staking.enable_token(token_address: btc_8d.contract_address());
    system.staking.enable_token(token_address: btc_18d.contract_address());

test here the same

@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from 6b110ac to 3a4dc96 Compare November 19, 2025 13:39
Copy link
Collaborator Author

@arad-starkware arad-starkware left a 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 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware and @noa-starkware)


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2280 at r1 (raw file):

Previously, noa-starkware wrote…

test here its the same

Done


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2299 at r1 (raw file):

Previously, noa-starkware wrote…

test here its the same

Done


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2316 at r1 (raw file):

Previously, noa-starkware wrote…

tese here its the same

Done


workspace/apps/staking/contracts/src/flow_test/test.cairo line 2330 at r1 (raw file):

Previously, noa-starkware wrote…

test here the same

Done

@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from 3a4dc96 to 7e21e0d Compare November 19, 2025 13:41
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from 544506f to 5569d00 Compare November 19, 2025 13:41
Copy link
Collaborator

@noa-starkware noa-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @arad-starkware)

@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch 2 times, most recently from d3893e2 to 6165b21 Compare November 19, 2025 14:26
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch 2 times, most recently from 9ef4317 to edc0883 Compare November 19, 2025 14:29
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from 6165b21 to a9d619f Compare November 20, 2025 08:15
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from edc0883 to 2278ae9 Compare November 20, 2025 08:15
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from a9d619f to 53d30f3 Compare November 20, 2025 08:17
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch 2 times, most recently from 4346593 to 8c8ba72 Compare November 20, 2025 08:20
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch 2 times, most recently from 1542855 to 14bd004 Compare November 20, 2025 08:28
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch 2 times, most recently from 42dc49f to c246f17 Compare November 20, 2025 09:40
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from 14bd004 to 317aefb Compare November 20, 2025 09:40
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from c246f17 to 5609a0f Compare November 20, 2025 09:50
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_delegation_undelegation_flow branch from 317aefb to c460717 Compare November 20, 2025 09:50
@arad-starkware arad-starkware changed the base branch from arad/test_add_get_stakers_delegation_undelegation_flow to graphite-base/31 November 20, 2025 11:01
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from 5609a0f to cb8e7e1 Compare November 20, 2025 11:02
@graphite-app graphite-app bot changed the base branch from graphite-base/31 to main November 20, 2025 11:02
@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_enable_disable_tokens_flow branch from cb8e7e1 to 26ceb20 Compare November 20, 2025 11:02
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.50%. Comparing base (a28d60e) to head (26ceb20).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   95.43%   95.50%   +0.06%     
==========================================
  Files          45       45              
  Lines        9446     9583     +137     
==========================================
+ Hits         9015     9152     +137     
  Misses        431      431              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arad-starkware arad-starkware merged commit d66aac8 into main Nov 20, 2025
6 of 7 checks passed
Copy link
Collaborator Author

Merge activity

@arad-starkware arad-starkware deleted the arad/test_add_get_stakers_enable_disable_tokens_flow branch November 20, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants