mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Remove .is_some() unwraps for if let Some
This commit is contained in:
@@ -60,6 +60,9 @@ impl Curve for Ed25519 {
|
||||
dfg::EdwardsPoint(DPoint::vartime_multiscalar_mul(scalars, points))
|
||||
}
|
||||
|
||||
// This, as used by CLSAG, will already be a keccak256 hash
|
||||
// The only necessity is for this to be unique, which means skipping a hash here should be fine accordingly
|
||||
// TODO: Decide
|
||||
fn hash_msg(msg: &[u8]) -> Vec<u8> {
|
||||
Blake2b512::digest(msg).to_vec()
|
||||
}
|
||||
|
||||
@@ -79,11 +79,11 @@ pub struct SpendableOutput {
|
||||
|
||||
pub fn scan(tx: &Transaction, view: Scalar, spend: EdwardsPoint) -> Vec<SpendableOutput> {
|
||||
let mut pubkeys = vec![];
|
||||
if tx.tx_pubkey().is_some() {
|
||||
pubkeys.push(tx.tx_pubkey().unwrap());
|
||||
if let Some(key) = tx.tx_pubkey() {
|
||||
pubkeys.push(key);
|
||||
}
|
||||
if tx.tx_additional_pubkeys().is_some() {
|
||||
pubkeys.extend(&tx.tx_additional_pubkeys().unwrap());
|
||||
if let Some(keys) = tx.tx_additional_pubkeys() {
|
||||
pubkeys.extend(&keys);
|
||||
}
|
||||
let pubkeys: Vec<EdwardsPoint> = pubkeys.iter().map(|key| key.point.decompress()).filter_map(|key| key).collect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user