From dc7d2ff150c81e85f6f2f85ed4d815fdfcac2bda Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Tue, 25 Sep 2018 12:32:51 +1000 Subject: [PATCH] Move helpers.rs into common/delegation --- .../{helpers.rs => common/delegation/block_hash.rs} | 13 ++----------- lighthouse/state/common/delegation/mod.rs | 3 +++ lighthouse/state/common/mod.rs | 2 ++ lighthouse/state/mod.rs | 1 - lighthouse/sync/block.rs | 0 5 files changed, 7 insertions(+), 12 deletions(-) rename lighthouse/state/{helpers.rs => common/delegation/block_hash.rs} (86%) create mode 100644 lighthouse/state/common/delegation/mod.rs delete mode 100644 lighthouse/sync/block.rs diff --git a/lighthouse/state/helpers.rs b/lighthouse/state/common/delegation/block_hash.rs similarity index 86% rename from lighthouse/state/helpers.rs rename to lighthouse/state/common/delegation/block_hash.rs index 5ed03daf7..092709a21 100644 --- a/lighthouse/state/helpers.rs +++ b/lighthouse/state/common/delegation/block_hash.rs @@ -1,18 +1,9 @@ -/* - * Collection of helper functions used in the state transition modules - */ use super::utils::errors::ParameterError; use super::utils::types::Hash256; /* - pub fn get_signed_parent_hashes( - active_state: &ActiveState, - block: &Block, - attestation: &AttestationRecord, - chain_config: &ChainConfig) - -> Vec { - } - */ + * Work-in-progress function: not ready for review. + */ pub fn get_block_hash( active_state_recent_block_hashes: &Vec, diff --git a/lighthouse/state/common/delegation/mod.rs b/lighthouse/state/common/delegation/mod.rs new file mode 100644 index 000000000..da9746f63 --- /dev/null +++ b/lighthouse/state/common/delegation/mod.rs @@ -0,0 +1,3 @@ +mod block_hash; + +use super::utils; diff --git a/lighthouse/state/common/mod.rs b/lighthouse/state/common/mod.rs index 96ff38eb9..76d294b23 100644 --- a/lighthouse/state/common/mod.rs +++ b/lighthouse/state/common/mod.rs @@ -1,7 +1,9 @@ +mod delegation; mod shuffling; pub mod maps; pub mod attestation_parent_hashes; +use super::utils; use super::utils::types::Hash256; pub use self::shuffling::shuffle; diff --git a/lighthouse/state/mod.rs b/lighthouse/state/mod.rs index 10d9a1846..e533a52a9 100644 --- a/lighthouse/state/mod.rs +++ b/lighthouse/state/mod.rs @@ -14,7 +14,6 @@ pub mod block; pub mod crosslink_record; pub mod shard_and_committee; pub mod validator_record; -pub mod helpers; use super::bls; use super::db; diff --git a/lighthouse/sync/block.rs b/lighthouse/sync/block.rs deleted file mode 100644 index e69de29bb..000000000