diff --git a/src/ffi.rs b/src/ffi.rs index d8a8b67..fc68648 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -10,7 +10,6 @@ use alloc::{ alloc::{alloc, dealloc, Layout}, vec::Vec, }; -use core::mem; use dusk_bytes::Serializable; use phoenix_core::{Fee, Note, SecretKey, ViewKey}; @@ -419,11 +418,11 @@ pub fn nullifiers(args: i32, len: i32) -> i64 { core::array::from_fn(|i| key::derive_vk(&seed, i as _)); for note in notes { - let Some(vk_idx) = vks.iter().position(|vk| vk.owns(¬e)) else { + let Some(idx) = vks.iter().position(|vk| vk.owns(¬e)) else { return utils::fail(); }; - nullifiers.push(note.gen_nullifier(&sks[vk_idx])); + nullifiers.push(note.gen_nullifier(&sks[idx])); } utils::rkyv_into_ptr(nullifiers) diff --git a/tests/wallet.rs b/tests/wallet.rs index 12cfce3..05bab7d 100644 --- a/tests/wallet.rs +++ b/tests/wallet.rs @@ -336,7 +336,7 @@ mod node { .into_iter() .map(|value| { let obfuscated = (rng.next_u32() & 1) == 1; - let idx = rng.next_u64() % (MAX_KEY) as u64; + let idx = rng.next_u64() % MAX_KEY as u64; let sk = key::derive_sk(seed, idx); let pk = PublicKey::from(&sk);