-
Notifications
You must be signed in to change notification settings - Fork 49
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
Auto claim unstaking #1010
Auto claim unstaking #1010
Conversation
e9ff11c
to
6376ec0
Compare
Signed-off-by: Xavier Lau <[email protected]>
6376ec0
to
62cf5e4
Compare
@boundless-forest please also help review this. |
@@ -456,7 +456,13 @@ pub mod pallet { | |||
); | |||
} | |||
|
|||
let now = <frame_system::Pallet<T>>::block_number(); | |||
|
|||
l.unstaking_ring.retain(|(_, t)| t > &now); |
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.
wait, where do the removed unstaking_ring go? not in free right?
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.
OK, so free includes staked and unstaking, deposits.
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.
The unstaking part belong to the user now. It'll transfer to the staking_pot
account later.
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 am not so sure that it should be t > &now
or t >= &now
here?
Auto claim unstaking if it is expired while migrating.