Skip to content

Commit

Permalink
fix Vec/BoundedVec
Browse files Browse the repository at this point in the history
  • Loading branch information
re-gius committed Dec 3, 2024
1 parent 50ce1a1 commit 40ccdec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion substrate/frame/staking/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub mod v17 {

let old_disabled_validators = v16::DisabledValidators::<T>::get();
// BoundedVec with MaxWinners limit, this should always work
let disabled_validators_maybe = WeakBoundedVec::try_from(old_disabled_validators);
let disabled_validators_maybe = BoundedVec::try_from(old_disabled_validators);
match disabled_validators_maybe {
Ok(disabled_validators) => DisabledValidators::<T>::set(disabled_validators),
Err(_) => {
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ pub struct ExtBuilder {
nominate: bool,
validator_count: u32,
minimum_validator_count: u32,
invulnerables: Vec<AccountId>,
invulnerables: BoundedVec<AccountId, <Test as Config>::MaxInvulnerables>,
has_stakers: bool,
initialize_first_session: bool,
pub min_nominator_bond: Balance,
Expand Down Expand Up @@ -377,7 +377,7 @@ impl ExtBuilder {
self
}
pub fn invulnerables(mut self, invulnerables: Vec<AccountId>) -> Self {
self.invulnerables = BoundedVec::force_from(invulnerables).unwrap();
self.invulnerables = BoundedVec::try_from(invulnerables).unwrap();
self
}
pub fn session_per_era(self, length: SessionIndex) -> Self {
Expand Down

0 comments on commit 40ccdec

Please sign in to comment.