diff --git a/polkadot/runtime/westend/src/genesis_config_presets.rs b/polkadot/runtime/westend/src/genesis_config_presets.rs index f65c975327e6..b4b3e3427447 100644 --- a/polkadot/runtime/westend/src/genesis_config_presets.rs +++ b/polkadot/runtime/westend/src/genesis_config_presets.rs @@ -205,7 +205,7 @@ fn westend_testnet_genesis( invulnerables: BoundedVec::try_from( initial_authorities.iter().map(|x| x.0.clone()).collect::>() ) - .expect("Too many invulnerable validators!"), + .expect("Too many invulnerable validators: upper limit is MaxInvulnerables from pallet staking config"), force_era: Forcing::NotForcing, slash_reward_fraction: Perbill::from_percent(10), }, @@ -379,7 +379,7 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value { invulnerables: BoundedVec::try_from( initial_authorities.iter().map(|x| x.0.clone()).collect::>() ) - .expect("Too many invulnerable validators!"), + .expect("Too many invulnerable validators: upper limit is MaxInvulnerables from pallet staking config"), force_era: Forcing::ForceNone, slash_reward_fraction: Perbill::from_percent(10), }, diff --git a/substrate/bin/node/testing/src/genesis.rs b/substrate/bin/node/testing/src/genesis.rs index 778b39c9d143..376c2bf343e5 100644 --- a/substrate/bin/node/testing/src/genesis.rs +++ b/substrate/bin/node/testing/src/genesis.rs @@ -66,7 +66,7 @@ pub fn config_endowed(extra_endowed: Vec) -> RuntimeGenesisConfig { minimum_validator_count: 0, slash_reward_fraction: Perbill::from_percent(10), invulnerables: BoundedVec::try_from(vec![alice(), bob(), charlie()]) - .expect("Too many invulnerable validators!"), + .expect("Too many invulnerable validators: upper limit is MaxInvulnerables from pallet staking config"), ..Default::default() }, society: SocietyConfig { pot: 0 }, diff --git a/substrate/frame/staking/src/mock.rs b/substrate/frame/staking/src/mock.rs index 616aaa0f1ba3..ed90d5584af0 100644 --- a/substrate/frame/staking/src/mock.rs +++ b/substrate/frame/staking/src/mock.rs @@ -378,8 +378,8 @@ impl ExtBuilder { self } pub fn invulnerables(mut self, invulnerables: Vec) -> Self { - self.invulnerables = - BoundedVec::try_from(invulnerables).expect("Too many invulnerable validators!"); + self.invulnerables = BoundedVec::try_from(invulnerables) + .expect("Too many invulnerable validators: upper limit is MaxInvulnerables"); self } pub fn session_per_era(self, length: SessionIndex) -> Self {