Skip to content

Commit

Permalink
unwrap on WeakBoundedVec
Browse files Browse the repository at this point in the history
  • Loading branch information
akildemir committed Oct 29, 2023
1 parent a00f7c5 commit cecd845
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions substrate/validator-sets/pallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,17 +803,12 @@ pub mod pallet {
(AuthorityId::from(*id), allocation / allocation_per_key_share)
})
.collect::<Vec<(AuthorityId, u64)>>();

let next_authorities = WeakBoundedVec::<_, C::MaxAuthorities>::force_from(
next_authorities,
Some(
"Warning: The session has more queued validators than expected. \
A runtime configuration adjustment may be needed.",
),
);
let next_authorities =
WeakBoundedVec::<_, C::MaxAuthorities>::try_from(next_authorities).unwrap();

// get the current session index
let session = Self::session(network).unwrap().0;

BabePallet::<C>::enact_epoch_change(authorities, next_authorities, Some(session))
}
}
Expand Down

0 comments on commit cecd845

Please sign in to comment.