lighthouse/beacon_chain/attestation_validation/src/macros.rs
2018-12-06 18:16:03 +11:00

20 lines
306 B
Rust

macro_rules! verify_or {
($condition: expr, $result: expr) => {
if !$condition {
$result
}
};
}
macro_rules! reject {
($result: expr) => {
return Ok(Outcome::Invalid($result));
};
}
macro_rules! accept {
() => {
Ok(Outcome::Valid)
};
}