Skip to content

Commit

Permalink
refactor(runtime-eden): use ? instead of unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
aliXsed committed Mar 24, 2023
1 parent 43fadd6 commit b966d75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtimes/eden/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ impl OnRuntimeUpgrade for MoveValidatorsSetToInvulnerables {
"CollatorSelection::candidacy_bond is {:?}",
candidacy_bond
);
let validators: BoundedVec<AccountId, MaxMembers> = Decode::decode(&mut state.as_slice()).unwrap();
let validators: BoundedVec<AccountId, MaxMembers> =
Decode::decode(&mut state.as_slice()).map_err(|_| "Failed to decode validators")?;
if invulnerables != validators || candidacy_bond != CANDIDACY_BOND {
return Err("CollatorSelection::Invulnerables are not the same as ValidatorsSet::Members");
}
Expand Down

0 comments on commit b966d75

Please sign in to comment.