feat: add aggregate operation count getters for farming-pool, factory, and vesting-wallet - #266
Merged
ritaifeoluwa merged 2 commits intoAug 28, 2026
Conversation
✅ Deploy Preview for sdcontracts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@Joeloo1 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! 🚀 |
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.
Summary
This PR adds aggregate operation count metrics across
FarmingPool,Factory, andVestingWalletcontracts to support protocol usage tracking, analytics, governance monitoring, and churn metrics.Changes Included
FarmingPool: Lock Operation Count (Closes No lock operation count getter in FarmingPool #260)
DataKey::LockCountstorage key infarming-pool/src/types.rs.lock_assetsinvocation (initial locks and top-ups).lock_count(env: Env) -> Result<u32, PoolError>andget_lock_count(env: Env) -> Result<u32, PoolError>.test_lock_count_increments_on_every_lock_operation.Factory: Admin Transfer Count (Closes No admin transfer count getter in Factory #261)
DataKey::AdminTransferCountstorage key infactory/src/types.rs.transfer_adminexecution.admin_transfer_count(env: Env) -> Result<u32, FactoryError>andget_admin_transfer_count(env: Env) -> Result<u32, FactoryError>.test_admin_transfer_count_increments_on_transfer.FarmingPool: Unstake Operation Count (Closes No unstake operation count getter in FarmingPool #262)
DataKey::UnstakeCountstorage key infarming-pool/src/types.rs.unstakeinvocation.unstake_count(env: Env) -> Result<u32, PoolError>andget_unstake_count(env: Env) -> Result<u32, PoolError>.test_unstake_count_increments_on_every_unstake_operation.VestingWallet: Release Count (Closes No release count getter in vesting wallet #263)
DataKey::ReleaseCountstorage key investing-wallet/src/types.rs.releasewhenever tokens are released to the beneficiary (releasable > 0).release_count(env: Env) -> Result<u32, VestingError>andget_release_count(env: Env) -> Result<u32, VestingError>.test_release_count_increments_on_release.Testing
All feature unit tests pass:
cargo test -p farming-pool -- test_lock_countcargo test -p factory -- test_admin_transfer_countcargo test -p farming-pool -- test_unstake_countcargo test -p vesting-wallet -- test_release_count