pub struct ProtocolUpgradeConfig { /* private fields */ }
std
only.Expand description
Represents the configuration of a protocol upgrade.
Implementations§
Source§impl ProtocolUpgradeConfig
impl ProtocolUpgradeConfig
Sourcepub fn new(
pre_state_hash: Digest,
current_protocol_version: ProtocolVersion,
new_protocol_version: ProtocolVersion,
activation_point: Option<EraId>,
new_gas_hold_handling: Option<HoldBalanceHandling>,
new_gas_hold_interval: Option<u64>,
new_validator_slots: Option<u32>,
new_auction_delay: Option<u64>,
new_locked_funds_period_millis: Option<u64>,
new_round_seigniorage_rate: Option<Ratio<u64>>,
new_unbonding_delay: Option<u64>,
global_state_update: BTreeMap<Key, StoredValue>,
chainspec_registry: ChainspecRegistry,
fee_handling: FeeHandling,
validator_minimum_bid_amount: u64,
maximum_delegation_amount: u64,
minimum_delegation_amount: u64,
enable_addressable_entity: bool,
) -> Self
pub fn new( pre_state_hash: Digest, current_protocol_version: ProtocolVersion, new_protocol_version: ProtocolVersion, activation_point: Option<EraId>, new_gas_hold_handling: Option<HoldBalanceHandling>, new_gas_hold_interval: Option<u64>, new_validator_slots: Option<u32>, new_auction_delay: Option<u64>, new_locked_funds_period_millis: Option<u64>, new_round_seigniorage_rate: Option<Ratio<u64>>, new_unbonding_delay: Option<u64>, global_state_update: BTreeMap<Key, StoredValue>, chainspec_registry: ChainspecRegistry, fee_handling: FeeHandling, validator_minimum_bid_amount: u64, maximum_delegation_amount: u64, minimum_delegation_amount: u64, enable_addressable_entity: bool, ) -> Self
Create new upgrade config.
Sourcepub fn pre_state_hash(&self) -> Digest
pub fn pre_state_hash(&self) -> Digest
Returns the current state root state hash
Sourcepub fn current_protocol_version(&self) -> ProtocolVersion
pub fn current_protocol_version(&self) -> ProtocolVersion
Returns current protocol version of this upgrade.
Sourcepub fn new_protocol_version(&self) -> ProtocolVersion
pub fn new_protocol_version(&self) -> ProtocolVersion
Returns new protocol version of this upgrade.
Sourcepub fn activation_point(&self) -> Option<EraId>
pub fn activation_point(&self) -> Option<EraId>
Returns activation point in eras.
Sourcepub fn new_gas_hold_handling(&self) -> Option<HoldBalanceHandling>
pub fn new_gas_hold_handling(&self) -> Option<HoldBalanceHandling>
Returns new gas hold handling if specified.
Sourcepub fn new_gas_hold_interval(&self) -> Option<u64>
pub fn new_gas_hold_interval(&self) -> Option<u64>
Returns new auction delay if specified.
Sourcepub fn new_validator_slots(&self) -> Option<u32>
pub fn new_validator_slots(&self) -> Option<u32>
Returns new validator slots if specified.
Sourcepub fn new_auction_delay(&self) -> Option<u64>
pub fn new_auction_delay(&self) -> Option<u64>
Returns new auction delay if specified.
Sourcepub fn new_locked_funds_period_millis(&self) -> Option<u64>
pub fn new_locked_funds_period_millis(&self) -> Option<u64>
Returns new locked funds period if specified.
Sourcepub fn new_round_seigniorage_rate(&self) -> Option<Ratio<u64>>
pub fn new_round_seigniorage_rate(&self) -> Option<Ratio<u64>>
Returns new round seigniorage rate if specified.
Sourcepub fn new_unbonding_delay(&self) -> Option<u64>
pub fn new_unbonding_delay(&self) -> Option<u64>
Returns new unbonding delay if specified.
Sourcepub fn global_state_update(&self) -> &BTreeMap<Key, StoredValue>
pub fn global_state_update(&self) -> &BTreeMap<Key, StoredValue>
Returns new map of emergency global state updates.
Sourcepub fn chainspec_registry(&self) -> &ChainspecRegistry
pub fn chainspec_registry(&self) -> &ChainspecRegistry
Returns a reference to the chainspec registry.
Sourcepub fn with_pre_state_hash(&mut self, pre_state_hash: Digest)
pub fn with_pre_state_hash(&mut self, pre_state_hash: Digest)
Sets new pre state hash.
Sourcepub fn fee_handling(&self) -> FeeHandling
pub fn fee_handling(&self) -> FeeHandling
Fee handling setting.
Sourcepub fn validator_minimum_bid_amount(&self) -> u64
pub fn validator_minimum_bid_amount(&self) -> u64
Validator minimum bid amount
Sourcepub fn maximum_delegation_amount(&self) -> u64
pub fn maximum_delegation_amount(&self) -> u64
Maximum delegation amount for validator.
Sourcepub fn minimum_delegation_amount(&self) -> u64
pub fn minimum_delegation_amount(&self) -> u64
Minimum delegation amount for validator.
pub fn enable_addressable_entity(&self) -> bool
Trait Implementations§
Source§impl Clone for ProtocolUpgradeConfig
impl Clone for ProtocolUpgradeConfig
Source§fn clone(&self) -> ProtocolUpgradeConfig
fn clone(&self) -> ProtocolUpgradeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ProtocolUpgradeConfig
impl Debug for ProtocolUpgradeConfig
Source§impl PartialEq for ProtocolUpgradeConfig
impl PartialEq for ProtocolUpgradeConfig
Source§impl Serialize for ProtocolUpgradeConfig
impl Serialize for ProtocolUpgradeConfig
impl Eq for ProtocolUpgradeConfig
impl StructuralPartialEq for ProtocolUpgradeConfig
Auto Trait Implementations§
impl Freeze for ProtocolUpgradeConfig
impl RefUnwindSafe for ProtocolUpgradeConfig
impl Send for ProtocolUpgradeConfig
impl Sync for ProtocolUpgradeConfig
impl Unpin for ProtocolUpgradeConfig
impl UnwindSafe for ProtocolUpgradeConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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