diff --git a/lighthouse/main.rs b/lighthouse/main.rs index 0a9f35288..7f5e4f7ea 100644 --- a/lighthouse/main.rs +++ b/lighthouse/main.rs @@ -6,11 +6,12 @@ extern crate clap; extern crate network_libp2p; extern crate futures; +#[macro_use] +pub mod utils; pub mod db; pub mod client; pub mod state; pub mod sync; -pub mod utils; pub mod config; use std::path::PathBuf; diff --git a/lighthouse/utils/macros.rs b/lighthouse/utils/macros.rs new file mode 100644 index 000000000..e6e3be01e --- /dev/null +++ b/lighthouse/utils/macros.rs @@ -0,0 +1,10 @@ +#[macro_export] +macro_rules! assert_error { + ($exp: expr, $err: expr) => { + if ( !$exp ) { + return Err($err); + } + } +} + + diff --git a/lighthouse/utils/mod.rs b/lighthouse/utils/mod.rs index 4cb6ddf38..4d2ae3942 100644 --- a/lighthouse/utils/mod.rs +++ b/lighthouse/utils/mod.rs @@ -3,8 +3,12 @@ extern crate blake2; extern crate crypto_mac; extern crate boolean_bitfield; +#[macro_use] +pub mod macros; pub mod types; pub mod bls; pub mod test_helpers; pub mod logging; pub mod errors; + +