Add future transactions pool accessor to ValidatedPool (#8673)

This commit is contained in:
tgmichel authored and GitHub committed 2021-05-01 06:02:47 +00:00
1 parent 46095af452
commit db4acd4866
1 file changed
+7
@@ -610,6 +610,13 @@ impl<B: ChainApi> ValidatedPool<B> {
self.pool.read().ready()
}
/// Returns a Vec of hashes and extrinsics in the future pool.
pub fn futures(&self) -> Vec<(ExtrinsicHash<B>, ExtrinsicFor<B>)> {
self.pool.read().futures()
.map(|tx| (tx.hash.clone(), tx.data.clone()))
.collect()
}
/// Returns pool status.
pub fn status(&self) -> PoolStatus {
self.pool.read().status()