[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:
Ankanmrisholukambaparity-processbot
authored and GitHub committed 2022-09-27 15:44:16 +00:00
1 parent 249316d87f
commit e6b1aae97f
5 files changed
+80 -22

No files matched your search

+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>> {