Add can_claim_all_rewards to stake config#1078
Conversation
Introduce a new boolean flag `can_claim_all_rewards` to StakeChainConfig in both `crates/primitives` and `gemstone`, add `StakeChain::get_can_claim_all_rewards()` accessor, update CHAIN_CONFIGS entries with appropriate values for each chain, and adjust `get_stake_config` and tests to include the new field. This separates the permission to claim all rewards from the existing `can_claim_rewards` flag.
There was a problem hiding this comment.
Code Review
This pull request introduces a can_claim_all_rewards field to the StakeChainConfig struct and implements a corresponding getter method in StakeChain. The review feedback recommends adding documentation comments to these new additions to clarify their functionality and maintain consistency with the existing codebase.
| pub can_redelegate: bool, | ||
| pub can_withdraw: bool, | ||
| pub can_claim_rewards: bool, | ||
| pub can_claim_all_rewards: bool, |
There was a problem hiding this comment.
Adding a documentation comment to the new can_claim_all_rewards field would help clarify its specific meaning, especially in contrast to can_claim_rewards. For example, it could specify that this flag indicates support for claiming rewards from all validators in a single transaction.
| pub can_claim_all_rewards: bool, | |
| /// Whether the chain supports claiming all rewards in a single transaction. | |
| pub can_claim_all_rewards: bool, |
| self.config().can_claim_rewards | ||
| } | ||
|
|
||
| pub fn get_can_claim_all_rewards(&self) -> bool { |
There was a problem hiding this comment.
The new method get_can_claim_all_rewards should have a documentation comment to maintain consistency with other methods in this implementation block (e.g., get_lock_time, get_can_redelegate).
| pub fn get_can_claim_all_rewards(&self) -> bool { | |
| /// Get if chain supports claiming all rewards in one transaction | |
| pub fn get_can_claim_all_rewards(&self) -> bool { |
Introduce a new boolean flag
can_claim_all_rewardsto StakeChainConfig in bothcrates/primitivesandgemstone, addStakeChain::get_can_claim_all_rewards()accessor, update CHAIN_CONFIGS entries with appropriate values for each chain, and adjustget_stake_configand tests to include the new field. This separates the permission to claim all rewards from the existingcan_claim_rewardsflag.