pub struct BlockchainConfigParams(/* private fields */);Expand description
A non-empty dictionary with blockchain config params.
Implementations§
Source§impl BlockchainConfigParams
impl BlockchainConfigParams
Sourcepub fn from_raw(dict_root: Cell) -> Self
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.
Sourcepub fn get_elector_address(&self) -> Result<HashBytes, Error>
pub fn get_elector_address(&self) -> Result<HashBytes, Error>
Returns the elector account address (in masterchain).
Uses ConfigParam1.
Sourcepub fn set_elector_address(
&mut self,
address: &HashBytes,
) -> Result<bool, Error>
pub fn set_elector_address( &mut self, address: &HashBytes, ) -> Result<bool, Error>
Updates the elector account address (in masterchain).
Uses ConfigParam1.
Sourcepub fn get_minter_address(&self) -> Result<HashBytes, Error>
pub fn get_minter_address(&self) -> Result<HashBytes, Error>
Returns the minter account address (in masterchain).
Uses ConfigParam2 with a fallback to ConfigParam0 (config).
Sourcepub fn set_minter_address(&mut self, address: &HashBytes) -> Result<bool, Error>
pub fn set_minter_address(&mut self, address: &HashBytes) -> Result<bool, Error>
Updates the minter account address (in masterchain).
Uses ConfigParam2.
Sourcepub fn get_burning_config(&self) -> Result<BurningConfig, Error>
pub fn get_burning_config(&self) -> Result<BurningConfig, Error>
Returns the burning config.
Uses ConfigParam5.
Sourcepub fn set_burning_config(
&mut self,
config: &BurningConfig,
) -> Result<bool, Error>
pub fn set_burning_config( &mut self, config: &BurningConfig, ) -> Result<bool, Error>
Updates the burning config.
Uses ConfigParam5.
Sourcepub fn get_fee_collector_address(&self) -> Result<HashBytes, Error>
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).
Sourcepub fn set_fee_collector_address(
&mut self,
address: &HashBytes,
) -> Result<bool, Error>
pub fn set_fee_collector_address( &mut self, address: &HashBytes, ) -> Result<bool, Error>
Updates the fee collector address (in masterchain).
Uses ConfigParam3.
Sourcepub fn get_global_version(&self) -> Result<GlobalVersion, Error>
pub fn get_global_version(&self) -> Result<GlobalVersion, Error>
Returns the lowest supported block version and required capabilities.
Uses ConfigParam8.
Sourcepub fn set_global_version(
&mut self,
version: &GlobalVersion,
) -> Result<bool, Error>
pub fn set_global_version( &mut self, version: &GlobalVersion, ) -> Result<bool, Error>
Updates the global version.
Uses ConfigParam8.
Sourcepub fn get_mandatory_params(&self) -> Result<Dict<u32, ()>, Error>
pub fn get_mandatory_params(&self) -> Result<Dict<u32, ()>, Error>
Returns a list of params that must be present in config.
Uses ConfigParam9.
Sourcepub fn set_mandatory_params(&mut self, params: &[u32]) -> Result<bool, Error>
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.
Sourcepub fn get_critical_params(&self) -> Result<Dict<u32, ()>, Error>
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.
Sourcepub fn set_critical_params(&mut self, params: &[u32]) -> Result<bool, Error>
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.
Sourcepub fn get_workchains(&self) -> Result<Dict<i32, WorkchainDescription>, Error>
pub fn get_workchains(&self) -> Result<Dict<i32, WorkchainDescription>, Error>
Returns a dictionary with workchain descriptions.
Uses ConfigParam12.
Sourcepub fn set_workchains(
&mut self,
workchains: &Dict<i32, WorkchainDescription>,
) -> Result<bool, Error>
pub fn set_workchains( &mut self, workchains: &Dict<i32, WorkchainDescription>, ) -> Result<bool, Error>
Updates a list of workchain descriptions.
Uses ConfigParam12.
Sourcepub fn get_block_creation_reward(
&self,
masterchain: bool,
) -> Result<Tokens, Error>
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.
Sourcepub fn get_block_creation_rewards(&self) -> Result<BlockCreationRewards, Error>
pub fn get_block_creation_rewards(&self) -> Result<BlockCreationRewards, Error>
Returns a block creation rewards in tokens.
Uses ConfigParam14.
Sourcepub fn set_block_creation_rewards(
&mut self,
rewards: &BlockCreationRewards,
) -> Result<bool, Error>
pub fn set_block_creation_rewards( &mut self, rewards: &BlockCreationRewards, ) -> Result<bool, Error>
Updates a block creation rewards in tokens.
Uses ConfigParam14.
Sourcepub fn get_election_timings(&self) -> Result<ElectionTimings, Error>
pub fn get_election_timings(&self) -> Result<ElectionTimings, Error>
Returns election timings.
Uses ConfigParam15.
Sourcepub fn set_election_timings(
&mut self,
timings: &ElectionTimings,
) -> Result<bool, Error>
pub fn set_election_timings( &mut self, timings: &ElectionTimings, ) -> Result<bool, Error>
Updates election timings.
Uses ConfigParam15.
Sourcepub fn get_validator_count_params(&self) -> Result<ValidatorCountParams, Error>
pub fn get_validator_count_params(&self) -> Result<ValidatorCountParams, Error>
Returns possible validator count.
Uses ConfigParam16.
Sourcepub fn set_validator_count_params(
&mut self,
params: &ValidatorCountParams,
) -> Result<bool, Error>
pub fn set_validator_count_params( &mut self, params: &ValidatorCountParams, ) -> Result<bool, Error>
Updates possible validator count.
Uses ConfigParam16.
Sourcepub fn get_validator_stake_params(&self) -> Result<ValidatorStakeParams, Error>
pub fn get_validator_stake_params(&self) -> Result<ValidatorStakeParams, Error>
Returns validator stake range and factor.
Uses ConfigParam17.
Sourcepub fn set_validator_stake_params(
&mut self,
params: &ValidatorStakeParams,
) -> Result<bool, Error>
pub fn set_validator_stake_params( &mut self, params: &ValidatorStakeParams, ) -> Result<bool, Error>
Updates validator stake range and factor.
Uses ConfigParam17.
Sourcepub fn get_storage_prices(&self) -> Result<Dict<u32, StoragePrices>, Error>
pub fn get_storage_prices(&self) -> Result<Dict<u32, StoragePrices>, Error>
Returns a list with a history of all storage prices.
Uses ConfigParam18.
Sourcepub fn set_storage_prices(
&mut self,
prices: &[StoragePrices],
) -> Result<bool, Error>
pub fn set_storage_prices( &mut self, prices: &[StoragePrices], ) -> Result<bool, Error>
Updates a list with a history of all storage prices.
Uses ConfigParam18.
Sourcepub fn get_global_id(&self) -> Result<i32, Error>
pub fn get_global_id(&self) -> Result<i32, Error>
Returns a global id.
Sourcepub fn get_gas_prices(
&self,
masterchain: bool,
) -> Result<GasLimitsPrices, Error>
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).
Sourcepub fn set_gas_prices(
&mut self,
masterchain: bool,
prices: &GasLimitsPrices,
) -> Result<bool, Error>
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).
Sourcepub fn get_block_limits(&self, masterchain: bool) -> Result<BlockLimits, Error>
pub fn get_block_limits(&self, masterchain: bool) -> Result<BlockLimits, Error>
Returns block limits.
Uses ConfigParam22 (for masterchain) or ConfigParam23 (for other workchains).
Sourcepub fn set_block_limits(
&mut self,
masterchain: bool,
limits: &BlockLimits,
) -> Result<bool, Error>
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).
Sourcepub fn get_msg_forward_prices(
&self,
masterchain: bool,
) -> Result<MsgForwardPrices, Error>
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).
Sourcepub fn set_msg_forward_prices(
&mut self,
masterchain: bool,
prices: &MsgForwardPrices,
) -> Result<bool, Error>
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).
Sourcepub fn get_catchain_config(&self) -> Result<CatchainConfig, Error>
pub fn get_catchain_config(&self) -> Result<CatchainConfig, Error>
Returns a catchain config.
Uses ConfigParam28.
Sourcepub fn set_catchain_config(
&mut self,
config: &CatchainConfig,
) -> Result<bool, Error>
pub fn set_catchain_config( &mut self, config: &CatchainConfig, ) -> Result<bool, Error>
Updates a catchain config.
Uses ConfigParam28.
Sourcepub fn get_consensus_config(&self) -> Result<ConsensusConfig, Error>
pub fn get_consensus_config(&self) -> Result<ConsensusConfig, Error>
Returns a consensus config.
Uses ConfigParam29.
Sourcepub fn set_consensus_config(
&mut self,
config: &ConsensusConfig,
) -> Result<bool, Error>
pub fn set_consensus_config( &mut self, config: &ConsensusConfig, ) -> Result<bool, Error>
Updates a consensus config.
Uses ConfigParam29.
Sourcepub fn get_fundamental_addresses(&self) -> Result<Dict<HashBytes, ()>, Error>
pub fn get_fundamental_addresses(&self) -> Result<Dict<HashBytes, ()>, Error>
Returns a list of fundamental account addresses (in masterchain).
Uses ConfigParam31.
Sourcepub fn set_fundamental_addresses(
&mut self,
addresses: &[HashBytes],
) -> Result<bool, Error>
pub fn set_fundamental_addresses( &mut self, addresses: &[HashBytes], ) -> Result<bool, Error>
Updates a list of fundamental account addresses (in masterchain).
Uses ConfigParam31.
Sourcepub fn contains_prev_validator_set(&self) -> Result<bool, Error>
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.
Sourcepub fn contains_next_validator_set(&self) -> Result<bool, Error>
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.
Sourcepub fn get_previous_validator_set(&self) -> Result<Option<ValidatorSet>, Error>
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).
Sourcepub fn get_current_validator_set(&self) -> Result<ValidatorSet, Error>
pub fn get_current_validator_set(&self) -> Result<ValidatorSet, Error>
Returns the current validator set.
Uses ConfigParam35 (temp validators) or ConfigParam34 (current validators).
Sourcepub fn get_next_validator_set(&self) -> Result<Option<ValidatorSet>, Error>
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).
Sourcepub fn get_size_limits(&self) -> Result<SizeLimitsConfig, Error>
pub fn get_size_limits(&self) -> Result<SizeLimitsConfig, Error>
Returns size limits.
Sourcepub fn set_size_limits(
&mut self,
size_limits: &SizeLimitsConfig,
) -> Result<bool, Error>
pub fn set_size_limits( &mut self, size_limits: &SizeLimitsConfig, ) -> Result<bool, Error>
Updates a global id.
Sourcepub fn contains<'a, T: KnownConfigParam<'a>>(&'a self) -> Result<bool, Error>
pub fn contains<'a, T: KnownConfigParam<'a>>(&'a self) -> Result<bool, Error>
Returns true if the config contains a param for the specified id.
Sourcepub fn contains_raw(&self, id: u32) -> Result<bool, Error>
pub fn contains_raw(&self, id: u32) -> Result<bool, Error>
Returns true if the config contains a param for the specified id.
Sourcepub fn get<'a, T: KnownConfigParam<'a>>(
&'a self,
) -> Result<Option<T::Value>, Error>
pub fn get<'a, T: KnownConfigParam<'a>>( &'a self, ) -> Result<Option<T::Value>, Error>
Tries to get a parameter from the blockchain config.
Sourcepub fn set<'a, T: KnownConfigParam<'a>>(
&'a mut self,
value: &T::Value,
) -> Result<bool, Error>
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.
Sourcepub fn get_raw(&self, id: u32) -> Result<Option<CellSlice<'_>>, Error>
pub fn get_raw(&self, id: u32) -> Result<Option<CellSlice<'_>>, Error>
Tries to get a raw parameter from the blockchain config (as slice).
Sourcepub fn get_raw_cell(&self, id: u32) -> Result<Option<Cell>, Error>
pub fn get_raw_cell(&self, id: u32) -> Result<Option<Cell>, Error>
Tries to get a raw parameter from the blockchain config (as cell).
Sourcepub fn get_raw_cell_ref(&self, id: u32) -> Result<Option<&DynCell>, Error>
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).
Sourcepub fn set_raw(&mut self, id: u32, value: Cell) -> Result<bool, Error>
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.
Trait Implementations§
Source§impl Clone for BlockchainConfigParams
impl Clone for BlockchainConfigParams
Source§fn clone(&self) -> BlockchainConfigParams
fn clone(&self) -> BlockchainConfigParams
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BlockchainConfigParams
impl Debug for BlockchainConfigParams
Source§impl<'de> Deserialize<'de> for BlockchainConfigParams
impl<'de> Deserialize<'de> for BlockchainConfigParams
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>,
Source§impl<'a> Load<'a> for BlockchainConfigParams
impl<'a> Load<'a> for BlockchainConfigParams
Source§impl PartialEq for BlockchainConfigParams
impl PartialEq for BlockchainConfigParams
Source§fn eq(&self, other: &BlockchainConfigParams) -> bool
fn eq(&self, other: &BlockchainConfigParams) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for BlockchainConfigParams
impl Serialize for BlockchainConfigParams
Source§impl Store for BlockchainConfigParams
impl Store for BlockchainConfigParams
Source§fn store_into(
&self,
builder: &mut CellBuilder,
_: &dyn CellContext,
) -> Result<(), Error>
fn store_into( &self, builder: &mut CellBuilder, _: &dyn CellContext, ) -> Result<(), Error>
impl Eq for BlockchainConfigParams
impl StructuralPartialEq for BlockchainConfigParams
Auto Trait Implementations§
impl Freeze for BlockchainConfigParams
impl !RefUnwindSafe for BlockchainConfigParams
impl Send for BlockchainConfigParams
impl Sync for BlockchainConfigParams
impl Unpin for BlockchainConfigParams
impl !UnwindSafe for BlockchainConfigParams
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self to key and returns true if they are equal.