Struct ledger_mob_core::engine::BlockVersion
pub struct BlockVersion(/* private fields */);
Expand description
A block version number that is known to be less or equal to BlockVersion::MAX
Note: BlockVersion::MAX may vary from client to client as we roll out network upgrades. Software should handle errors where the block version of the network is not supported, generally by requesting users to upgrade their software.
If you need to manipulate block versions that come from the network, you should use u32 to represent that.
Then, if you need to e.g. sign a transaction,
you should try to convert them to BlockVersion.
If that conversion fails, it means that this set of rules
is not understood by your version of mc-transaction-core
.
This means that your build has reached end-of-life, and needs an update.
You should not assume that all block versions you will ever see will be understood by your version of transaction core, otherwise there will be no way for your software to help the user to upgrade when you reach EOL.
For example, BlockVersion::try_from(...).unwrap()
is typically a bug
if it’s not in test code.
Implementations§
§impl BlockVersion
impl BlockVersion
pub const MAX: BlockVersion = Self::FOUR
pub const MAX: BlockVersion = Self::FOUR
The maximum value of block_version that this build of mc-transaction-core has support for
pub const ZERO: BlockVersion = _
pub const ZERO: BlockVersion = _
Refers to the block version number at network launch.
pub const ONE: BlockVersion = _
pub const ONE: BlockVersion = _
Constant for block version one
pub const TWO: BlockVersion = _
pub const TWO: BlockVersion = _
Constant for block version two
pub const THREE: BlockVersion = _
pub const THREE: BlockVersion = _
Constant for block version three
pub const FOUR: BlockVersion = _
pub const FOUR: BlockVersion = _
Constant for block version four
pub fn iterator() -> BlockVersionIterator
pub fn iterator() -> BlockVersionIterator
Iterator over block versions from one up to max, inclusive. For use in tests.
pub fn e_memo_feature_is_supported(&self) -> bool
pub fn e_memo_feature_is_supported(&self) -> bool
The encrypted memos feature is introduced in v1. MCIP #3
pub fn masked_token_id_feature_is_supported(&self) -> bool
pub fn masked_token_id_feature_is_supported(&self) -> bool
The confidential token ids feature is introduced in v2. MCIP #25
pub fn validate_transaction_outputs_are_sorted(&self) -> bool
pub fn validate_transaction_outputs_are_sorted(&self) -> bool
Transactions must be sorted from v3 onward. MCIP #34
pub fn mint_transactions_are_supported(&self) -> bool
pub fn mint_transactions_are_supported(&self) -> bool
Mint transactions are introduced in v2. MCIP #37
pub fn minting_to_fog_addresses_is_supported(&self) -> bool
pub fn minting_to_fog_addresses_is_supported(&self) -> bool
Minting_to_fog_addresses is supported in v3 MCIP #53
pub fn mlsags_sign_extended_message_digest(&self) -> bool
pub fn mlsags_sign_extended_message_digest(&self) -> bool
The extended message digest is used when signing MLSAGs in v2 and higher. This is described in MCIP #25.
pub fn mixed_transactions_are_supported(&self) -> bool
pub fn mixed_transactions_are_supported(&self) -> bool
Mixed transactions are introduced in v3 MCIP #31
pub fn signed_input_rules_are_supported(&self) -> bool
pub fn signed_input_rules_are_supported(&self) -> bool
Signed input rules are introduced in v3. MCIP #31
pub fn masked_amount_v2_is_supported(&self) -> bool
pub fn masked_amount_v2_is_supported(&self) -> bool
Masked amount V2 derivation introduced with block version 3. MCIP #42
pub fn require_block_metadata(&self) -> bool
pub fn require_block_metadata(&self) -> bool
BlockData.metadata
is required starting from v3.
MCIP #43
pub fn mlsags_sign_extended_message_and_tx_summary_digest(&self) -> bool
pub fn mlsags_sign_extended_message_and_tx_summary_digest(&self) -> bool
MLSAGs sign extended-message-and-tx-summary digest starting from v3. MCIP #52
pub fn nested_multisigs_are_supported(&self) -> bool
pub fn nested_multisigs_are_supported(&self) -> bool
Nested multisigs are supporoted starting from v3. [MCIP #TODO]
Methods from Deref<Target = u32>§
pub const MIN: u32 = 0u32
pub const MAX: u32 = 4_294_967_295u32
pub const BITS: u32 = 32u32
Trait Implementations§
§impl Clone for BlockVersion
impl Clone for BlockVersion
§fn clone(&self) -> BlockVersion
fn clone(&self) -> BlockVersion
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for BlockVersion
impl Debug for BlockVersion
§impl Default for BlockVersion
impl Default for BlockVersion
§fn default() -> BlockVersion
fn default() -> BlockVersion
§impl Deref for BlockVersion
impl Deref for BlockVersion
§impl<'de> Deserialize<'de> for BlockVersion
impl<'de> Deserialize<'de> for BlockVersion
§fn deserialize<__D>(
__deserializer: __D
) -> Result<BlockVersion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<BlockVersion, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
§impl Digestible for BlockVersion
impl Digestible for BlockVersion
§fn append_to_transcript<DT>(&self, context: &'static [u8], transcript: &mut DT)where
DT: DigestTranscript,
fn append_to_transcript<DT>(&self, context: &'static [u8], transcript: &mut DT)where DT: DigestTranscript,
§fn digest32<DT>(&self, context: &'static [u8]) -> [u8; 32]where
DT: DigestTranscript,
fn digest32<DT>(&self, context: &'static [u8]) -> [u8; 32]where DT: DigestTranscript,
§fn append_to_transcript_allow_omit<DT>(
&self,
context: &'static [u8],
transcript: &mut DT
)where
DT: DigestTranscript,
fn append_to_transcript_allow_omit<DT>( &self, context: &'static [u8], transcript: &mut DT )where DT: DigestTranscript,
§impl Display for BlockVersion
impl Display for BlockVersion
§impl FromStr for BlockVersion
impl FromStr for BlockVersion
§impl Hash for BlockVersion
impl Hash for BlockVersion
§impl Ord for BlockVersion
impl Ord for BlockVersion
§impl PartialEq<BlockVersion> for BlockVersion
impl PartialEq<BlockVersion> for BlockVersion
§fn eq(&self, other: &BlockVersion) -> bool
fn eq(&self, other: &BlockVersion) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd<BlockVersion> for BlockVersion
impl PartialOrd<BlockVersion> for BlockVersion
§fn partial_cmp(&self, other: &BlockVersion) -> Option<Ordering>
fn partial_cmp(&self, other: &BlockVersion) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more