Browse Source

Merge #397

397: Replace `expect` with `context` to avoid panics r=thomaseizinger a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
hotfix/0.1.1
bors[bot] 3 years ago
committed by GitHub
parent
commit
4459c9ebfa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      daemon/src/setup_contract.rs

9
daemon/src/setup_contract.rs

@ -578,7 +578,12 @@ fn verify_cets(
let other_encsig = cets let other_encsig = cets
.iter() .iter()
.find_map(|(range, encsig)| (range == &digits.range()).then(|| encsig)) .find_map(|(range, encsig)| (range == &digits.range()).then(|| encsig))
.expect("one encsig per cet, per party"); .with_context(|| {
format!(
"no enc sig from other party for price range {:?}",
digits.range()
)
})?;
verify_cet_encsig( verify_cet_encsig(
tx, tx,
@ -589,7 +594,7 @@ fn verify_cets(
commit_desc, commit_desc,
commit_amount, commit_amount,
) )
.expect("valid maker cet encsig") .context("enc sig on CET does not verify")?;
} }
Ok(()) Ok(())
} }

Loading…
Cancel
Save