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:
- Entering/Moving within the pool:
-
Future-Ready - Inside
Readyqueue: -Broadcast - Leaving the pool:
-
InBlock-Invalid-Usurped-Dropped- Re-entering the pool:
Retracted
- Block finalized:
FinalizedFinalityTimeout
- Re-entering the pool:
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.
- 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.
- Transaction
Droppedat one point, may later re-enter the pool if some other transactions are removed. Invalidtransaction may become valid at some point in the future. (Note that runtimes are encouraged to useUnknownValidityto inform the pool about such case).Retractedtransactions 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
Transaction is part of the future queue.
Transaction is part of the ready queue.
The transaction has been broadcast to the given peers.
Transaction has been included in block with given hash.
The block this transaction was included in has been retracted.
Maximum number of finality watchers has been reached, old watchers are being removed.
Transaction has been finalized by a finality-gadget, e.g GRANDPA
Transaction has been replaced in the pool, by another transaction that provides the same tags. (e.g. same (sender, nonce)).
Transaction has been dropped from the pool because of the limit.
Transaction is no longer valid in the current state.
Trait Implementations
impl<'de, Hash, BlockHash> Deserialize<'de> for TransactionStatus<Hash, BlockHash> where
Hash: Deserialize<'de>,
BlockHash: Deserialize<'de>,
impl<'de, Hash, BlockHash> Deserialize<'de> for TransactionStatus<Hash, BlockHash> where
Hash: Deserialize<'de>,
BlockHash: Deserialize<'de>, fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, Deserialize this value from the given Serde deserializer. Read more
impl<Hash: PartialEq, BlockHash: PartialEq> PartialEq<TransactionStatus<Hash, BlockHash>> for TransactionStatus<Hash, BlockHash>
impl<Hash: PartialEq, BlockHash: PartialEq> PartialEq<TransactionStatus<Hash, BlockHash>> for TransactionStatus<Hash, BlockHash>This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
impl<Hash, BlockHash> Serialize for TransactionStatus<Hash, BlockHash> where
Hash: Serialize,
BlockHash: Serialize,
impl<Hash, BlockHash> Serialize for TransactionStatus<Hash, BlockHash> where
Hash: Serialize,
BlockHash: Serialize, Auto Trait Implementations
impl<Hash, BlockHash> RefUnwindSafe for TransactionStatus<Hash, BlockHash> where
BlockHash: RefUnwindSafe,
Hash: RefUnwindSafe, impl<Hash, BlockHash> Send for TransactionStatus<Hash, BlockHash> where
BlockHash: Send,
Hash: Send, impl<Hash, BlockHash> Sync for TransactionStatus<Hash, BlockHash> where
BlockHash: Sync,
Hash: Sync, impl<Hash, BlockHash> Unpin for TransactionStatus<Hash, BlockHash> where
BlockHash: Unpin,
Hash: Unpin, impl<Hash, BlockHash> UnwindSafe for TransactionStatus<Hash, BlockHash> where
BlockHash: UnwindSafe,
Hash: UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any, 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
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>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
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)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
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = TShould always be Self
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
pub fn vzip(self) -> Vimpl<T> MaybeDebug for T where
T: Debug, impl<T> MaybeDebug for T where
T: Debug,