Rename types::random
types::test_utils
This commit is contained in:
parent
91dea4bf29
commit
b95395d1e1
@ -1,7 +1,7 @@
|
|||||||
use super::bls::AggregateSignature;
|
use super::bls::AggregateSignature;
|
||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::{AttestationData, Bitfield};
|
use super::{AttestationData, Bitfield};
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
@ -64,7 +64,7 @@ impl<T: RngCore> TestRandom<T> for Attestation {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::Hash256;
|
use super::Hash256;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
pub const SSZ_ATTESTION_DATA_LENGTH: usize = {
|
pub const SSZ_ATTESTION_DATA_LENGTH: usize = {
|
||||||
@ -104,7 +104,7 @@ impl<T: RngCore> TestRandom<T> for AttestationData {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::{BeaconBlockBody, Hash256};
|
use super::{BeaconBlockBody, Hash256};
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use bls::AggregateSignature;
|
use bls::AggregateSignature;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ impl<T: RngCore> TestRandom<T> for BeaconBlock {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::{Attestation, CasperSlashing, Deposit, Exit, ProposerSlashing};
|
use super::{Attestation, CasperSlashing, Deposit, Exit, ProposerSlashing};
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Default)]
|
#[derive(Debug, PartialEq, Clone, Default)]
|
||||||
@ -59,7 +59,7 @@ impl<T: RngCore> TestRandom<T> for BeaconBlockBody {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::SlashableVoteData;
|
use super::SlashableVoteData;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Default)]
|
#[derive(Debug, PartialEq, Clone, Default)]
|
||||||
@ -44,7 +44,7 @@ impl<T: RngCore> TestRandom<T> for CasperSlashing {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::{DepositData, Hash256};
|
use super::{DepositData, Hash256};
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
@ -49,8 +49,7 @@ impl<T: RngCore> TestRandom<T> for Deposit {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng};
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
pub fn test_ssz_round_trip() {
|
pub fn test_ssz_round_trip() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::DepositInput;
|
use super::DepositInput;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
@ -49,7 +49,7 @@ impl<T: RngCore> TestRandom<T> for DepositData {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{decode_ssz_list, Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{decode_ssz_list, Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::Hash256;
|
use super::Hash256;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use bls::{PublicKey, Signature};
|
use bls::{PublicKey, Signature};
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ impl<T: RngCore> TestRandom<T> for DepositInput {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use bls::Signature;
|
use bls::Signature;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ impl<T: RngCore> TestRandom<T> for Exit {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -3,7 +3,7 @@ extern crate boolean_bitfield;
|
|||||||
extern crate ethereum_types;
|
extern crate ethereum_types;
|
||||||
extern crate ssz;
|
extern crate ssz;
|
||||||
|
|
||||||
mod random;
|
pub mod test_utils;
|
||||||
|
|
||||||
pub mod active_state;
|
pub mod active_state;
|
||||||
pub mod attestation_data;
|
pub mod attestation_data;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::Hash256;
|
use super::Hash256;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Default)]
|
#[derive(Debug, PartialEq, Clone, Default)]
|
||||||
@ -49,7 +49,7 @@ impl<T: RngCore> TestRandom<T> for ProposalSignedData {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::ProposalSignedData;
|
use super::ProposalSignedData;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use bls::Signature;
|
use bls::Signature;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ impl<T: RngCore> TestRandom<T> for ProposerSlashing {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
use super::ssz::{Decodable, DecodeError, Encodable, SszStream};
|
||||||
use super::AttestationData;
|
use super::AttestationData;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use bls::AggregateSignature;
|
use bls::AggregateSignature;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ impl<T: RngCore> TestRandom<T> for SlashableVoteData {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::super::ssz::ssz_encode;
|
use super::super::ssz::ssz_encode;
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::random::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::{prng::XorShiftRng, SeedableRng};
|
use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
|
|
||||||
|
pub use rand::{prng::XorShiftRng, SeedableRng};
|
||||||
|
|
||||||
pub mod aggregate_signature;
|
pub mod aggregate_signature;
|
||||||
pub mod bitfield;
|
pub mod bitfield;
|
||||||
pub mod hash256;
|
pub mod hash256;
|
Loading…
Reference in New Issue
Block a user