Enum sc_transaction_pool_api::TransactionStatus[][src]

pub enum TransactionStatus<Hash, BlockHash> {
    Future,
    Ready,
    Broadcast(Vec<String>),
    InBlock(BlockHash),
    Retracted(BlockHash),
    FinalityTimeout(BlockHash),
    Finalized(BlockHash),
    Usurped(Hash),
    Dropped,
    Invalid,
}
Expand description

Possible transaction status events.

This events are being emitted by TransactionPool watchers, which are also exposed over RPC.

The 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
    1. Re-entering the pool:
      • Retracted
    2. 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.

There is also only single event causing the transaction to leave the pool. I.e. only one of the listed ones should be triggered.

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 in included in one block, may later re-enter the pool or be marked as invalid.
  2. Transaction Dropped at one point, may later re-enter the pool if some other transactions are removed.
  3. Invalid transaction may become valid at some point in the future. (Note that runtimes are encouraged to use UnknownValidity to inform the pool about such case).
  4. Retracted transactions might be included in some next block.

The stream is considered finished only when either 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 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. If you choose to wait for finality longer, you can re-subscribe for a particular transaction hash manually again.

Variants

Future

Transaction is part of the future queue.

Ready

Transaction is part of the ready queue.

Broadcast(Vec<String>)

The transaction has been broadcast to the given peers.

InBlock(BlockHash)

Transaction has been included in block with given hash.

Retracted(BlockHash)

The block this transaction was included in has been retracted.

FinalityTimeout(BlockHash)

Maximum number of finality watchers has been reached, old watchers are being removed.

Finalized(BlockHash)

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

Usurped(Hash)

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

Dropped

Transaction has been dropped from the pool because of the limit.

Invalid

Transaction is no longer valid in the current state.

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

Deserialize this value from the given Serde deserializer. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. 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

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

Performs the conversion.

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

Performs the conversion.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

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)

recently added

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.