mirror of https://github.com/zcash/orchard.git
reformated file
This commit is contained in:
parent
58158f5f96
commit
48779d582f
|
@ -152,7 +152,13 @@ impl ActionInfo {
|
|||
let rk = ak.randomize(&alpha);
|
||||
let note_type = self.spend.note.note_type();
|
||||
|
||||
let note = Note::new(self.output.recipient, self.output.value, note_type, nf_old, &mut rng);
|
||||
let note = Note::new(
|
||||
self.output.recipient,
|
||||
self.output.value,
|
||||
note_type,
|
||||
nf_old,
|
||||
&mut rng,
|
||||
);
|
||||
let cm_new = note.commitment();
|
||||
let cmx = cm_new.into();
|
||||
|
||||
|
|
|
@ -962,12 +962,12 @@ mod tests {
|
|||
testing::{arb_diversifier_index, arb_diversifier_key, arb_esk, arb_spending_key},
|
||||
*,
|
||||
};
|
||||
use crate::note::NoteType;
|
||||
use crate::{
|
||||
note::{ExtractedNoteCommitment, Nullifier, RandomSeed},
|
||||
value::NoteValue,
|
||||
Note,
|
||||
};
|
||||
use crate::note::NoteType;
|
||||
|
||||
#[test]
|
||||
fn spend_validating_key_from_bytes() {
|
||||
|
|
|
@ -280,10 +280,10 @@ impl fmt::Debug for TransmittedNoteCiphertext {
|
|||
pub mod testing {
|
||||
use proptest::prelude::*;
|
||||
|
||||
use crate::note::NoteType;
|
||||
use crate::{
|
||||
address::testing::arb_address, note::nullifier::testing::arb_nullifier, value::NoteValue,
|
||||
};
|
||||
use crate::note::NoteType;
|
||||
|
||||
use super::{Note, RandomSeed};
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use group::{ff::PrimeField};
|
||||
use group::ff::PrimeField;
|
||||
use halo2_proofs::arithmetic::CurveExt;
|
||||
use pasta_curves::pallas;
|
||||
use subtle::CtOption;
|
||||
|
||||
use crate:: spec::{extract_p};
|
||||
use crate::constants::fixed_bases::{VALUE_COMMITMENT_PERSONALIZATION, VALUE_COMMITMENT_V_BYTES};
|
||||
use crate::spec::extract_p;
|
||||
// use crate::keys::SpendValidatingKey;
|
||||
|
||||
/// Note type identifier.
|
||||
|
@ -35,9 +35,7 @@ impl NoteType {
|
|||
///
|
||||
/// [notetypes]: https://zips.z.cash/protocol/nu5.pdf#notetypes
|
||||
#[allow(non_snake_case)]
|
||||
pub(super) fn derive(
|
||||
asset_idx: u64
|
||||
) -> Self {
|
||||
pub(super) fn derive(asset_idx: u64) -> Self {
|
||||
let hasher = pallas::Point::hash_to_curve(VALUE_COMMITMENT_PERSONALIZATION);
|
||||
let V = hasher(&VALUE_COMMITMENT_V_BYTES);
|
||||
|
||||
|
@ -50,7 +48,6 @@ impl NoteType {
|
|||
pub fn native() -> Self {
|
||||
Self::derive(1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Generators for property testing.
|
||||
|
|
|
@ -10,6 +10,7 @@ use zcash_note_encryption::{
|
|||
OUT_PLAINTEXT_SIZE,
|
||||
};
|
||||
|
||||
use crate::note::NoteType;
|
||||
use crate::{
|
||||
action::Action,
|
||||
keys::{
|
||||
|
@ -21,7 +22,6 @@ use crate::{
|
|||
value::{NoteValue, ValueCommitment},
|
||||
Address, Note,
|
||||
};
|
||||
use crate::note::NoteType;
|
||||
|
||||
const PRF_OCK_ORCHARD_PERSONALIZATION: &[u8; 16] = b"Zcash_Orchardock";
|
||||
|
||||
|
@ -319,6 +319,7 @@ mod tests {
|
|||
};
|
||||
|
||||
use super::{prf_ock_orchard, CompactAction, OrchardDomain, OrchardNoteEncryption};
|
||||
use crate::note::NoteType;
|
||||
use crate::{
|
||||
action::Action,
|
||||
keys::{
|
||||
|
@ -330,7 +331,6 @@ mod tests {
|
|||
value::{NoteValue, ValueCommitment},
|
||||
Address, Note,
|
||||
};
|
||||
use crate::note::NoteType;
|
||||
|
||||
#[test]
|
||||
fn test_vectors() {
|
||||
|
|
Loading…
Reference in New Issue