Skip to content
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

[Market] Cut all pledge won't remove lock #167

Closed
badkk opened this issue Jun 17, 2020 · 0 comments · Fixed by #168
Closed

[Market] Cut all pledge won't remove lock #167

badkk opened this issue Jun 17, 2020 · 0 comments · Fixed by #168
Assignees
Labels

Comments

@badkk
Copy link
Member

badkk commented Jun 17, 2020

Due to the set_lock mechanism in Currency module, if set_lock(0), it won't work, we should call remove_lock referring to unbond in staking module

if ledger.unlocking.is_empty() && ledger.active.is_zero() {
// This account must have called `unbond()` with some value that caused the active
// portion to fall below existential deposit + will have no more unlocking chunks
// left. We can now safely remove all staking-related information.
Self::kill_stash(&stash);
// remove the lock.
T::Currency::remove_lock(STAKING_ID, &stash);
} else {
// This was the consequence of a partial unbond. just update the ledger and move on.
Self::update_ledger(&controller, &ledger);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants