pub struct BlockchainConfig<C: CellFamily> {
    pub address: CellHash,
    pub params: Dict<C, u32, CellContainer<C>>,
}
Expand description

Blockchain config.

Fields§

§address: CellHash

Configuration contract address.

§params: Dict<C, u32, CellContainer<C>>

Configuration parameters.

Implementations§

source§

impl<C> BlockchainConfig<C>where for<'c> C: DefaultFinalizer + 'c,

source

pub fn get_elector_address(&self) -> Result<CellHash, Error>

Returns the elector account address (in masterchain).

Uses ConfigParam1.

source

pub fn get_minter_address(&self) -> Result<CellHash, Error>

Returns the minter account address (in masterchain).

Uses ConfigParam2 with a fallback to ConfigParam0 (config).

source

pub fn get_fee_collector_address(&self) -> Result<CellHash, Error>

Returns the fee collector account address (in masterchain).

Uses ConfigParam3 with a fallback to ConfigParam1 (elector).

source

pub fn get_global_version(&self) -> Result<GlobalVersion, Error>

Returns the lowest supported block version and required capabilities.

Uses ConfigParam8.

source

pub fn get_mandatory_params(&self) -> Result<Dict<C, u32, ()>, Error>

Returns a list of params that must be present in config.

Uses ConfigParam9.

source

pub fn get_critical_params(&self) -> Result<Dict<C, u32, ()>, Error>

Returns a list of params that have a different set of update requirements.

Uses ConfigParam10.

source

pub fn get_workchains( &self ) -> Result<Dict<C, i32, WorkchainDescription>, Error>

Returns a dictionary with workchain descriptions.

Uses ConfigParam12.

source

pub fn get_block_creation_reward( &self, masterchain: bool ) -> Result<Tokens, Error>

Returns a block creation reward for the specified workchain in tokens.

Uses ConfigParam14.

source

pub fn get_block_creation_rewards(&self) -> Result<BlockCreationRewards, Error>

Returns a block creation rewards in tokens.

Uses ConfigParam14.

source

pub fn get_election_timings(&self) -> Result<ElectionTimings, Error>

Returns election timings.

Uses ConfigParam15.

source

pub fn get_validator_count_params(&self) -> Result<ValidatorCountParams, Error>

Returns possible validator count.

Uses ConfigParam16.

source

pub fn get_validator_stake_params(&self) -> Result<ValidatorStakeParams, Error>

Returns validator stake range and factor.

Uses ConfigParam17.

source

pub fn get_storage_prices(&self) -> Result<Dict<C, u32, StoragePrices>, Error>

Returns a list with a history of all storage prices.

Uses ConfigParam18.

source

pub fn get_gas_prices(&self, masterchain: bool) -> Result<GasLimitsPrices, Error>

Returns gas limits and prices.

Uses ConfigParam20 (for masterchain) or ConfigParam21 (for other workchains).

source

pub fn get_block_limits(&self, masterchain: bool) -> Result<BlockLimits, Error>

Returns block limits.

Uses ConfigParam22 (for masterchain) or ConfigParam23 (for other workchains).

source

pub fn get_msg_forward_prices( &self, masterchain: bool ) -> Result<MsgForwardPrices, Error>

Returns message forwarding prices.

Uses ConfigParam24 (for masterchain) or ConfigParam25 (for other workchains).

source

pub fn get_catchain_config(&self) -> Result<CatchainConfig, Error>

Returns a catchain config.

Uses ConfigParam28.

source

pub fn get_consensus_config(&self) -> Result<ConsensusConfig, Error>

Returns a consensus config.

Uses ConfigParam29.

source

pub fn get_fundamental_addresses(&self) -> Result<Dict<C, CellHash, ()>, Error>

Returns a list of fundamental account addresses (in masterchain).

Uses ConfigParam31.

source

pub fn contains_prev_validator_set(&self) -> Result<bool, Error>

Returns true if the config contains info about the previous validator set.

Uses ConfigParam32 or ConfigParam33.

source

pub fn contains_next_validator_set(&self) -> Result<bool, Error>

Returns true if the config contains info about the next validator set.

Uses ConfigParam36 or ConfigParam37.

source

pub fn get_current_validator_set(&self) -> Result<ValidatorSet, Error>

Returns the current validator set.

Uses ConfigParam35 (temp validators) or ConfigParam34 (current validators).

source

pub fn contains<'a, T: KnownConfigParam<'a, C>>(&'a self) -> Result<bool, Error>

Returns true if the config contains a param for the specified id.

source

pub fn contains_raw(&self, id: u32) -> Result<bool, Error>

Returns true if the config contains a param for the specified id.

source

pub fn get<'a, T: KnownConfigParam<'a, C>>( &'a self ) -> Result<Option<T::Value>, Error>

Tries to get a parameter from the blockchain config.

source

pub fn get_raw(&self, id: u32) -> Result<Option<CellSlice<'_, C>>, Error>

Tries to get a raw parameter from the blockchain config.

Trait Implementations§

source§

impl<C: CellFamily> Clone for BlockchainConfig<C>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<C: CellFamily> Debug for BlockchainConfig<C>

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, C: CellFamily> Load<'a, C> for BlockchainConfig<C>

source§

fn load_from(slice: &mut CellSlice<'a, C>) -> Option<Self>

Tries to load itself from a cell slice.
source§

impl<C: CellFamily> PartialEq<BlockchainConfig<C>> for BlockchainConfig<C>

source§

fn eq(&self, __other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<C: CellFamily> Store<C> for BlockchainConfig<C>

source§

fn store_into( &self, builder: &mut CellBuilder<C>, _: &mut dyn Finalizer<C> ) -> bool

Tries to store itself into the cell builder.
source§

impl<C: CellFamily> Eq for BlockchainConfig<C>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.