Rename types::random types::test_utils

This commit is contained in:
Paul Hauner 2018-12-25 10:36:49 +11:00
parent 91dea4bf29
commit b95395d1e1
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C
20 changed files with 27 additions and 26 deletions

View File

@ -1,7 +1,7 @@
use super::bls::AggregateSignature;
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::{AttestationData, Bitfield};
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::RngCore;
#[derive(Debug, Clone, PartialEq)]
@ -64,7 +64,7 @@ impl<T: RngCore> TestRandom<T> for Attestation {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::Hash256;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::RngCore;
pub const SSZ_ATTESTION_DATA_LENGTH: usize = {
@ -104,7 +104,7 @@ impl<T: RngCore> TestRandom<T> for AttestationData {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::{BeaconBlockBody, Hash256};
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use bls::AggregateSignature;
use rand::RngCore;
@ -70,7 +70,7 @@ impl<T: RngCore> TestRandom<T> for BeaconBlock {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::{Attestation, CasperSlashing, Deposit, Exit, ProposerSlashing};
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::RngCore;
#[derive(Debug, PartialEq, Clone, Default)]
@ -59,7 +59,7 @@ impl<T: RngCore> TestRandom<T> for BeaconBlockBody {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::SlashableVoteData;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::RngCore;
#[derive(Debug, PartialEq, Clone, Default)]
@ -44,7 +44,7 @@ impl<T: RngCore> TestRandom<T> for CasperSlashing {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::{DepositData, Hash256};
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::RngCore;
#[derive(Debug, PartialEq, Clone)]
@ -49,8 +49,7 @@ impl<T: RngCore> TestRandom<T> for Deposit {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng};
#[test]
pub fn test_ssz_round_trip() {

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::DepositInput;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::RngCore;
#[derive(Debug, PartialEq, Clone)]
@ -49,7 +49,7 @@ impl<T: RngCore> TestRandom<T> for DepositData {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{decode_ssz_list, Decodable, DecodeError, Encodable, SszStream};
use super::Hash256;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use bls::{PublicKey, Signature};
use rand::RngCore;
@ -56,7 +56,7 @@ impl<T: RngCore> TestRandom<T> for DepositInput {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,5 +1,5 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use bls::Signature;
use rand::RngCore;
@ -49,7 +49,7 @@ impl<T: RngCore> TestRandom<T> for Exit {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -3,7 +3,7 @@ extern crate boolean_bitfield;
extern crate ethereum_types;
extern crate ssz;
mod random;
pub mod test_utils;
pub mod active_state;
pub mod attestation_data;

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::Hash256;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::RngCore;
#[derive(Debug, PartialEq, Clone, Default)]
@ -49,7 +49,7 @@ impl<T: RngCore> TestRandom<T> for ProposalSignedData {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::ProposalSignedData;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use bls::Signature;
use rand::RngCore;
@ -60,7 +60,7 @@ impl<T: RngCore> TestRandom<T> for ProposerSlashing {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,6 +1,6 @@
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
use super::AttestationData;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use bls::AggregateSignature;
use rand::RngCore;
@ -55,7 +55,7 @@ impl<T: RngCore> TestRandom<T> for SlashableVoteData {
mod tests {
use super::super::ssz::ssz_encode;
use super::*;
use crate::random::TestRandom;
use crate::test_utils::TestRandom;
use rand::{prng::XorShiftRng, SeedableRng};
#[test]

View File

@ -1,5 +1,7 @@
use rand::RngCore;
pub use rand::{prng::XorShiftRng, SeedableRng};
pub mod aggregate_signature;
pub mod bitfield;
pub mod hash256;