1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/// Indicates whether the mempool query result should include transactions/orphans or both
pub enum TransactionQuery {
    /// Include only non-orphan transactions from the ordinary mempool tx pool
    TransactionsOnly,
    /// Include orphan transactions only
    OrphansOnly,
    /// Include both orphan and non-orphan transactions
    All,
}

impl TransactionQuery {
    pub fn include_transaction_pool(&self) -> bool {
        matches!(self, TransactionQuery::TransactionsOnly | TransactionQuery::All)
    }

    pub fn include_orphan_pool(&self) -> bool {
        matches!(self, TransactionQuery::OrphansOnly | TransactionQuery::All)
    }
}