mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-31 16:31:20 +00:00
28 lines
559 B
Rust
28 lines
559 B
Rust
pub struct ShardAndCommittee {
|
|
pub shard_id: u16,
|
|
pub committee: Vec<u32>
|
|
}
|
|
|
|
impl ShardAndCommittee {
|
|
/// Returns a new instance where the `shard_id` is zero and the
|
|
/// committee is an empty vector.
|
|
pub fn zero() -> Self {
|
|
Self {
|
|
shard_id: 0,
|
|
committee: vec![],
|
|
}
|
|
}
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn test_shard_and_committee_zero() {
|
|
let s = ShardAndCommittee::zero();
|
|
assert_eq!(s.shard_id, 0);
|
|
assert_eq!(s.committee.len(), 0);
|
|
}
|
|
}
|