Struct BlockchainConfigParams

Source
pub struct BlockchainConfigParams(/* private fields */);
Expand description

A non-empty dictionary with blockchain config params.

Implementations§

Source§

impl BlockchainConfigParams

Source

pub fn from_raw(dict_root: Cell) -> Self

Creates a dictionary from a raw cell.

NOTE: Root is mandatory since the configs dictionary can’t be empty.

Source

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

Returns the elector account address (in masterchain).

Uses ConfigParam1.

Source

pub fn set_elector_address( &mut self, address: &HashBytes, ) -> Result<bool, Error>

Updates the elector account address (in masterchain).

Uses ConfigParam1.

Source

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

Returns the minter account address (in masterchain).

Uses ConfigParam2 with a fallback to ConfigParam0 (config).

Source

pub fn set_minter_address(&mut self, address: &HashBytes) -> Result<bool, Error>

Updates the minter account address (in masterchain).

Uses ConfigParam2.

Source

pub fn get_burning_config(&self) -> Result<BurningConfig, Error>

Returns the burning config.

Uses ConfigParam5.

Source

pub fn set_burning_config( &mut self, config: &BurningConfig, ) -> Result<bool, Error>

Updates the burning config.

Uses ConfigParam5.

Source

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

Returns the fee collector account address (in masterchain).

Uses ConfigParam3 with a fallback to ConfigParam1 (elector).

Source

pub fn set_fee_collector_address( &mut self, address: &HashBytes, ) -> Result<bool, Error>

Updates the fee collector address (in masterchain).

Uses ConfigParam3.

Source

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

Returns the lowest supported block version and required capabilities.

Uses ConfigParam8.

Source

pub fn set_global_version( &mut self, version: &GlobalVersion, ) -> Result<bool, Error>

Updates the global version.

Uses ConfigParam8.

Source

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

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

Uses ConfigParam9.

Source

pub fn set_mandatory_params(&mut self, params: &[u32]) -> Result<bool, Error>

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

Uses ConfigParam9.

Source

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

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

Uses ConfigParam10.

Source

pub fn set_critical_params(&mut self, params: &[u32]) -> Result<bool, Error>

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

Uses ConfigParam10.

Source

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

Returns a dictionary with workchain descriptions.

Uses ConfigParam12.

Source

pub fn set_workchains( &mut self, workchains: &Dict<i32, WorkchainDescription>, ) -> Result<bool, Error>

Updates a list of 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 set_block_creation_rewards( &mut self, rewards: &BlockCreationRewards, ) -> Result<bool, Error>

Updates 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 set_election_timings( &mut self, timings: &ElectionTimings, ) -> Result<bool, Error>

Updates election timings.

Uses ConfigParam15.

Source

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

Returns possible validator count.

Uses ConfigParam16.

Source

pub fn set_validator_count_params( &mut self, params: &ValidatorCountParams, ) -> Result<bool, Error>

Updates 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 set_validator_stake_params( &mut self, params: &ValidatorStakeParams, ) -> Result<bool, Error>

Updates validator stake range and factor.

Uses ConfigParam17.

Source

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

Returns a list with a history of all storage prices.

Uses ConfigParam18.

Source

pub fn set_storage_prices( &mut self, prices: &[StoragePrices], ) -> Result<bool, Error>

Updates a list with a history of all storage prices.

Uses ConfigParam18.

Source

pub fn get_global_id(&self) -> Result<i32, Error>

Returns a global id.

Source

pub fn set_global_id(&mut self, global_id: i32) -> Result<bool, Error>

Updates a global id.

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 set_gas_prices( &mut self, masterchain: bool, prices: &GasLimitsPrices, ) -> Result<bool, Error>

Updates 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 set_block_limits( &mut self, masterchain: bool, limits: &BlockLimits, ) -> Result<bool, Error>

Updates 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 set_msg_forward_prices( &mut self, masterchain: bool, prices: &MsgForwardPrices, ) -> Result<bool, Error>

Updates 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 set_catchain_config( &mut self, config: &CatchainConfig, ) -> Result<bool, Error>

Updates a catchain config.

Uses ConfigParam28.

Source

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

Returns a consensus config.

Uses ConfigParam29.

Source

pub fn set_consensus_config( &mut self, config: &ConsensusConfig, ) -> Result<bool, Error>

Updates a consensus config.

Uses ConfigParam29.

Source

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

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

Uses ConfigParam31.

Source

pub fn set_fundamental_addresses( &mut self, addresses: &[HashBytes], ) -> Result<bool, Error>

Updates 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_previous_validator_set(&self) -> Result<Option<ValidatorSet>, Error>

Returns the previous validator set.

Uses ConfigParam33 (temp prev validators) or ConfigParam32 (prev validators).

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 get_next_validator_set(&self) -> Result<Option<ValidatorSet>, Error>

Returns the next validator set.

Uses ConfigParam37 (temp next validators) or ConfigParam36 (next validators).

Source

pub fn get_size_limits(&self) -> Result<SizeLimitsConfig, Error>

Returns size limits.

Source

pub fn set_size_limits( &mut self, size_limits: &SizeLimitsConfig, ) -> Result<bool, Error>

Updates a global id.

Source

pub fn contains<'a, T: KnownConfigParam<'a>>(&'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>>( &'a self, ) -> Result<Option<T::Value>, Error>

Tries to get a parameter from the blockchain config.

Source

pub fn set<'a, T: KnownConfigParam<'a>>( &'a mut self, value: &T::Value, ) -> Result<bool, Error>

Tries to update a parameter in the blockchain config.

Source

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

Tries to get a raw parameter from the blockchain config (as slice).

Source

pub fn get_raw_cell(&self, id: u32) -> Result<Option<Cell>, Error>

Tries to get a raw parameter from the blockchain config (as cell).

Source

pub fn get_raw_cell_ref(&self, id: u32) -> Result<Option<&DynCell>, Error>

Tries to get a raw parameter from the blockchain config (as cell ref).

Source

pub fn set_raw(&mut self, id: u32, value: Cell) -> Result<bool, Error>

Tries to set a parameter in the blockchain config.

NOTE: Use with caution, as it doesn’t check the value structure.

Source

pub fn remove(&mut self, id: u32) -> Result<Option<Cell>, Error>

Removes a parameter from the blockchain config.

NOTE: Removing a zero parameter successfully does nothing and returns None as it is required and externaly managed.

Source

pub fn as_dict(&self) -> &Dict<u32, Cell>

Returns a reference to the underlying dictionary.

Trait Implementations§

Source§

impl Clone for BlockchainConfigParams

Source§

fn clone(&self) -> BlockchainConfigParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BlockchainConfigParams

Source§

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

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

impl<'de> Deserialize<'de> for BlockchainConfigParams

Source§

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<'a> Load<'a> for BlockchainConfigParams

Source§

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

Tries to load itself from a cell slice.
Source§

impl PartialEq for BlockchainConfigParams

Source§

fn eq(&self, other: &BlockchainConfigParams) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BlockchainConfigParams

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Store for BlockchainConfigParams

Source§

fn store_into( &self, builder: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>

Tries to store itself into the cell builder.
Source§

impl Eq for BlockchainConfigParams

Source§

impl StructuralPartialEq for BlockchainConfigParams

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compares self to key and returns true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> EquivalentRepr<T> for T