mirror of https://github.com/zcash/orchard.git
commit
2f2b9e5891
|
@ -135,12 +135,7 @@ impl ActionInfo {
|
||||||
let alpha = pallas::Scalar::random(&mut rng);
|
let alpha = pallas::Scalar::random(&mut rng);
|
||||||
let rk = ak.randomize(&alpha);
|
let rk = ak.randomize(&alpha);
|
||||||
|
|
||||||
let note = Note::new(
|
let note = Note::new(self.output.recipient, self.output.value, nf_old, rng);
|
||||||
self.output.recipient,
|
|
||||||
self.output.value,
|
|
||||||
nf_old.clone(),
|
|
||||||
rng,
|
|
||||||
);
|
|
||||||
let cm_new = note.commitment();
|
let cm_new = note.commitment();
|
||||||
|
|
||||||
// TODO: Note encryption
|
// TODO: Note encryption
|
||||||
|
@ -542,7 +537,7 @@ pub mod testing {
|
||||||
recipient_amounts in vec(
|
recipient_amounts in vec(
|
||||||
arb_address().prop_flat_map(move |a| {
|
arb_address().prop_flat_map(move |a| {
|
||||||
arb_positive_note_value(MAX_NOTE_VALUE / n_recipients as u64)
|
arb_positive_note_value(MAX_NOTE_VALUE / n_recipients as u64)
|
||||||
.prop_map(move |v| (a.clone(), v))
|
.prop_map(move |v| (a, v))
|
||||||
}),
|
}),
|
||||||
n_recipients as usize
|
n_recipients as usize
|
||||||
),
|
),
|
||||||
|
|
|
@ -112,7 +112,7 @@ impl<T> Action<T> {
|
||||||
Instance {
|
Instance {
|
||||||
anchor,
|
anchor,
|
||||||
cv_net: self.cv_net.clone(),
|
cv_net: self.cv_net.clone(),
|
||||||
nf_old: self.nf.clone(),
|
nf_old: self.nf,
|
||||||
rk: self.rk.clone(),
|
rk: self.rk.clone(),
|
||||||
cmx: self.cmx.clone(),
|
cmx: self.cmx.clone(),
|
||||||
enable_spend: flags.spends_enabled,
|
enable_spend: flags.spends_enabled,
|
||||||
|
|
|
@ -197,7 +197,7 @@ mod tests {
|
||||||
let alpha = pallas::Scalar::random(&mut rng);
|
let alpha = pallas::Scalar::random(&mut rng);
|
||||||
let rk = ak.randomize(&alpha);
|
let rk = ak.randomize(&alpha);
|
||||||
|
|
||||||
let (_, _, output_note) = Note::dummy(&mut rng, Some(nf_old.clone()));
|
let (_, _, output_note) = Note::dummy(&mut rng, Some(nf_old));
|
||||||
let cmx = output_note.commitment().into();
|
let cmx = output_note.commitment().into();
|
||||||
|
|
||||||
let value = spent_note.value() - output_note.value();
|
let value = spent_note.value() - output_note.value();
|
||||||
|
|
|
@ -421,7 +421,7 @@ impl DiversifiedTransmissionKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// $repr_P(self)$
|
/// $repr_P(self)$
|
||||||
pub(crate) fn to_bytes(&self) -> [u8; 32] {
|
pub(crate) fn to_bytes(self) -> [u8; 32] {
|
||||||
self.0.to_bytes()
|
self.0.to_bytes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ impl Nullifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Serialize the nullifier to its canonical byte representation.
|
/// Serialize the nullifier to its canonical byte representation.
|
||||||
pub fn to_bytes(&self) -> [u8; 32] {
|
pub fn to_bytes(self) -> [u8; 32] {
|
||||||
self.0.to_bytes()
|
self.0.to_bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue