Struct sp_runtime::transaction_validity::ValidTransactionBuilder[][src]

pub struct ValidTransactionBuilder { /* fields omitted */ }

ValidTransaction builder.

Allows to easily construct ValidTransaction and most importantly takes care of prefixing requires and provides tags to avoid conflicts.

Implementations

impl ValidTransactionBuilder[src]

pub fn priority(mut self: Self, priority: TransactionPriority) -> Self[src]

Set the priority of a transaction.

Note that the final priority for FRAME is combined from all SignedExtensions. Most likely for unsigned transactions you want the priority to be higher than for regular transactions. We recommend exposing a base priority for unsigned transactions as a runtime module parameter, so that the runtime can tune inter-module priorities.

pub fn longevity(mut self: Self, longevity: TransactionLongevity) -> Self[src]

Set the longevity of a transaction.

By default the transaction will be considered valid forever and will not be revalidated by the transaction pool. It's recommended though to set the longevity to a finite value though. If unsure, it's also reasonable to expose this parameter via module configuration and let the runtime decide.

pub fn propagate(mut self: Self, propagate: bool) -> Self[src]

Set the propagate flag.

Set to false if the transaction is not meant to be gossiped to peers. Combined with TransactionSource::Local validation it can be used to have special kind of transactions that are only produced and included by the validator nodes.

pub fn and_requires(mut self: Self, tag: impl Encode) -> Self[src]

Add a TransactionTag to the set of required tags.

The tag will be encoded and prefixed with module prefix (if any). If you'd rather add a raw require tag, consider using #combine_with method.

pub fn and_provides(mut self: Self, tag: impl Encode) -> Self[src]

Add a TransactionTag to the set of provided tags.

The tag will be encoded and prefixed with module prefix (if any). If you'd rather add a raw require tag, consider using #combine_with method.

pub fn combine_with(mut self: Self, validity: ValidTransaction) -> Self[src]

Augment the builder with existing ValidTransaction.

This method does add the prefix to require or provides tags.

pub fn build(self) -> TransactionValidity[src]

Finalize the builder and produce TransactionValidity.

Note the result will always be Ok. Use Into to produce ValidTransaction.

Trait Implementations

impl Clone for ValidTransactionBuilder[src]

impl Debug for ValidTransactionBuilder[src]

impl Default for ValidTransactionBuilder[src]

impl From<ValidTransactionBuilder> for TransactionValidity[src]

impl From<ValidTransactionBuilder> for ValidTransaction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    T: From<Outer>,
    Outer: AsRef<T> + AsMut<T> + From<T>, 
[src]

pub fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

pub fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    T: Bounded,
    S: TryInto<T>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,