@@ -67,16 +67,22 @@ impl PoolStatus {
67
67
/// 2. Inside `Ready` queue:
68
68
/// - `Broadcast`
69
69
/// 3. Leaving the pool:
70
- /// - `Finalized `
70
+ /// - `InBlock `
71
71
/// - `Invalid`
72
72
/// - `Usurped`
73
73
/// - `Dropped`
74
+ /// 4. Re-entering the pool:
75
+ /// - `Retracted`
76
+ /// 5. Block finalized:
77
+ /// - `Finalized`
78
+ /// - `FinalityTimeout`
74
79
///
75
80
/// The events will always be received in the order described above, however
76
81
/// there might be cases where transactions alternate between `Future` and `Ready`
77
82
/// pool, and are `Broadcast` in the meantime.
78
83
///
79
84
/// There is also only single event causing the transaction to leave the pool.
85
+ /// I.e. only one of the listed ones should be triggered.
80
86
///
81
87
/// Note that there are conditions that may cause transactions to reappear in the pool.
82
88
/// 1. Due to possible forks, the transaction that ends up being in included
@@ -86,8 +92,15 @@ impl PoolStatus {
86
92
/// 3. `Invalid` transaction may become valid at some point in the future.
87
93
/// (Note that runtimes are encouraged to use `UnknownValidity` to inform the pool about
88
94
/// such case).
95
+ /// 4. `Retracted` transactions might be included in some next block.
89
96
///
90
- /// However the user needs to re-subscribe to receive such notifications.
97
+ /// The stream is considered finished only when either `Finalized` or `FinalityTimeout`
98
+ /// event is triggered. You are however free to unsubscribe from notifications at any point.
99
+ /// The first one will be emitted when the block, in which transaction was included gets
100
+ /// finalized. The `FinalityTimeout` event will be emitted when the block did not reach finality
101
+ /// within 512 blocks. This either indicates that finality is not available for your chain,
102
+ /// or that finality gadget is lagging behind. If you choose to wait for finality longer, you can
103
+ /// re-subscribe for a particular transaction hash manually again.
91
104
#[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
92
105
#[ serde( rename_all = "camelCase" ) ]
93
106
pub enum TransactionStatus < Hash , BlockHash > {
@@ -98,7 +111,6 @@ pub enum TransactionStatus<Hash, BlockHash> {
98
111
/// The transaction has been broadcast to the given peers.
99
112
Broadcast ( Vec < String > ) ,
100
113
/// Transaction has been included in block with given hash.
101
- #[ serde( rename = "finalized" ) ] // See #4438
102
114
InBlock ( BlockHash ) ,
103
115
/// The block this transaction was included in has been retracted.
104
116
Retracted ( BlockHash ) ,
0 commit comments