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

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Attempt to deserialise the value from input.

Attempt to skip the encoded value from input. Read more

Returns the fixed encoded size of the type. Read more

Returns the “default value” for a type. Read more

Convert self to a slice and append it to the destination.

If possible give a hint of expected size of the encoding. Read more

Convert self to an owned vector.

Convert self to a slice and then invoke the given closure with it.

Calculates the encoded size. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

True iff no bits are set.

Return the value of Self that is clear.

Decode Self and consume all of the given input data. Read more

Decode Self and consume all of the given input data. Read more

Decode Self with the given maximum recursion depth. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Return an encoding of Self prepended by given slice.

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.