mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Use ok_or_else instead of ok_or in a couple places in Monero
This commit is contained in:
@@ -115,7 +115,7 @@ impl Metadata {
|
|||||||
let subaddress = if read_byte(r)? == 1 {
|
let subaddress = if read_byte(r)? == 1 {
|
||||||
Some(
|
Some(
|
||||||
SubaddressIndex::new(read_u32(r)?, read_u32(r)?)
|
SubaddressIndex::new(read_u32(r)?, read_u32(r)?)
|
||||||
.ok_or(io::Error::new(io::ErrorKind::Other, "invalid subaddress in metadata"))?,
|
.ok_or_else(|| io::Error::new(io::ErrorKind::Other, "invalid subaddress in metadata"))?,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ impl SignableTransaction {
|
|||||||
let clsag = ClsagMultisig::new(transcript.clone(), input.key(), inputs[i].clone());
|
let clsag = ClsagMultisig::new(transcript.clone(), input.key(), inputs[i].clone());
|
||||||
key_images.push((
|
key_images.push((
|
||||||
clsag.H,
|
clsag.H,
|
||||||
keys.current_offset().unwrap_or(dfg::Scalar::zero()).0 + self.inputs[i].key_offset(),
|
keys.current_offset().unwrap_or_else(dfg::Scalar::zero).0 + self.inputs[i].key_offset(),
|
||||||
));
|
));
|
||||||
clsags.push(AlgorithmMachine::new(clsag, offset).map_err(TransactionError::FrostError)?);
|
clsags.push(AlgorithmMachine::new(clsag, offset).map_err(TransactionError::FrostError)?);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user