mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-11 17:55:46 +00:00
cargo fix --edition for zcash_primitives
This commit is contained in:
parent
e12d315ab9
commit
b0d8747697
@ -4,7 +4,7 @@ use std::fmt;
|
||||
use std::io::{self, Read, Write};
|
||||
use std::ops::Deref;
|
||||
|
||||
use serialize::Vector;
|
||||
use crate::serialize::Vector;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct BlockHash(pub [u8; 32]);
|
||||
|
@ -1,9 +1,9 @@
|
||||
use jubjub::{edwards, JubjubEngine, PrimeOrder};
|
||||
use crate::jubjub::{edwards, JubjubEngine, PrimeOrder};
|
||||
|
||||
use ff::PrimeField;
|
||||
|
||||
use blake2s_simd::Params;
|
||||
use constants;
|
||||
use crate::constants;
|
||||
|
||||
/// Produces a random point in the Jubjub curve.
|
||||
/// The point is guaranteed to be prime order
|
||||
|
@ -75,9 +75,9 @@ pub struct FsRepr(pub [u64; 4]);
|
||||
|
||||
impl ::std::fmt::Display for FsRepr {
|
||||
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() {
|
||||
try!(write!(f, "{:016x}", *i));
|
||||
r#try!(write!(f, "{:016x}", *i));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -20,9 +20,9 @@
|
||||
use ff::{Field, PrimeField, SqrtField};
|
||||
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};
|
||||
|
||||
@ -122,7 +122,7 @@ pub trait JubjubParams<E: JubjubEngine>: Sized {
|
||||
fn generator(&self, base: FixedGenerators) -> &edwards::Point<E, PrimeOrder>;
|
||||
/// Returns a window table [0, 1, ..., 8] for different magnitudes of some
|
||||
/// 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
|
||||
/// outside the circuit
|
||||
fn pedersen_hash_exp_window_size() -> u32;
|
||||
|
@ -43,7 +43,7 @@ pub mod zip32;
|
||||
#[cfg(test)]
|
||||
mod test_vectors;
|
||||
|
||||
use jubjub::JubjubBls12;
|
||||
use crate::jubjub::JubjubBls12;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref JUBJUB: JubjubBls12 = { JubjubBls12::new() };
|
||||
|
@ -5,8 +5,8 @@ use std::collections::VecDeque;
|
||||
use std::io::{self, Read, Write};
|
||||
use std::iter;
|
||||
|
||||
use sapling::SAPLING_COMMITMENT_TREE_DEPTH;
|
||||
use serialize::{Optional, Vector};
|
||||
use crate::sapling::SAPLING_COMMITMENT_TREE_DEPTH;
|
||||
use crate::serialize::{Optional, Vector};
|
||||
|
||||
/// A hashable node within a Merkle tree.
|
||||
pub trait Hashable: Clone + Copy {
|
||||
@ -17,13 +17,13 @@ pub trait Hashable: Clone + Copy {
|
||||
fn write<W: Write>(&self, writer: W) -> io::Result<()>;
|
||||
|
||||
/// 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.
|
||||
fn blank() -> Self;
|
||||
|
||||
/// Returns the empty root for the given depth.
|
||||
fn empty_root(usize) -> Self;
|
||||
fn empty_root(_: usize) -> Self;
|
||||
}
|
||||
|
||||
struct PathFiller<Node: Hashable> {
|
||||
@ -509,7 +509,7 @@ impl<Node: Hashable> CommitmentTreeWitness<Node> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{CommitmentTree, CommitmentTreeWitness, Hashable, IncrementalWitness, PathFiller};
|
||||
use sapling::Node;
|
||||
use crate::sapling::Node;
|
||||
|
||||
use ff::PrimeFieldRepr;
|
||||
use hex;
|
||||
|
@ -1,5 +1,5 @@
|
||||
use ff::{Field, PrimeField, PrimeFieldRepr};
|
||||
use jubjub::*;
|
||||
use crate::jubjub::*;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Personalization {
|
||||
|
@ -1,14 +1,14 @@
|
||||
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 jubjub::{edwards, FixedGenerators, JubjubEngine, JubjubParams, PrimeOrder};
|
||||
use crate::jubjub::{edwards, FixedGenerators, JubjubEngine, JubjubParams, PrimeOrder};
|
||||
|
||||
use blake2s_simd::Params as Blake2sParams;
|
||||
|
||||
|
@ -6,7 +6,7 @@ use ff::{Field, PrimeField, PrimeFieldRepr};
|
||||
use rand_core::RngCore;
|
||||
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> {
|
||||
let mut s_repr = <E::Fs as PrimeField>::Repr::default();
|
||||
|
@ -12,7 +12,7 @@ use std::io::{self, Read, Write};
|
||||
|
||||
use crate::merkle_tree::Hashable;
|
||||
use crate::redjubjub::{PrivateKey, PublicKey, Signature};
|
||||
use JUBJUB;
|
||||
use crate::JUBJUB;
|
||||
|
||||
pub const SAPLING_COMMITMENT_TREE_DEPTH: usize = 32;
|
||||
|
||||
|
@ -7,7 +7,7 @@ use crate::{
|
||||
use ff::Field;
|
||||
use pairing::bls12_381::{Bls12, Fr};
|
||||
use rand::{rngs::OsRng, seq::SliceRandom, CryptoRng, RngCore};
|
||||
use zip32::ExtendedSpendingKey;
|
||||
use crate::zip32::ExtendedSpendingKey;
|
||||
|
||||
use crate::{
|
||||
keys::OutgoingViewingKey,
|
||||
|
@ -4,9 +4,9 @@ use ff::{PrimeField, PrimeFieldRepr};
|
||||
use pairing::bls12_381::{Bls12, Fr, FrRepr};
|
||||
use std::io::{self, Read, Write};
|
||||
|
||||
use legacy::Script;
|
||||
use redjubjub::{PublicKey, Signature};
|
||||
use JUBJUB;
|
||||
use crate::legacy::Script;
|
||||
use crate::redjubjub::{PublicKey, Signature};
|
||||
use crate::JUBJUB;
|
||||
|
||||
pub mod amount;
|
||||
pub use self::amount::Amount;
|
||||
|
@ -5,8 +5,8 @@ use std::fmt;
|
||||
use std::io::{self, Read, Write};
|
||||
use std::ops::Deref;
|
||||
|
||||
use redjubjub::Signature;
|
||||
use serialize::Vector;
|
||||
use crate::redjubjub::Signature;
|
||||
use crate::serialize::Vector;
|
||||
|
||||
pub mod builder;
|
||||
pub mod components;
|
||||
|
@ -7,7 +7,7 @@ use super::{
|
||||
Transaction, TransactionData, OVERWINTER_VERSION_GROUP_ID, SAPLING_TX_VERSION,
|
||||
SAPLING_VERSION_GROUP_ID,
|
||||
};
|
||||
use legacy::Script;
|
||||
use crate::legacy::Script;
|
||||
|
||||
const ZCASH_SIGHASH_PERSONALIZATION_PREFIX: &'static [u8; 12] = b"ZcashSigHash";
|
||||
const ZCASH_PREVOUTS_HASH_PERSONALIZATION: &'static [u8; 16] = b"ZcashPrevoutHash";
|
||||
|
@ -5,9 +5,9 @@ use rand_os::OsRng;
|
||||
use crate::jubjub::{fs::Fs, FixedGenerators};
|
||||
|
||||
use super::{components::Amount, sighash::signature_hash, Transaction, TransactionData};
|
||||
use legacy::Script;
|
||||
use redjubjub::PrivateKey;
|
||||
use JUBJUB;
|
||||
use crate::legacy::Script;
|
||||
use crate::redjubjub::PrivateKey;
|
||||
use crate::JUBJUB;
|
||||
|
||||
#[test]
|
||||
fn tx_read_write() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user