Restructure directories. Add dead_code allows

This commit is contained in:
Paul Hauner 2018-09-25 12:20:13 +10:00
parent 4212d8fc7d
commit 83d95f1d34
No known key found for this signature in database
GPG Key ID: 303E4494BB28068C
17 changed files with 51 additions and 31 deletions

View File

@ -8,11 +8,16 @@ extern crate network_libp2p;
extern crate futures;
#[macro_use]
#[allow(dead_code)]
mod utils;
#[allow(dead_code)]
mod bls;
#[allow(dead_code)]
mod db;
mod client;
#[allow(dead_code)]
mod state;
#[allow(dead_code)]
mod sync;
mod config;

View File

@ -1,10 +1,13 @@
use super::bls;
use super::common;
use super::db;
use super::ssz;
use super::utils;
mod attestation_record;
mod ssz_splitter;
pub mod validation;
pub use self::attestation_record::{
AttestationRecord,

View File

@ -1,10 +1,10 @@
use std::collections::HashSet;
use super::attestation_record::AttestationRecord;
use super::AttesterMap;
use super::attestation_parent_hashes::{
attestation_parent_hashes,
ParentHashesError,
};
use super::AttesterMap;
use super::db::{
ClientDB,
DBError

View File

@ -1,9 +1,9 @@
use super::AttesterMap;
use super::common::maps::AttesterMap;
use super::db;
use super::bls;
use super::attestation_record;
use super::ssz;
use super::attestation_parent_hashes;
use super::common::attestation_parent_hashes;
use super::utils;
mod attestation_validation;

View File

@ -1,11 +1,15 @@
extern crate blake2_rfc;
use super::common;
use super::Logger;
use super::db;
use super::ssz;
use super::utils;
use super::attestation_record;
mod block;
mod ssz_block;
mod validation;
pub use self::block::Block;
pub use self::ssz_block::SszBlock;

View File

@ -0,0 +1,17 @@
mod validate_ssz_block;
use super::attestation_record;
use super::SszBlock;
use super::Logger;
use super::db;
use super::ssz;
use super::utils;
use super::common::maps::{
AttesterMap,
ProposerMap,
};
pub use self::validate_ssz_block::{
validate_ssz_block,
SszBlockValidationError
};

View File

@ -1,5 +1,5 @@
use std::sync::Arc;
use super::attestation::{
use super::attestation_record::validation::{
validate_attestation,
AttestationValidationError,
};
@ -13,7 +13,7 @@ use super::{
AttesterMap,
ProposerMap,
};
use super::block::SszBlock;
use super::SszBlock;
use super::db::{
ClientDB,
DBError,

View File

@ -0,0 +1,7 @@
use std::collections::HashMap;
/// Maps a (slot, shard_id) to attestation_indices.
pub type AttesterMap = HashMap<(u64, u64), Vec<usize>>;
/// Maps a slot to a block proposer.
pub type ProposerMap = HashMap<u64, usize>;

View File

@ -1,6 +1,7 @@
use super::utils::types::Hash256;
pub mod attestation_parent_hashes;
mod shuffling;
pub mod maps;
pub mod attestation_parent_hashes;
use super::utils::types::Hash256;
pub use self::shuffling::shuffle;

View File

@ -4,10 +4,7 @@ extern crate blake2_rfc as blake2;
extern crate bytes;
extern crate ssz;
use super::bls;
use super::db;
use super::Logger;
use super::utils;
mod common;
pub mod active_state;
pub mod attestation_record;
@ -16,7 +13,10 @@ pub mod chain_config;
pub mod block;
pub mod crosslink_record;
pub mod shard_and_committee;
pub mod transition;
pub mod validator_record;
pub mod validation;
pub mod helpers;
use super::bls;
use super::db;
use super::Logger;
use super::utils;

View File

@ -1,17 +0,0 @@
use std::collections::HashMap;
use super::block;
use super::bls;
use super::Logger;
use super::db;
use super::attestation_record;
use super::ssz;
use super::transition::attestation_parent_hashes;
use super::utils;
mod attestation;
mod ssz_block;
type Slot = u64;
type ShardId = u64;
type AttesterMap = HashMap<(Slot, ShardId), Vec<usize>>;
type ProposerMap = HashMap<Slot, usize>;

0
lighthouse/sync/block.rs Normal file
View File