-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mtg-578] Add both restrict and allow claim instructions with tests #28
Conversation
20d7cb5
to
f32a952
Compare
f32a952
to
7617203
Compare
7617203
to
1750838
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're restricting the reward claims, and not withdrawals here? I had an impression we were planning to restrict withdrawals.
use anchor_lang::prelude::*; | ||
use mplx_staking_states::error::MplStakingError; | ||
|
||
/// Restricts claiming rewards from the specified mining account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Restricts claiming rewards from the specified mining account. | |
/// Allows claiming rewards from the specified mining account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was to restrict claiming and withdraws at the same time because you can't withdraw if you have some unclaimed rewards. Albeit, a user might have no rewards and still violate the rules. Presumably, restricting withdrawal (while still restricting claiming) is a more sensible approach. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the logic is good. The comments are a bit off and need fixing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've committed your suggestion, haven't I? As well as renamed methods completely to remove ambiguity.
Got it with the restrictions. It makes sense to update comments to reflect the restriction applies to both claiming the rewards and withdrawing funds. |
…_minting.rs Co-authored-by: Stanislav Cherviakov <stchervyakov@gmail.com>
[mtg-584] Penalties/restrict batch minting
No description provided.