lighthouse-pulse/lighthouse/state/chain_config.rs

33 lines
722 B
Rust
Raw Normal View History

2018-08-23 08:31:58 +00:00
pub struct ChainConfig {
2018-08-23 05:12:50 +00:00
pub cycle_length: u8,
2018-08-28 07:51:57 +00:00
pub shard_count: u16,
pub min_committee_size: u64,
2018-09-21 01:14:28 +00:00
pub genesis_time: u64,
2018-07-10 09:08:36 +00:00
}
/*
* Presently this is just some arbitrary time in Sept 2018.
*/
2018-09-26 01:53:15 +00:00
const GENESIS_TIME: u64 = 1_537_488_655;
2018-08-23 08:31:58 +00:00
impl ChainConfig {
2018-07-10 09:08:36 +00:00
pub fn standard() -> Self {
Self {
cycle_length: 64,
2018-08-28 07:51:57 +00:00
shard_count: 1024,
min_committee_size: 128,
genesis_time: GENESIS_TIME, // arbitrary
}
}
#[cfg(test)]
pub fn super_fast_tests() -> Self {
Self {
cycle_length: 2,
shard_count: 2,
min_committee_size: 2,
genesis_time: GENESIS_TIME, // arbitrary
2018-07-10 09:08:36 +00:00
}
}
}