pub struct ConsensusParameters { /* private fields */ }Expand description
This data type encapsulates the parameters needed by the consensus layer to operate.
Implementations§
Source§impl ConsensusParameters
impl ConsensusParameters
Sourcepub fn new(
global_parameters: GlobalParameters,
era_history: &EraHistory,
ocert_counters: BTreeMap<PoolId, u64>,
) -> Self
pub fn new( global_parameters: GlobalParameters, era_history: &EraHistory, ocert_counters: BTreeMap<PoolId, u64>, ) -> Self
Create new consensus parameters from the given global parameters.
Sourcepub fn create(
randomness_stabilization_window: u64,
slots_per_kes_period: u64,
max_kes_evolution: u64,
active_slot_coeff: f64,
era_history: &EraHistory,
ocert_counters: BTreeMap<PoolId, u64>,
) -> ConsensusParameters
pub fn create( randomness_stabilization_window: u64, slots_per_kes_period: u64, max_kes_evolution: u64, active_slot_coeff: f64, era_history: &EraHistory, ocert_counters: BTreeMap<PoolId, u64>, ) -> ConsensusParameters
Create new consensus parameters from individual values.
pub fn era_history(&self) -> &EraHistory
pub fn randomness_stabilization_window(&self) -> u64
pub fn slot_to_kes_period(&self, slot: Slot) -> u64
pub fn max_kes_evolutions(&self) -> u64
pub fn latest_opcert_sequence_number(&self, pool_id: &PoolId) -> Option<u64>
pub fn active_slot_coeff(&self) -> FixedDecimal
Trait Implementations§
Source§impl Clone for ConsensusParameters
impl Clone for ConsensusParameters
Source§fn clone(&self) -> ConsensusParameters
fn clone(&self) -> ConsensusParameters
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConsensusParameters
impl Debug for ConsensusParameters
Source§impl<'de> Deserialize<'de> for ConsensusParameters
impl<'de> Deserialize<'de> for ConsensusParameters
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConsensusParameters
impl PartialEq for ConsensusParameters
Source§impl Serialize for ConsensusParameters
impl Serialize for ConsensusParameters
impl StructuralPartialEq for ConsensusParameters
Auto Trait Implementations§
impl Freeze for ConsensusParameters
impl RefUnwindSafe for ConsensusParameters
impl Send for ConsensusParameters
impl Sync for ConsensusParameters
impl Unpin for ConsensusParameters
impl UnsafeUnpin for ConsensusParameters
impl UnwindSafe for ConsensusParameters
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more