Enum subxt::tx::TxStatus

source ·
pub enum TxStatus<T: Config, C> {
    Future,
    Ready,
    Broadcast(Vec<String>),
    InBlock(TxInBlock<T, C>),
    Retracted(T::Hash),
    FinalityTimeout(T::Hash),
    Finalized(TxInBlock<T, C>),
    Usurped(T::Hash),
    Dropped,
    Invalid,
}
Expand description

Possible transaction statuses returned from our TxProgress::next_item() call.

These status events can be grouped based on their kinds as:

  1. Entering/Moving within the pool:
    • Future
    • Ready
  2. Inside Ready queue:
    • Broadcast
  3. Leaving the pool:
    • InBlock
    • Invalid
    • Usurped
    • Dropped
  4. Re-entering the pool:
    • Retracted
  5. Block finalized:
    • Finalized
    • FinalityTimeout

The events will always be received in the order described above, however there might be cases where transactions alternate between Future and Ready pool, and are Broadcast in the meantime.

Note that there are conditions that may cause transactions to reappear in the pool:

  1. Due to possible forks, the transaction that ends up being included in one block may later re-enter the pool or be marked as invalid.
  2. A transaction that is Dropped at one point may later re-enter the pool if some other transactions are removed.
  3. Invalid transactions may become valid at some point in the future. (Note that runtimes are encouraged to use UnknownValidity to inform the pool about such cases).
  4. Retracted transactions might be included in a future block.

The stream is considered finished only when either the Finalized or FinalityTimeout event is triggered. You are however free to unsubscribe from notifications at any point. The first one will be emitted when the block in which the transaction was included gets finalized. The FinalityTimeout event will be emitted when the block did not reach finality within 512 blocks. This either indicates that finality is not available for your chain, or that finality gadget is lagging behind.

Variants§

§

Future

The transaction is part of the “future” queue.

§

Ready

The transaction is part of the “ready” queue.

§

Broadcast(Vec<String>)

The transaction has been broadcast to the given peers.

§

InBlock(TxInBlock<T, C>)

The transaction has been included in a block with given hash.

§

Retracted(T::Hash)

The block this transaction was included in has been retracted, probably because it did not make it onto the blocks which were finalized.

§

FinalityTimeout(T::Hash)

A block containing the transaction did not reach finality within 512 blocks, and so the subscription has ended.

§

Finalized(TxInBlock<T, C>)

The transaction has been finalized by a finality-gadget, e.g GRANDPA.

§

Usurped(T::Hash)

The transaction has been replaced in the pool by another transaction that provides the same tags. (e.g. same (sender, nonce)).

§

Dropped

The transaction has been dropped from the pool because of the limit.

§

Invalid

The transaction is no longer valid in the current state.

Implementations§

A convenience method to return the Finalized details. Returns None if the enum variant is not TxStatus::Finalized.

A convenience method to return the InBlock details. Returns None if the enum variant is not TxStatus::InBlock.

Trait Implementations§

Formats the value using the given formatter. Read more

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
Converts self into T using Into<T>. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. 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.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
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
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
Attempts to convert self into T using TryInto<T>. 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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more