mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-16 17:07:35 +00:00
Use ok_or_else instead of ok_or in a couple places in Monero
This commit is contained in:
parent
422a562c78
commit
8ffa5553ff
2 changed files with 2 additions and 2 deletions
|
@ -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)?);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue