• Gonçalo Pestana's avatar
    Automatic `withdraw_unbonded` upon `unbond` (#12582) · 8e120489
    Gonçalo Pestana authored
    
    
    * 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 <>
    8e120489