Skip to content

add get_stakers btc and strk delegations flow#29

Merged
arad-starkware merged 1 commit intomainfrom
arad/add_get_stakers_btc_and_strk_delegations_flow
Nov 19, 2025
Merged

add get_stakers btc and strk delegations flow#29
arad-starkware merged 1 commit intomainfrom
arad/add_get_stakers_btc_and_strk_delegations_flow

Conversation

@arad-starkware
Copy link
Collaborator

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

This change is Reviewable


Note

Adds a new test verifying get_stakers weighting with STRK and BTC delegations across multiple stakers, plus minor test utils/import updates and a small docs tweak.

  • Tests:
    • Add get_stakers_delegation_flow_test in flow_test/test.cairo validating get_stakers with 4 stakers and both STRK/BTC delegations; computes expected weights via STRK_WEIGHT_FACTOR, BTC_WEIGHT_FACTOR, and mul_wide_and_div and asserts results.
  • Docs:
    • Tweak flow_test/flow_ideas.md under get_stakers list.

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

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.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware)


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

/// FLow:
/// Staker 1 stake
/// Staker 2 stake

Why do we need 2 stakers? Lets add a check of staker with both delegated strk and delegated btc

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 2002 at r1 (raw file):

Previously, noa-starkware wrote…

Why do we need 2 stakers? Lets add a check of staker with both delegated strk and delegated btc

With one staker the STRK pool won't change anything in the staking power, since he'd still have all of it. Maybe have one staker with both pools and one with none?

@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_exit_action_flow branch from c81b31f to 2a392cb Compare November 19, 2025 11:48
@arad-starkware arad-starkware force-pushed the arad/add_get_stakers_btc_and_strk_delegations_flow branch from 53c0237 to 357c939 Compare November 19, 2025 11:48
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.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware)


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

Previously, arad-starkware wrote…

With one staker the STRK pool won't change anything in the staking power, since he'd still have all of it. Maybe have one staker with both pools and one with none?

talked f2f

@arad-starkware arad-starkware force-pushed the arad/test_add_get_stakers_exit_action_flow branch from 2a392cb to 120c70b Compare November 19, 2025 12:35
@arad-starkware arad-starkware force-pushed the arad/add_get_stakers_btc_and_strk_delegations_flow branch from 357c939 to 00bbd36 Compare November 19, 2025 12:35
@graphite-app graphite-app bot changed the base branch from arad/test_add_get_stakers_exit_action_flow to graphite-base/29 November 19, 2025 12:38
@arad-starkware arad-starkware force-pushed the arad/add_get_stakers_btc_and_strk_delegations_flow branch from 00bbd36 to f3f562a Compare November 19, 2025 12:41
@graphite-app graphite-app bot changed the base branch from graphite-base/29 to arad/test_add_get_stakers_exit_action_flow November 19, 2025 12:41
@arad-starkware arad-starkware force-pushed the arad/add_get_stakers_btc_and_strk_delegations_flow branch from f3f562a to 83822a4 Compare November 19, 2025 12:41
@arad-starkware arad-starkware changed the base branch from arad/test_add_get_stakers_exit_action_flow to graphite-base/29 November 19, 2025 12:43
@arad-starkware arad-starkware force-pushed the arad/add_get_stakers_btc_and_strk_delegations_flow branch from 83822a4 to 767967b Compare November 19, 2025 12:44
@graphite-app graphite-app bot changed the base branch from graphite-base/29 to main November 19, 2025 12:44
@arad-starkware arad-starkware force-pushed the arad/add_get_stakers_btc_and_strk_delegations_flow branch from 767967b to 7f4eda4 Compare November 19, 2025 12:44
@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.43%. Comparing base (0d4c1ff) to head (59470a4).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
- Coverage   95.74%   95.43%   -0.31%     
==========================================
  Files          47       45       -2     
  Lines       11159     9446    -1713     
==========================================
- Hits        10684     9015    -1669     
+ Misses        475      431      -44     

☔ 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 force-pushed the arad/add_get_stakers_btc_and_strk_delegations_flow branch from 7f4eda4 to 59470a4 Compare November 19, 2025 12:49
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 @noa-starkware)


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

Previously, noa-starkware wrote…

talked f2f

Done.

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.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @arad-starkware)


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

        (staker_4.staker.address, staker_without_strk_delegation_staking_power, Option::None),
    ]
        .span();

test the sum of all the 4 is 100%?

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 @noa-starkware)


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

Previously, noa-starkware wrote…

test the sum of all the 4 is 100%?

https://reviewable.io/reviews/starkware-libs/starknet-staking/34

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 merged commit d05bb77 into main Nov 19, 2025
5 of 7 checks passed
@arad-starkware arad-starkware deleted the arad/add_get_stakers_btc_and_strk_delegations_flow branch November 19, 2025 14:25
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.

2 participants