Commit 8e120489 authored by Gonçalo Pestana's avatar Gonçalo Pestana Committed by GitHub
Browse files

Automatic `withdraw_unbonded` upon `unbond` (#12582)



* Prevents max unbonding chunk slots from being filled when unbonding in the staking pallet

* hardcode num_slashing to unlock chunks automatically

* refactor withdraw logic to do_withdraw; idiomatic rust improvements

* a

* callable unbond() to return a DispatchWithPostInfo to dynamically update the consumed weight

* refunds overpaid fees when unbond with withdraw

* fetches real slashing spans before withdrawal call

* nits

* addresses PR comments

* Adds more testing

* fixes doc comments

* Fixes weight refunding logic for fn unbond

* generalizes  to return used weight or dispatch error

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: default avatarKian Paimani <[email protected]>

* Update frame/staking/src/pallet/mod.rs

Co-authored-by: default avatarKian Paimani <[email protected]>

* Addresses PR comments

* Add comment to speculative num spans

* adds missing add_slashing_spans in withdraw_unbonded_kill benchmarks

* ".git/.scripts/bench-bot.sh" pallet dev pallet_staking

* fix publish

Co-authored-by: default avatarKian Paimani <[email protected]>
Co-authored-by: command-bot <>
parent c1ed1901
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment