Use map_err() when handling multiopen::Proof::create()

Co-authored-by: Daira Hopwood <daira@electriccoin.co>
This commit is contained in:
therealyingtong 2020-10-08 12:15:46 +08:00
parent 5181ca56f1
commit 89fd6e4d44
1 changed files with 16 additions and 18 deletions

View File

@ -551,24 +551,22 @@ impl<C: CurveAffine> Proof<C> {
}
}
if let Ok(multiopening) =
let multiopening =
multiopen::Proof::create(params, &mut transcript, &mut transcript_scalar, instances)
{
Ok(Proof {
advice_commitments,
h_commitments,
permutation_product_commitments,
permutation_product_evals,
permutation_product_inv_evals,
permutation_evals,
advice_evals,
fixed_evals,
aux_evals,
h_evals,
multiopening,
})
} else {
Err(Error::OpeningError)
}
.map_err(|_| Error::OpeningError)?;
Ok(Proof {
advice_commitments,
h_commitments,
permutation_product_commitments,
permutation_product_evals,
permutation_product_inv_evals,
permutation_evals,
advice_evals,
fixed_evals,
aux_evals,
h_evals,
multiopening,
})
}
}