Skip to content

Commit

Permalink
Use a functional approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Daksh14 committed Jun 10, 2024
1 parent 397a35a commit de0531b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Binary file modified assets/dusk_wallet_core.wasm
Binary file not shown.
11 changes: 4 additions & 7 deletions src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,11 @@ pub fn nullifiers(args: i32, len: i32) -> i64 {
core::array::from_fn(|i| key::derive_vk(&seed, i as _));

for note in notes {
for idx in 0..MAX_KEY {
if vks[idx].owns(&note) {
nullifiers.push(note.gen_nullifier(&sks[idx]));
break;
}
}
let Some(vk_idx) = vks.iter().position(|vk| vk.owns(&note)) else {
return utils::fail();
};

return utils::fail();
nullifiers.push(note.gen_nullifier(&sks[vk_idx]));
}

utils::rkyv_into_ptr(nullifiers)
Expand Down

0 comments on commit de0531b

Please sign in to comment.