1pub mod abi;
2mod access;
3mod agg;
4mod beacon;
5mod datapoint;
6#[cfg(feature = "dummy")]
7pub mod dummy;
8mod error;
9pub mod util;
10mod whitelist;
11
12pub use access::*;
13pub use agg::Aggregator;
14pub use beacon::*;
15pub use datapoint::DataPoint;
16pub use error::Error;
17pub use util::*;
18pub use whitelist::*;
19
20pub type Bytes = Vec<u8>;
21pub type Bytes32 = [u8; 32];
22pub const BYTES32_ZERO: Bytes32 = [0u8; 32];
23
24#[macro_export]
25macro_rules! ensure {
26 ( $x:expr, $y:expr ) => {{
27 if !$x {
28 Err($y)
29 } else {
30 Ok(())
31 }
32 }};
33}
34
35pub trait Zero {
37 fn is_zero(&self) -> bool;
38}
39
40impl Zero for Bytes32 {
41 fn is_zero(&self) -> bool {
42 (*self) == BYTES32_ZERO
43 }
44}