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
|
|
|
}
|
|
|
|
|
2018-09-25 12:10:47 +00:00
|
|
|
/*
|
|
|
|
* Presently this is just some arbitrary time in Sept 2018.
|
|
|
|
*/
|
|
|
|
const GENESIS_TIME: u64 = 1537488655;
|
|
|
|
|
2018-08-23 08:31:58 +00:00
|
|
|
impl ChainConfig {
|
2018-07-10 09:08:36 +00:00
|
|
|
pub fn standard() -> Self {
|
|
|
|
Self {
|
2018-09-25 12:10:47 +00:00
|
|
|
cycle_length: 64,
|
2018-08-28 07:51:57 +00:00
|
|
|
shard_count: 1024,
|
|
|
|
min_committee_size: 128,
|
2018-09-25 12:10:47 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|