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>

source

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>

source

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.

source

pub fn post_state_root(&self) -> [u8; 32]

Returns the post state root of a state transition

source

pub fn da_block_hash(&self) -> &Da::SlotHash

Returns the da block hash of a state transition

source

pub fn validity_condition(&self) -> &Da::ValidityCondition

Returns the validity condition associated with the transition

source

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,

source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>

source§

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>

Deserialize this instance from a slice of bytes.
source§

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,

source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

source§

fn try_to_vec(&self) -> Result<Vec<u8, Global>, Error>

Serialize this instance into a vector of bytes.
source§

impl<Da: Clone + DaSpec> Clone for StateTransitionId<Da>where Da::SlotHash: Clone, Da::ValidityCondition: Clone,

source§

fn clone(&self) -> StateTransitionId<Da>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<Da: Debug + DaSpec> Debug for StateTransitionId<Da>where Da::SlotHash: Debug, Da::ValidityCondition: Debug,

source§

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

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

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>,

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,

source§

fn eq(&self, other: &StateTransitionId<Da>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Da: DaSpec> Serialize for StateTransitionId<Da>where Da::SlotHash: Serialize, Da::ValidityCondition: Serialize,

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<Da: Eq + DaSpec> Eq for StateTransitionId<Da>where Da::SlotHash: Eq, Da::ValidityCondition: Eq,

source§

impl<Da: DaSpec> StructuralEq for StateTransitionId<Da>

source§

impl<Da: DaSpec> StructuralPartialEq for StateTransitionId<Da>

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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

§

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 Twhere U: TryFrom<T>,

§

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

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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