Merge pull request #134 from NikVolf/z-rng

Avoid using rand_os crate (fixes warnings)
This commit is contained in:
str4d
2019-10-02 17:35:56 -06:00
committed by GitHub
13 changed files with 15 additions and 34 deletions

View File

@@ -202,18 +202,19 @@ impl<Node: Hashable> CommitmentTree<Node> {
/// ```
/// extern crate ff;
/// extern crate pairing;
/// extern crate rand_os;
/// extern crate rand_core;
/// extern crate zcash_primitives;
///
/// use ff::{Field, PrimeField};
/// use pairing::bls12_381::Fr;
/// use rand_os::OsRng;
/// use rand_core::OsRng;
/// use zcash_primitives::{
/// merkle_tree::{CommitmentTree, IncrementalWitness},
/// sapling::Node,
/// };
///
/// let mut rng = OsRng::new().unwrap();
/// let mut rng = OsRng;
///
/// let mut tree = CommitmentTree::<Node>::new();
///
/// tree.append(Node::new(Fr::random(&mut rng).into_repr()));

View File

@@ -214,12 +214,12 @@ fn prf_ock(
/// ```
/// extern crate ff;
/// extern crate pairing;
/// extern crate rand_os;
/// extern crate rand_core;
/// extern crate zcash_primitives;
///
/// use ff::Field;
/// use pairing::bls12_381::Bls12;
/// use rand_os::OsRng;
/// use rand_core::OsRng;
/// use zcash_primitives::{
/// jubjub::fs::Fs,
/// keys::OutgoingViewingKey,
@@ -556,8 +556,8 @@ mod tests {
use crypto_api_chachapoly::ChachaPolyIetf;
use ff::{Field, PrimeField, PrimeFieldRepr};
use pairing::bls12_381::{Bls12, Fr, FrRepr};
use rand_core::OsRng;
use rand_core::{CryptoRng, RngCore};
use rand_os::OsRng;
use std::str::FromStr;
use super::{

View File

@@ -74,7 +74,7 @@ pub trait TxProver {
pub(crate) mod mock {
use ff::Field;
use pairing::bls12_381::{Bls12, Fr};
use rand_os::OsRng;
use rand_core::OsRng;
use crate::{
jubjub::{edwards, fs::Fs, FixedGenerators, Unknown},

View File

@@ -534,7 +534,7 @@ impl<R: RngCore + CryptoRng> Builder<R> {
#[cfg(test)]
mod tests {
use ff::{Field, PrimeField};
use rand::rngs::OsRng;
use rand_core::OsRng;
use crate::jubjub::fs::Fs;

View File

@@ -1,6 +1,6 @@
use ff::Field;
use pairing::bls12_381::Bls12;
use rand_os::OsRng;
use rand_core::OsRng;
use crate::jubjub::{fs::Fs, FixedGenerators};