hotshot_testing/predicates/
mod.rs1pub mod event;
8pub mod upgrade_with_proposal;
9pub mod upgrade_with_vote;
10
11use async_trait::async_trait;
12
13#[derive(Eq, PartialEq, Copy, Clone, Debug)]
14pub enum PredicateResult {
15 Pass,
16
17 Fail,
18
19 Incomplete,
20}
21
22impl From<bool> for PredicateResult {
23 fn from(boolean: bool) -> Self {
24 match boolean {
25 true => PredicateResult::Pass,
26 false => PredicateResult::Fail,
27 }
28 }
29}
30
31#[async_trait]
32pub trait Predicate<INPUT>: std::fmt::Debug {
33 async fn evaluate(&self, input: &INPUT) -> PredicateResult;
34 async fn info(&self) -> String;
35}