From cecd84579eb91caef43cf0de8292eb5b89730072 Mon Sep 17 00:00:00 2001 From: akildemir Date: Sun, 29 Oct 2023 15:23:47 +0300 Subject: [PATCH] unwrap on WeakBoundedVec --- substrate/validator-sets/pallet/src/lib.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/substrate/validator-sets/pallet/src/lib.rs b/substrate/validator-sets/pallet/src/lib.rs index 750253352..7710b4b4b 100644 --- a/substrate/validator-sets/pallet/src/lib.rs +++ b/substrate/validator-sets/pallet/src/lib.rs @@ -803,17 +803,12 @@ pub mod pallet { (AuthorityId::from(*id), allocation / allocation_per_key_share) }) .collect::>(); - - 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::::enact_epoch_change(authorities, next_authorities, Some(session)) } }