cargo fix --edition for zcash_primitives

This commit is contained in:
Eirik Ogilvie-Wigley
2019-08-20 16:54:11 -06:00
parent e12d315ab9
commit b0d8747697
15 changed files with 31 additions and 31 deletions

View File

@@ -4,7 +4,7 @@ use std::fmt;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::ops::Deref; use std::ops::Deref;
use serialize::Vector; use crate::serialize::Vector;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct BlockHash(pub [u8; 32]); pub struct BlockHash(pub [u8; 32]);

View File

@@ -1,9 +1,9 @@
use jubjub::{edwards, JubjubEngine, PrimeOrder}; use crate::jubjub::{edwards, JubjubEngine, PrimeOrder};
use ff::PrimeField; use ff::PrimeField;
use blake2s_simd::Params; use blake2s_simd::Params;
use constants; use crate::constants;
/// Produces a random point in the Jubjub curve. /// Produces a random point in the Jubjub curve.
/// The point is guaranteed to be prime order /// The point is guaranteed to be prime order

View File

@@ -75,9 +75,9 @@ pub struct FsRepr(pub [u64; 4]);
impl ::std::fmt::Display for FsRepr { impl ::std::fmt::Display for FsRepr {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
try!(write!(f, "0x")); r#try!(write!(f, "0x"));
for i in self.0.iter().rev() { for i in self.0.iter().rev() {
try!(write!(f, "{:016x}", *i)); r#try!(write!(f, "{:016x}", *i));
} }
Ok(()) Ok(())

View File

@@ -20,9 +20,9 @@
use ff::{Field, PrimeField, SqrtField}; use ff::{Field, PrimeField, SqrtField};
use pairing::Engine; use pairing::Engine;
use group_hash::group_hash; use crate::group_hash::group_hash;
use constants; use crate::constants;
use pairing::bls12_381::{Bls12, Fr}; use pairing::bls12_381::{Bls12, Fr};
@@ -122,7 +122,7 @@ pub trait JubjubParams<E: JubjubEngine>: Sized {
fn generator(&self, base: FixedGenerators) -> &edwards::Point<E, PrimeOrder>; fn generator(&self, base: FixedGenerators) -> &edwards::Point<E, PrimeOrder>;
/// Returns a window table [0, 1, ..., 8] for different magnitudes of some /// Returns a window table [0, 1, ..., 8] for different magnitudes of some
/// fixed generator. /// fixed generator.
fn circuit_generators(&self, FixedGenerators) -> &[Vec<(E::Fr, E::Fr)>]; fn circuit_generators(&self, _: FixedGenerators) -> &[Vec<(E::Fr, E::Fr)>];
/// Returns the window size for exponentiation of Pedersen hash generators /// Returns the window size for exponentiation of Pedersen hash generators
/// outside the circuit /// outside the circuit
fn pedersen_hash_exp_window_size() -> u32; fn pedersen_hash_exp_window_size() -> u32;

View File

@@ -43,7 +43,7 @@ pub mod zip32;
#[cfg(test)] #[cfg(test)]
mod test_vectors; mod test_vectors;
use jubjub::JubjubBls12; use crate::jubjub::JubjubBls12;
lazy_static! { lazy_static! {
pub static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() }; pub static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() };

View File

@@ -5,8 +5,8 @@ use std::collections::VecDeque;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::iter; use std::iter;
use sapling::SAPLING_COMMITMENT_TREE_DEPTH; use crate::sapling::SAPLING_COMMITMENT_TREE_DEPTH;
use serialize::{Optional, Vector}; use crate::serialize::{Optional, Vector};
/// A hashable node within a Merkle tree. /// A hashable node within a Merkle tree.
pub trait Hashable: Clone + Copy { pub trait Hashable: Clone + Copy {
@@ -17,13 +17,13 @@ pub trait Hashable: Clone + Copy {
fn write<W: Write>(&self, writer: W) -> io::Result<()>; fn write<W: Write>(&self, writer: W) -> io::Result<()>;
/// Returns the parent node within the tree of the two given nodes. /// Returns the parent node within the tree of the two given nodes.
fn combine(usize, &Self, &Self) -> Self; fn combine(_: usize, _: &Self, _: &Self) -> Self;
/// Returns a blank leaf node. /// Returns a blank leaf node.
fn blank() -> Self; fn blank() -> Self;
/// Returns the empty root for the given depth. /// Returns the empty root for the given depth.
fn empty_root(usize) -> Self; fn empty_root(_: usize) -> Self;
} }
struct PathFiller<Node: Hashable> { struct PathFiller<Node: Hashable> {
@@ -509,7 +509,7 @@ impl<Node: Hashable> CommitmentTreeWitness<Node> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::{CommitmentTree, CommitmentTreeWitness, Hashable, IncrementalWitness, PathFiller}; use super::{CommitmentTree, CommitmentTreeWitness, Hashable, IncrementalWitness, PathFiller};
use sapling::Node; use crate::sapling::Node;
use ff::PrimeFieldRepr; use ff::PrimeFieldRepr;
use hex; use hex;

View File

@@ -1,5 +1,5 @@
use ff::{Field, PrimeField, PrimeFieldRepr}; use ff::{Field, PrimeField, PrimeFieldRepr};
use jubjub::*; use crate::jubjub::*;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum Personalization { pub enum Personalization {

View File

@@ -1,14 +1,14 @@
use ff::{Field, PrimeField, PrimeFieldRepr}; use ff::{Field, PrimeField, PrimeFieldRepr};
use constants; use crate::constants;
use group_hash::group_hash; use crate::group_hash::group_hash;
use pedersen_hash::{pedersen_hash, Personalization}; use crate::pedersen_hash::{pedersen_hash, Personalization};
use byteorder::{LittleEndian, WriteBytesExt}; use byteorder::{LittleEndian, WriteBytesExt};
use jubjub::{edwards, FixedGenerators, JubjubEngine, JubjubParams, PrimeOrder}; use crate::jubjub::{edwards, FixedGenerators, JubjubEngine, JubjubParams, PrimeOrder};
use blake2s_simd::Params as Blake2sParams; use blake2s_simd::Params as Blake2sParams;

View File

@@ -6,7 +6,7 @@ use ff::{Field, PrimeField, PrimeFieldRepr};
use rand_core::RngCore; use rand_core::RngCore;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use util::hash_to_scalar; use crate::util::hash_to_scalar;
fn read_scalar<E: JubjubEngine, R: Read>(reader: R) -> io::Result<E::Fs> { fn read_scalar<E: JubjubEngine, R: Read>(reader: R) -> io::Result<E::Fs> {
let mut s_repr = <E::Fs as PrimeField>::Repr::default(); let mut s_repr = <E::Fs as PrimeField>::Repr::default();

View File

@@ -12,7 +12,7 @@ use std::io::{self, Read, Write};
use crate::merkle_tree::Hashable; use crate::merkle_tree::Hashable;
use crate::redjubjub::{PrivateKey, PublicKey, Signature}; use crate::redjubjub::{PrivateKey, PublicKey, Signature};
use JUBJUB; use crate::JUBJUB;
pub const SAPLING_COMMITMENT_TREE_DEPTH: usize = 32; pub const SAPLING_COMMITMENT_TREE_DEPTH: usize = 32;

View File

@@ -7,7 +7,7 @@ use crate::{
use ff::Field; use ff::Field;
use pairing::bls12_381::{Bls12, Fr}; use pairing::bls12_381::{Bls12, Fr};
use rand::{rngs::OsRng, seq::SliceRandom, CryptoRng, RngCore}; use rand::{rngs::OsRng, seq::SliceRandom, CryptoRng, RngCore};
use zip32::ExtendedSpendingKey; use crate::zip32::ExtendedSpendingKey;
use crate::{ use crate::{
keys::OutgoingViewingKey, keys::OutgoingViewingKey,

View File

@@ -4,9 +4,9 @@ use ff::{PrimeField, PrimeFieldRepr};
use pairing::bls12_381::{Bls12, Fr, FrRepr}; use pairing::bls12_381::{Bls12, Fr, FrRepr};
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use legacy::Script; use crate::legacy::Script;
use redjubjub::{PublicKey, Signature}; use crate::redjubjub::{PublicKey, Signature};
use JUBJUB; use crate::JUBJUB;
pub mod amount; pub mod amount;
pub use self::amount::Amount; pub use self::amount::Amount;

View File

@@ -5,8 +5,8 @@ use std::fmt;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::ops::Deref; use std::ops::Deref;
use redjubjub::Signature; use crate::redjubjub::Signature;
use serialize::Vector; use crate::serialize::Vector;
pub mod builder; pub mod builder;
pub mod components; pub mod components;

View File

@@ -7,7 +7,7 @@ use super::{
Transaction, TransactionData, OVERWINTER_VERSION_GROUP_ID, SAPLING_TX_VERSION, Transaction, TransactionData, OVERWINTER_VERSION_GROUP_ID, SAPLING_TX_VERSION,
SAPLING_VERSION_GROUP_ID, SAPLING_VERSION_GROUP_ID,
}; };
use legacy::Script; use crate::legacy::Script;
const ZCASH_SIGHASH_PERSONALIZATION_PREFIX: &'static [u8; 12] = b"ZcashSigHash"; const ZCASH_SIGHASH_PERSONALIZATION_PREFIX: &'static [u8; 12] = b"ZcashSigHash";
const ZCASH_PREVOUTS_HASH_PERSONALIZATION: &'static [u8; 16] = b"ZcashPrevoutHash"; const ZCASH_PREVOUTS_HASH_PERSONALIZATION: &'static [u8; 16] = b"ZcashPrevoutHash";

View File

@@ -5,9 +5,9 @@ use rand_os::OsRng;
use crate::jubjub::{fs::Fs, FixedGenerators}; use crate::jubjub::{fs::Fs, FixedGenerators};
use super::{components::Amount, sighash::signature_hash, Transaction, TransactionData}; use super::{components::Amount, sighash::signature_hash, Transaction, TransactionData};
use legacy::Script; use crate::legacy::Script;
use redjubjub::PrivateKey; use crate::redjubjub::PrivateKey;
use JUBJUB; use crate::JUBJUB;
#[test] #[test]
fn tx_read_write() { fn tx_read_write() {