mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 21:19:24 +00:00
Remove potentially-failing unchecked arithmetic operations for ones which error
In response to 9.13.3. Requires a bump to Rust 1.82 to take advantage of `Option::is_none_or`.
This commit is contained in:
@@ -343,7 +343,13 @@ impl RctPrunable {
|
||||
Ok(match rct_type {
|
||||
RctType::AggregateMlsagBorromean => RctPrunable::AggregateMlsagBorromean {
|
||||
borromean: read_raw_vec(BorromeanRange::read, outputs, r)?,
|
||||
mlsag: Mlsag::read(ring_length, inputs + 1, r)?,
|
||||
mlsag: Mlsag::read(
|
||||
ring_length,
|
||||
inputs.checked_add(1).ok_or_else(|| {
|
||||
io::Error::other("reading a MLSAG for more inputs than representable")
|
||||
})?,
|
||||
r,
|
||||
)?,
|
||||
},
|
||||
RctType::MlsagBorromean => RctPrunable::MlsagBorromean {
|
||||
borromean: read_raw_vec(BorromeanRange::read, outputs, r)?,
|
||||
|
||||
Reference in New Issue
Block a user