Restructure directories. Add dead_code allows
This commit is contained in:
parent
4212d8fc7d
commit
83d95f1d34
@ -8,11 +8,16 @@ extern crate network_libp2p;
|
|||||||
extern crate futures;
|
extern crate futures;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
#[allow(dead_code)]
|
||||||
mod utils;
|
mod utils;
|
||||||
|
#[allow(dead_code)]
|
||||||
mod bls;
|
mod bls;
|
||||||
|
#[allow(dead_code)]
|
||||||
mod db;
|
mod db;
|
||||||
mod client;
|
mod client;
|
||||||
|
#[allow(dead_code)]
|
||||||
mod state;
|
mod state;
|
||||||
|
#[allow(dead_code)]
|
||||||
mod sync;
|
mod sync;
|
||||||
mod config;
|
mod config;
|
||||||
|
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
use super::bls;
|
use super::bls;
|
||||||
|
use super::common;
|
||||||
|
use super::db;
|
||||||
use super::ssz;
|
use super::ssz;
|
||||||
use super::utils;
|
use super::utils;
|
||||||
|
|
||||||
|
|
||||||
mod attestation_record;
|
mod attestation_record;
|
||||||
mod ssz_splitter;
|
mod ssz_splitter;
|
||||||
|
pub mod validation;
|
||||||
|
|
||||||
pub use self::attestation_record::{
|
pub use self::attestation_record::{
|
||||||
AttestationRecord,
|
AttestationRecord,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use super::attestation_record::AttestationRecord;
|
use super::attestation_record::AttestationRecord;
|
||||||
|
use super::AttesterMap;
|
||||||
use super::attestation_parent_hashes::{
|
use super::attestation_parent_hashes::{
|
||||||
attestation_parent_hashes,
|
attestation_parent_hashes,
|
||||||
ParentHashesError,
|
ParentHashesError,
|
||||||
};
|
};
|
||||||
use super::AttesterMap;
|
|
||||||
use super::db::{
|
use super::db::{
|
||||||
ClientDB,
|
ClientDB,
|
||||||
DBError
|
DBError
|
@ -1,9 +1,9 @@
|
|||||||
use super::AttesterMap;
|
use super::common::maps::AttesterMap;
|
||||||
use super::db;
|
use super::db;
|
||||||
use super::bls;
|
use super::bls;
|
||||||
use super::attestation_record;
|
use super::attestation_record;
|
||||||
use super::ssz;
|
use super::ssz;
|
||||||
use super::attestation_parent_hashes;
|
use super::common::attestation_parent_hashes;
|
||||||
use super::utils;
|
use super::utils;
|
||||||
|
|
||||||
mod attestation_validation;
|
mod attestation_validation;
|
@ -1,11 +1,15 @@
|
|||||||
extern crate blake2_rfc;
|
extern crate blake2_rfc;
|
||||||
|
|
||||||
|
use super::common;
|
||||||
|
use super::Logger;
|
||||||
|
use super::db;
|
||||||
use super::ssz;
|
use super::ssz;
|
||||||
use super::utils;
|
use super::utils;
|
||||||
use super::attestation_record;
|
use super::attestation_record;
|
||||||
|
|
||||||
mod block;
|
mod block;
|
||||||
mod ssz_block;
|
mod ssz_block;
|
||||||
|
mod validation;
|
||||||
|
|
||||||
pub use self::block::Block;
|
pub use self::block::Block;
|
||||||
pub use self::ssz_block::SszBlock;
|
pub use self::ssz_block::SszBlock;
|
||||||
|
17
lighthouse/state/block/validation/mod.rs
Normal file
17
lighthouse/state/block/validation/mod.rs
Normal 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
|
||||||
|
};
|
@ -1,5 +1,5 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use super::attestation::{
|
use super::attestation_record::validation::{
|
||||||
validate_attestation,
|
validate_attestation,
|
||||||
AttestationValidationError,
|
AttestationValidationError,
|
||||||
};
|
};
|
||||||
@ -13,7 +13,7 @@ use super::{
|
|||||||
AttesterMap,
|
AttesterMap,
|
||||||
ProposerMap,
|
ProposerMap,
|
||||||
};
|
};
|
||||||
use super::block::SszBlock;
|
use super::SszBlock;
|
||||||
use super::db::{
|
use super::db::{
|
||||||
ClientDB,
|
ClientDB,
|
||||||
DBError,
|
DBError,
|
7
lighthouse/state/common/maps.rs
Normal file
7
lighthouse/state/common/maps.rs
Normal 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>;
|
@ -1,6 +1,7 @@
|
|||||||
use super::utils::types::Hash256;
|
|
||||||
|
|
||||||
pub mod attestation_parent_hashes;
|
|
||||||
mod shuffling;
|
mod shuffling;
|
||||||
|
|
||||||
|
pub mod maps;
|
||||||
|
pub mod attestation_parent_hashes;
|
||||||
|
|
||||||
|
use super::utils::types::Hash256;
|
||||||
pub use self::shuffling::shuffle;
|
pub use self::shuffling::shuffle;
|
@ -4,10 +4,7 @@ extern crate blake2_rfc as blake2;
|
|||||||
extern crate bytes;
|
extern crate bytes;
|
||||||
extern crate ssz;
|
extern crate ssz;
|
||||||
|
|
||||||
use super::bls;
|
mod common;
|
||||||
use super::db;
|
|
||||||
use super::Logger;
|
|
||||||
use super::utils;
|
|
||||||
|
|
||||||
pub mod active_state;
|
pub mod active_state;
|
||||||
pub mod attestation_record;
|
pub mod attestation_record;
|
||||||
@ -16,7 +13,10 @@ pub mod chain_config;
|
|||||||
pub mod block;
|
pub mod block;
|
||||||
pub mod crosslink_record;
|
pub mod crosslink_record;
|
||||||
pub mod shard_and_committee;
|
pub mod shard_and_committee;
|
||||||
pub mod transition;
|
|
||||||
pub mod validator_record;
|
pub mod validator_record;
|
||||||
pub mod validation;
|
|
||||||
pub mod helpers;
|
pub mod helpers;
|
||||||
|
|
||||||
|
use super::bls;
|
||||||
|
use super::db;
|
||||||
|
use super::Logger;
|
||||||
|
use super::utils;
|
||||||
|
@ -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
0
lighthouse/sync/block.rs
Normal file
Loading…
Reference in New Issue
Block a user