diff --git a/substrate/frame/staking/src/tests.rs b/substrate/frame/staking/src/tests.rs index 8422b355dad4..aa35d092fbb8 100644 --- a/substrate/frame/staking/src/tests.rs +++ b/substrate/frame/staking/src/tests.rs @@ -6616,10 +6616,7 @@ fn should_retain_era_info_only_upto_history_depth() { for page in 0..3 { ErasStakersPaged::::insert( (era, &validator_stash, page), - ExposurePage { - page_total: 100, - others: WeakBoundedVec::force_from(vec![], None), - }, + ExposurePage { page_total: 100, others: WeakBoundedVec::default() }, ); } } @@ -8631,7 +8628,7 @@ mod getters { // given let era: EraIndex = 12; let account_id: mock::AccountId = 1; - let rewards = WeakBoundedVec::force_from(vec![], None); + let rewards = WeakBoundedVec::default(); ClaimedRewards::::insert(era, account_id, rewards.clone()); // when diff --git a/substrate/primitives/staking/src/lib.rs b/substrate/primitives/staking/src/lib.rs index a9e14dc5858a..82d9b25fecbc 100644 --- a/substrate/primitives/staking/src/lib.rs +++ b/substrate/primitives/staking/src/lib.rs @@ -401,7 +401,7 @@ impl, MaxExposurePageSize, - > = WeakBoundedVec::force_from(vec![], None); + > = WeakBoundedVec::default(); for individual in chunk.iter() { page_total.saturating_accrue(individual.value); let _ = others.try_push(IndividualExposure { @@ -444,10 +444,7 @@ pub struct ExposurePage< impl> Default for ExposurePage { fn default() -> Self { - ExposurePage { - page_total: Default::default(), - others: WeakBoundedVec::force_from(vec![], None), - } + ExposurePage { page_total: Default::default(), others: WeakBoundedVec::default() } } }