Repository navigation
feat(farming-pool): expose distribution history, pending admin, whitelist and peak stake - #591
Merged
ritaifeoluwa merged 1 commit intoOct 20, 2026
Conversation
…list and peak stake Add read-only getters over state the contract already maintains: - get_distribution_history(offset, limit): paginated audit trail of bulk reward distributions (SmartDropLabs#566) - get_pending_admin(): the admin proposed via propose_admin that has not yet accepted, or None (SmartDropLabs#567) - is_whitelist_enabled(): current whitelist gate state (SmartDropLabs#568) - get_peak_total_staked(): highest total staked amount ever recorded (SmartDropLabs#569) No storage layout or existing behaviour changes.
|
@medunrebecca-dot Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
✅ Deploy Preview for sdcontracts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #566
Closes #567
Closes #568
Closes #569
Summary
The four assigned "farming-pool: add feature N improvement" issues all ask for a feature improvement in
contracts/farming-pool/src/lib.rswithout naming a specific API. Each one is implemented here as a read-only getter over state the contract already maintains, so no storage layout or existing behaviour changes.get_distribution_history(offset, limit)DistributionHistoryPage { events, total }, a paginated audit trail ofdistribute_bulk_rewardscallsget_pending_admin()Option<Address>for the admin proposed viapropose_adminthat has not yet acceptedis_whitelist_enabled()boolfor the current whitelist gate stateget_peak_total_staked()i128peak total staked ever recordedEach getter follows the existing conventions:
require_initialized,bump_instance, and the sameoffset/limitpaging used byget_credit_rate_history.Notes
DistributionHistoryPageis a newcontracttypeintypes.rs, mirroringCreditRateHistoryPage.Tests
New tests in
test.rsunder "Feature improvements: #566, #567, #568, #569":test_get_distribution_history_pages_bulk_rewardstest_get_pending_admin_tracks_handofftest_is_whitelist_enabled_reflects_toggletest_get_peak_total_staked_survives_unstakeThese have not been compiled or run in this PR. The new tests will write new
test_snapshots/*.jsonfiles the first timecargo testruns, and those files should be committed with the PR.