Skip to content

Commit

Permalink
expand errors msg for invulnerables
Browse files Browse the repository at this point in the history
  • Loading branch information
re-gius committed Dec 19, 2024
1 parent 30520af commit 0d47dc5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions polkadot/runtime/westend/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn westend_testnet_genesis(
invulnerables: BoundedVec::try_from(
initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>()
)
.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),
},
Expand Down Expand Up @@ -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::<Vec<_>>()
)
.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),
},
Expand Down
2 changes: 1 addition & 1 deletion substrate/bin/node/testing/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub fn config_endowed(extra_endowed: Vec<AccountId>) -> 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 },
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 @@ -378,8 +378,8 @@ impl ExtBuilder {
self
}
pub fn invulnerables(mut self, invulnerables: Vec<AccountId>) -> 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 {
Expand Down

0 comments on commit 0d47dc5

Please sign in to comment.