forked from sigp/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process justifiable for base as well
- Loading branch information
1 parent
da9047c
commit 2421281
Showing
5 changed files
with
113 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
use crate::{Checkpoint, EthSpec}; | ||
use crate::{BeaconState, Checkpoint, EthSpec}; | ||
use ssz_types::BitVector; | ||
|
||
pub struct JustifiableBeaconState<T: EthSpec> { | ||
pub struct JustifiableBeaconState<E: EthSpec> { | ||
pub current_justified_checkpoint: Checkpoint, | ||
pub previous_justified_checkpoint: Checkpoint, | ||
pub justification_bits: BitVector<T::JustificationBitsLength>, | ||
pub justification_bits: BitVector<E::JustificationBitsLength>, | ||
pub finalized_checkpoint: Checkpoint, | ||
} | ||
|
||
impl<E: EthSpec> From<&mut BeaconState<E>> for JustifiableBeaconState<E> { | ||
fn from(state: &mut BeaconState<E>) -> Self { | ||
Self { | ||
current_justified_checkpoint: state.current_justified_checkpoint(), | ||
previous_justified_checkpoint: state.previous_justified_checkpoint(), | ||
justification_bits: state.justification_bits().clone(), | ||
finalized_checkpoint: state.finalized_checkpoint(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters