-
Notifications
You must be signed in to change notification settings - Fork 165
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
Enforce rate limits in decrease take #626
Conversation
…sed right away after decreasing
@@ -155,9 +155,22 @@ impl<T: Config> Pallet<T> { | |||
let min_take = MinTake::<T>::get(); | |||
ensure!(take >= min_take, Error::<T>::DelegateTakeTooLow); | |||
|
|||
// Enforce the rate limit (independently on do_add_stake rate limits) |
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.
// Enforce the rate limit (independently on do_add_stake rate limits) | |
// Enforce the rate limit (independent of do_add_stake rate limits) |
|
||
// Test rate-limiting on decrease_take | ||
#[test] | ||
fn test_rate_limits_enforced_on_decrease_take() { |
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.
Is this the expected behaviour? imo, one should be able to decrease without rate limit, but not increase until after the rate limit since the last change (increase or decrease)
Description
Related Issue(s)
n/a
Type of Change
Breaking Change
n/a
Checklist
cargo fmt
andcargo clippy
to ensure my code is formatted and linted correctlyScreenshots (if applicable)
n/a
Additional Notes
n/a