Skip to content

Commit

Permalink
rusk-wallet: change try_input_notes with pick_notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZER0 committed Sep 9, 2024
1 parent c98fbcd commit eac107b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions rusk-wallet/src/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ use execution_core::{
transfer::{phoenix::Prove, Transaction},
Error as ExecutionCoreError,
};

use execution_core::transfer::phoenix::{Note, NoteLeaf};

use flume::Receiver;
use tokio::time::{sleep, Duration};
use wallet_core::{
input::try_input_notes,
keys::{derive_phoenix_pk, derive_phoenix_sk, derive_phoenix_vk},
pick_notes,
};
use zeroize::Zeroize;

Expand Down Expand Up @@ -194,19 +197,19 @@ impl State {
.into_iter()
.map(|data| {
let note = data.note;
let nullifiers = note.gen_nullifier(&sk);
let value = note.value(Some(&vk)).unwrap();

Ok((note, value, nullifiers))
let block_height = data.height;
let nullifier = note.gen_nullifier(&sk);
let leaf = NoteLeaf { note, block_height };
Ok((nullifier, leaf))
})
.collect();

let inputs = try_input_notes(inputs?, target)
let inputs = pick_notes(&vk, inputs?.into(), target)
.into_iter()
.map(|(note, scalar)| {
let opening = self.fetch_opening(&note)?;
.map(|(scalar, note)| {
let opening = self.fetch_opening(note.as_ref())?;

Ok((note, opening, scalar))
Ok((note.note.clone(), opening, *scalar))
})
.collect();

Expand Down

0 comments on commit eac107b

Please sign in to comment.