Skip to content

Commit

Permalink
Removes unwrap from compute_tally
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco authored and bengtlofgren committed May 11, 2023
1 parent a856ae5 commit aa7bdd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shared/src/ledger/native_vp/governance/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,11 @@ pub fn compute_tally(
.into_iter()
.max_by(|a, b| a.1.cmp(&b.1))
.map(|(vote, _)| vote.to_owned())
.unwrap(); // Cannot be None at this point
.ok_or_else(|| {
Error::Tally(
"Missing expected elected council".to_string(),
)
})?;

Ok(ProposalResult {
result: TallyResult::Passed(Tally::PGFCouncil(council)),
Expand Down

0 comments on commit aa7bdd3

Please sign in to comment.