mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-12 05:59:23 +00:00
Response to usage of unwrap in non-test code
This commit replaces all usage of `unwrap` with `expect` within `networks/monero`, clarifying why the panic risked is unreachable. This commit also replaces some uses of `unwrap` with solutions which are guaranteed not to fail. Notably, compilation on 128-bit systems is prevented, ensuring `u64::try_from(usize::MAX)` will never panic at runtime. Slight breaking changes are additionally included as necessary to massage out some avoidable panics.
This commit is contained in:
@@ -227,8 +227,11 @@ impl<'a> AggregateRangeStatement<'a> {
|
||||
let x_ip = transcript;
|
||||
|
||||
let ip = IpStatement::new_without_P_transcript(y_inv_pow_n, x_ip)
|
||||
.prove(transcript, IpWitness::new(l, r).unwrap())
|
||||
.unwrap();
|
||||
.prove(
|
||||
transcript,
|
||||
IpWitness::new(l, r).expect("Bulletproofs::Original created an invalid IpWitness"),
|
||||
)
|
||||
.expect("Bulletproofs::Original failed to prove the inner-product");
|
||||
|
||||
let res = AggregateRangeProof { A, S, T1, T2, tau_x, mu, t_hat, ip };
|
||||
#[cfg(debug_assertions)]
|
||||
|
||||
Reference in New Issue
Block a user