[fix] Bound staking ledger correctly with MaxUnlockingChunks from configuration (#12343)

* used maxunlockingchunks from config

* mhl MaxUnlockingChunks

* no migration needed

* changes as per requested

* fmt

* fix tests

* fix benchmark

* warning in the doc for abrupt changes in the config

* less unnecessary details in the test

* fix tests

Co-authored-by: mrisholukamba <abdulrazzaqlukamba@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Ankan
2022-09-27 17:44:16 +02:00
committed by GitHub
parent 249316d87f
commit e6b1aae97f
5 changed files with 80 additions and 22 deletions
+2 -2
View File
@@ -613,7 +613,7 @@ benchmarks! {
}
rebond {
let l in 1 .. MaxUnlockingChunks::get() as u32;
let l in 1 .. T::MaxUnlockingChunks::get() as u32;
// clean up any existing state.
clear_validators_and_nominators::<T>();
@@ -764,7 +764,7 @@ benchmarks! {
#[extra]
do_slash {
let l in 1 .. MaxUnlockingChunks::get() as u32;
let l in 1 .. T::MaxUnlockingChunks::get() as u32;
let (stash, controller) = create_stash_controller::<T>(0, 100, Default::default())?;
let mut staking_ledger = Ledger::<T>::get(controller.clone()).unwrap();
let unlock_chunk = UnlockChunk::<BalanceOf<T>> {