1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use cfx_vm_types::Spec;

pub trait IsActive {
    fn is_active(&self, spec: &Spec) -> bool;
}

#[macro_export]
macro_rules! group_impl_is_active {
    ("genesis" $(, $name:ident)* $(,)?) => {
        group_impl_is_active!(|_| true $(, $name)*);
    };
    ($is_active:expr $(, $name:ident)* $(,)?) => {
        $(impl IsActive for $name {
            fn is_active(&self, spec: &Spec) -> bool { $is_active(spec) }
        })*
    };
}