Enum unc_primitives::epoch_manager::block_info::BlockInfo
source · pub enum BlockInfo {
V1(BlockInfoV1),
V2(BlockInfoV2),
}Expand description
Information per each block.
Variants§
V1(BlockInfoV1)
V2(BlockInfoV2)
Implementations§
source§impl BlockInfo
impl BlockInfo
pub fn new( hash: CryptoHash, height: BlockHeight, last_finalized_height: BlockHeight, last_final_block_hash: CryptoHash, prev_hash: CryptoHash, power_proposals: Vec<ValidatorPower>, pledge_proposals: Vec<ValidatorPledge>, validator_mask: Vec<bool>, slashed: Vec<SlashedValidator>, total_supply: Balance, latest_protocol_version: ProtocolVersion, timestamp_nanosec: u64, random_value: CryptoHash, validators: Vec<ValidatorPowerAndPledge>, validator_to_index: HashMap<AccountId, ValidatorId>, block_producers_settlement: Vec<ValidatorId>, chunk_producers_settlement: Vec<Vec<ValidatorId>>, fishermen: Vec<ValidatorPowerAndPledge>, fishermen_to_index: HashMap<AccountId, ValidatorId>, power_change: BTreeMap<AccountId, Power>, pledge_change: BTreeMap<AccountId, Balance>, validator_reward: HashMap<AccountId, Balance>, seat_price: Balance, minted_amount: Balance, all_power_proposals: Vec<ValidatorPower>, all_pledge_proposals: Vec<ValidatorPledge>, validator_kickout: HashMap<AccountId, ValidatorKickoutReason>, validator_mandates: ValidatorMandates ) -> Self
pub fn power_proposals_iter(&self) -> ValidatorPowerIter<'_> ⓘ
pub fn pledge_proposals_iter(&self) -> ValidatorPledgeIter<'_> ⓘ
pub fn hash(&self) -> &CryptoHash
pub fn slashed(&self) -> &HashMap<AccountId, SlashState>
pub fn slashed_mut(&mut self) -> &mut HashMap<AccountId, SlashState>
pub fn height(&self) -> BlockHeight
pub fn last_finalized_height(&self) -> BlockHeight
pub fn last_final_block_hash(&self) -> &CryptoHash
pub fn prev_hash(&self) -> &CryptoHash
pub fn epoch_first_block(&self) -> &CryptoHash
pub fn epoch_first_block_mut(&mut self) -> &mut CryptoHash
pub fn epoch_id(&self) -> &EpochId
pub fn epoch_id_mut(&mut self) -> &mut EpochId
pub fn chunk_mask(&self) -> &[bool]
pub fn latest_protocol_version(&self) -> &ProtocolVersion
pub fn total_supply(&self) -> &Balance
pub fn timestamp_nanosec(&self) -> &u64
sourcepub fn random_value(&self) -> &CryptoHash
pub fn random_value(&self) -> &CryptoHash
start customized by James Savechives
pub fn seat_price(&self) -> Balance
pub fn minted_amount(&self) -> Balance
pub fn block_producers_settlement(&self) -> &[ValidatorId]
pub fn chunk_producers_settlement(&self) -> &[Vec<ValidatorId>]
pub fn validator_kickout(&self) -> &HashMap<AccountId, ValidatorKickoutReason>
pub fn pledge_change(&self) -> &BTreeMap<AccountId, Balance>
pub fn power_change(&self) -> &BTreeMap<AccountId, Power>
pub fn validator_reward(&self) -> &HashMap<AccountId, Balance>
pub fn validators_iter(&self) -> ValidatorPowerAndPledgeIter<'_> ⓘ
pub fn fishermen_iter(&self) -> ValidatorPowerAndPledgeIter<'_> ⓘ
pub fn validator_power(&self, validator_id: u64) -> Power
pub fn validator_stake(&self, validator_id: u64) -> Balance
pub fn validator_account_id(&self, validator_id: u64) -> &AccountId
pub fn account_is_validator(&self, account_id: &AccountId) -> bool
pub fn get_validator_id(&self, account_id: &AccountId) -> Option<&ValidatorId>
pub fn get_validator_by_account( &self, account_id: &AccountId ) -> Option<ValidatorPowerAndPledge>
pub fn get_validator(&self, validator_id: u64) -> ValidatorPowerAndPledge
pub fn account_is_fisherman(&self, account_id: &AccountId) -> bool
pub fn get_fisherman_by_account( &self, account_id: &AccountId ) -> Option<ValidatorPowerAndPledge>
pub fn get_fisherman(&self, fisherman_id: u64) -> ValidatorPowerAndPledge
pub fn validators_len(&self) -> usize
pub fn vrf_block_producer(&self, _random_value: &CryptoHash) -> ValidatorId
Trait Implementations§
source§impl BorshDeserialize for BlockInfo
impl BorshDeserialize for BlockInfo
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for BlockInfo
impl BorshSerialize for BlockInfo
source§impl PartialEq for BlockInfo
impl PartialEq for BlockInfo
impl Eq for BlockInfo
impl StructuralPartialEq for BlockInfo
Auto Trait Implementations§
impl Freeze for BlockInfo
impl RefUnwindSafe for BlockInfo
impl Send for BlockInfo
impl Sync for BlockInfo
impl Unpin for BlockInfo
impl UnwindSafe for BlockInfo
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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.