Struct sov_chain_state::StateTransitionId
source · pub struct StateTransitionId<Da: DaSpec> { /* private fields */ }
Expand description
Structure that contains the information needed to represent a single state transition.
Implementations§
source§impl<Da: DaSpec> StateTransitionId<Da>
impl<Da: DaSpec> StateTransitionId<Da>
sourcepub fn new(
da_block_hash: Da::SlotHash,
post_state_root: [u8; 32],
validity_condition: Da::ValidityCondition
) -> Self
pub fn new( da_block_hash: Da::SlotHash, post_state_root: [u8; 32], validity_condition: Da::ValidityCondition ) -> Self
Creates a new state transition. Only available for testing as we only want to create
new state transitions from existing TransitionInProgress
.
source§impl<Da: DaSpec> StateTransitionId<Da>
impl<Da: DaSpec> StateTransitionId<Da>
sourcepub fn compare_hashes(
&self,
da_block_hash: &Da::SlotHash,
post_state_root: &[u8; 32]
) -> bool
pub fn compare_hashes( &self, da_block_hash: &Da::SlotHash, post_state_root: &[u8; 32] ) -> bool
Compare the transition block hash and state root with the provided input couple. If
the pairs are equal, return true
.
sourcepub fn post_state_root(&self) -> [u8; 32]
pub fn post_state_root(&self) -> [u8; 32]
Returns the post state root of a state transition
sourcepub fn da_block_hash(&self) -> &Da::SlotHash
pub fn da_block_hash(&self) -> &Da::SlotHash
Returns the da block hash of a state transition
sourcepub fn validity_condition(&self) -> &Da::ValidityCondition
pub fn validity_condition(&self) -> &Da::ValidityCondition
Returns the validity condition associated with the transition
sourcepub fn validity_condition_check<Checker: ValidityConditionChecker<Da::ValidityCondition>>(
&self,
checker: &mut Checker
) -> Result<(), <Checker as ValidityConditionChecker<Da::ValidityCondition>>::Error>
pub fn validity_condition_check<Checker: ValidityConditionChecker<Da::ValidityCondition>>( &self, checker: &mut Checker ) -> Result<(), <Checker as ValidityConditionChecker<Da::ValidityCondition>>::Error>
Checks the validity condition of a state transition
Trait Implementations§
source§impl<Da: DaSpec> BorshDeserialize for StateTransitionId<Da>where
Da::SlotHash: BorshDeserialize,
[u8; 32]: BorshDeserialize,
Da::ValidityCondition: BorshDeserialize,
impl<Da: DaSpec> BorshDeserialize for StateTransitionId<Da>where Da::SlotHash: BorshDeserialize, [u8; 32]: BorshDeserialize, Da::ValidityCondition: BorshDeserialize,
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<Da: DaSpec> BorshSerialize for StateTransitionId<Da>where
Da::SlotHash: BorshSerialize,
[u8; 32]: BorshSerialize,
Da::ValidityCondition: BorshSerialize,
impl<Da: DaSpec> BorshSerialize for StateTransitionId<Da>where Da::SlotHash: BorshSerialize, [u8; 32]: BorshSerialize, Da::ValidityCondition: BorshSerialize,
source§impl<Da: Clone + DaSpec> Clone for StateTransitionId<Da>where
Da::SlotHash: Clone,
Da::ValidityCondition: Clone,
impl<Da: Clone + DaSpec> Clone for StateTransitionId<Da>where Da::SlotHash: Clone, Da::ValidityCondition: Clone,
source§fn clone(&self) -> StateTransitionId<Da>
fn clone(&self) -> StateTransitionId<Da>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Da: Debug + DaSpec> Debug for StateTransitionId<Da>where
Da::SlotHash: Debug,
Da::ValidityCondition: Debug,
impl<Da: Debug + DaSpec> Debug for StateTransitionId<Da>where Da::SlotHash: Debug, Da::ValidityCondition: Debug,
source§impl<'de, Da: DaSpec> Deserialize<'de> for StateTransitionId<Da>where
Da::SlotHash: Deserialize<'de>,
Da::ValidityCondition: Deserialize<'de>,
impl<'de, Da: DaSpec> Deserialize<'de> for StateTransitionId<Da>where Da::SlotHash: Deserialize<'de>, Da::ValidityCondition: Deserialize<'de>,
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<Da: PartialEq + DaSpec> PartialEq<StateTransitionId<Da>> for StateTransitionId<Da>where
Da::SlotHash: PartialEq,
Da::ValidityCondition: PartialEq,
impl<Da: PartialEq + DaSpec> PartialEq<StateTransitionId<Da>> for StateTransitionId<Da>where Da::SlotHash: PartialEq, Da::ValidityCondition: PartialEq,
source§fn eq(&self, other: &StateTransitionId<Da>) -> bool
fn eq(&self, other: &StateTransitionId<Da>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Da: DaSpec> Serialize for StateTransitionId<Da>where
Da::SlotHash: Serialize,
Da::ValidityCondition: Serialize,
impl<Da: DaSpec> Serialize for StateTransitionId<Da>where Da::SlotHash: Serialize, Da::ValidityCondition: Serialize,
impl<Da: Eq + DaSpec> Eq for StateTransitionId<Da>where Da::SlotHash: Eq, Da::ValidityCondition: Eq,
impl<Da: DaSpec> StructuralEq for StateTransitionId<Da>
impl<Da: DaSpec> StructuralPartialEq for StateTransitionId<Da>
Auto Trait Implementations§
impl<Da> RefUnwindSafe for StateTransitionId<Da>where <Da as DaSpec>::SlotHash: RefUnwindSafe, <Da as DaSpec>::ValidityCondition: RefUnwindSafe,
impl<Da> Send for StateTransitionId<Da>
impl<Da> Sync for StateTransitionId<Da>
impl<Da> Unpin for StateTransitionId<Da>where <Da as DaSpec>::SlotHash: Unpin, <Da as DaSpec>::ValidityCondition: Unpin,
impl<Da> UnwindSafe for StateTransitionId<Da>where <Da as DaSpec>::SlotHash: UnwindSafe, <Da as DaSpec>::ValidityCondition: UnwindSafe,
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
Mutably borrows from an owned value. Read more