Struct sp_runtime::transaction_validity::ValidTransaction
source · pub struct ValidTransaction {
pub priority: TransactionPriority,
pub requires: Vec<TransactionTag>,
pub provides: Vec<TransactionTag>,
pub longevity: TransactionLongevity,
pub propagate: bool,
}
Expand description
Information concerning a valid transaction.
Fields§
§priority: TransactionPriority
Priority of the transaction.
Priority determines the ordering of two transactions that have all their dependencies (required tags) satisfied.
requires: Vec<TransactionTag>
Transaction dependencies
A non-empty list signifies that some other transactions which provide given tags are required to be included before that one.
provides: Vec<TransactionTag>
Provided tags
A list of tags this transaction provides. Successfully importing the transaction will enable other transactions that depend on (require) those tags to be included as well. Provided and required tags allow Substrate to build a dependency graph of transactions and import them in the right (linear) order.
longevity: TransactionLongevity
Transaction longevity
Longevity describes minimum number of blocks the validity is correct. After this period transaction should be removed from the pool or revalidated.
propagate: bool
A flag indicating if the transaction should be propagated to other peers.
By setting false
here the transaction will still be considered for
including in blocks that are authored on the current node, but will
never be sent to other peers.
Implementations§
source§impl ValidTransaction
impl ValidTransaction
sourcepub fn with_tag_prefix(prefix: &'static str) -> ValidTransactionBuilder
pub fn with_tag_prefix(prefix: &'static str) -> ValidTransactionBuilder
Initiate ValidTransaction
builder object with a particular prefix for tags.
To avoid conflicts between different parts in runtime it’s recommended to build requires
and provides
tags with a unique prefix.
sourcepub fn combine_with(self, other: ValidTransaction) -> Self
pub fn combine_with(self, other: ValidTransaction) -> Self
Combine two instances into one, as a best effort. This will take the superset of each of the
provides
and requires
tags, it will sum the priorities, take the minimum longevity and
the logic And of the propagate flags.
Trait Implementations§
source§impl Clone for ValidTransaction
impl Clone for ValidTransaction
source§fn clone(&self) -> ValidTransaction
fn clone(&self) -> ValidTransaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ValidTransaction
impl Debug for ValidTransaction
source§impl Decode for ValidTransaction
impl Decode for ValidTransaction
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
source§impl Default for ValidTransaction
impl Default for ValidTransaction
source§impl Encode for ValidTransaction
impl Encode for ValidTransaction
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl From<ValidTransactionBuilder> for ValidTransaction
impl From<ValidTransactionBuilder> for ValidTransaction
source§fn from(builder: ValidTransactionBuilder) -> Self
fn from(builder: ValidTransactionBuilder) -> Self
source§impl PartialEq<ValidTransaction> for ValidTransaction
impl PartialEq<ValidTransaction> for ValidTransaction
source§fn eq(&self, other: &ValidTransaction) -> bool
fn eq(&self, other: &ValidTransaction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TypeInfo for ValidTransaction
impl TypeInfo for ValidTransaction
impl EncodeLike<ValidTransaction> for ValidTransaction
impl Eq for ValidTransaction
impl StructuralEq for ValidTransaction
impl StructuralPartialEq for ValidTransaction
Auto Trait Implementations§
impl RefUnwindSafe for ValidTransaction
impl Send for ValidTransaction
impl Sync for ValidTransaction
impl Unpin for ValidTransaction
impl UnwindSafe for ValidTransaction
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere T: Codec,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.