tackler_core/filter/
nullary_true.rs

1/*
2 * Tackler-NG 2023
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6use crate::model::Transaction;
7use tackler_api::filters::NullaryTRUE;
8
9use crate::kernel::Predicate;
10
11impl Predicate<Transaction> for NullaryTRUE {
12    fn eval(&self, _txn: &Transaction) -> bool {
13        true
14    }
15}
16
17#[cfg(test)]
18mod tests {
19    use super::*;
20    use tackler_api::filters::TxnFilter;
21
22    #[test]
23    fn to_be_or_not_to_be() {
24        let txn = Transaction::default();
25
26        let tf = TxnFilter::NullaryTRUE(NullaryTRUE {});
27
28        assert!(tf.eval(&txn));
29    }
30}