pub struct GenesisConfig { /* private fields */ }Available on crate feature
std only.Expand description
Represents the details of a genesis process.
Implementations§
Source§impl GenesisConfig
impl GenesisConfig
Sourcepub fn new(
accounts: Vec<GenesisAccount>,
wasm_config: WasmConfig,
system_config: SystemConfig,
validator_slots: u32,
auction_delay: u64,
locked_funds_period_millis: u64,
round_seigniorage_rate: Ratio<u64>,
unbonding_delay: u64,
genesis_timestamp_millis: u64,
gas_hold_balance_handling: HoldBalanceHandling,
gas_hold_interval_millis: u64,
enable_addressable_entity: bool,
storage_costs: StorageCosts,
) -> GenesisConfig
pub fn new( accounts: Vec<GenesisAccount>, wasm_config: WasmConfig, system_config: SystemConfig, validator_slots: u32, auction_delay: u64, locked_funds_period_millis: u64, round_seigniorage_rate: Ratio<u64>, unbonding_delay: u64, genesis_timestamp_millis: u64, gas_hold_balance_handling: HoldBalanceHandling, gas_hold_interval_millis: u64, enable_addressable_entity: bool, storage_costs: StorageCosts, ) -> GenesisConfig
Creates a new genesis configuration.
Sourcepub fn wasm_config(&self) -> &WasmConfig
pub fn wasm_config(&self) -> &WasmConfig
Returns WASM config.
Sourcepub fn system_config(&self) -> &SystemConfig
pub fn system_config(&self) -> &SystemConfig
Returns system config.
Sourcepub fn get_bonded_validators(&self) -> impl Iterator<Item = &GenesisAccount>
pub fn get_bonded_validators(&self) -> impl Iterator<Item = &GenesisAccount>
Returns all bonded genesis validators.
Sourcepub fn get_bonded_delegators(
&self,
) -> impl Iterator<Item = (&PublicKey, &PublicKey, &Motes, &Motes)>
pub fn get_bonded_delegators( &self, ) -> impl Iterator<Item = (&PublicKey, &PublicKey, &Motes, &Motes)>
Returns all bonded genesis delegators.
Sourcepub fn accounts(&self) -> &[GenesisAccount]
pub fn accounts(&self) -> &[GenesisAccount]
Returns all genesis accounts.
Sourcepub fn accounts_iter(&self) -> impl Iterator<Item = &GenesisAccount>
pub fn accounts_iter(&self) -> impl Iterator<Item = &GenesisAccount>
Returns an iterator over all genesis accounts.
Sourcepub fn administrative_accounts(
&self,
) -> impl Iterator<Item = &AdministratorAccount>
pub fn administrative_accounts( &self, ) -> impl Iterator<Item = &AdministratorAccount>
Returns an iterator over all administrative accounts.
Sourcepub fn push_account(&mut self, account: GenesisAccount)
pub fn push_account(&mut self, account: GenesisAccount)
Adds new genesis account to the config.
Sourcepub fn validator_slots(&self) -> u32
pub fn validator_slots(&self) -> u32
Returns validator slots.
Sourcepub fn auction_delay(&self) -> u64
pub fn auction_delay(&self) -> u64
Returns auction delay.
Sourcepub fn locked_funds_period_millis(&self) -> u64
pub fn locked_funds_period_millis(&self) -> u64
Returns locked funds period expressed in milliseconds.
Sourcepub fn round_seigniorage_rate(&self) -> Ratio<u64>
pub fn round_seigniorage_rate(&self) -> Ratio<u64>
Returns round seigniorage rate.
Sourcepub fn unbonding_delay(&self) -> u64
pub fn unbonding_delay(&self) -> u64
Returns unbonding delay in eras.
Sourcepub fn genesis_timestamp_millis(&self) -> u64
pub fn genesis_timestamp_millis(&self) -> u64
Returns genesis timestamp expressed in milliseconds.
Sourcepub fn gas_hold_balance_handling(&self) -> HoldBalanceHandling
pub fn gas_hold_balance_handling(&self) -> HoldBalanceHandling
Returns gas hold balance handling.
Sourcepub fn gas_hold_interval_millis(&self) -> u64
pub fn gas_hold_interval_millis(&self) -> u64
Returns gas hold interval expressed in milliseconds.
Sourcepub fn enable_entity(&self) -> bool
pub fn enable_entity(&self) -> bool
Enable entity.
Sourcepub fn set_enable_entity(&mut self, enable: bool)
pub fn set_enable_entity(&mut self, enable: bool)
Set enable entity.
Sourcepub fn push_genesis_validator(
&mut self,
public_key: &PublicKey,
genesis_validator: GenesisValidator,
)
pub fn push_genesis_validator( &mut self, public_key: &PublicKey, genesis_validator: GenesisValidator, )
Push genesis validator.
Trait Implementations§
Source§impl Clone for GenesisConfig
impl Clone for GenesisConfig
Source§fn clone(&self) -> GenesisConfig
fn clone(&self) -> GenesisConfig
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 GenesisConfig
impl Debug for GenesisConfig
Source§impl<'de> Deserialize<'de> for GenesisConfig
impl<'de> Deserialize<'de> for GenesisConfig
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 Distribution<GenesisConfig> for Standard
Available on crate feature testing only.
impl Distribution<GenesisConfig> for Standard
Available on crate feature
testing only.Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> GenesisConfig
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> GenesisConfig
Generate a random value of
T, using rng as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
Create an iterator that generates random values of
T, using rng as
the source of randomness. Read moreSource§impl From<&Chainspec> for GenesisConfig
impl From<&Chainspec> for GenesisConfig
Source§impl PartialEq for GenesisConfig
impl PartialEq for GenesisConfig
Source§impl Serialize for GenesisConfig
impl Serialize for GenesisConfig
impl Eq for GenesisConfig
impl StructuralPartialEq for GenesisConfig
Auto Trait Implementations§
impl Freeze for GenesisConfig
impl RefUnwindSafe for GenesisConfig
impl Send for GenesisConfig
impl Sync for GenesisConfig
impl Unpin for GenesisConfig
impl UnwindSafe for GenesisConfig
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<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
Compare self to
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
Compare self to
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>
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