1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
mod gen;
pub use gen::*;

mod pretty;
pub use pretty::*;

mod token_stream;
pub use token_stream::*;

mod error;
pub use error::*;

pub type BindingBuilder = ethbind_gen::BindingBuilder<
    ethbind_gen::Executor<RustGenerator, ethbind_gen::JsonRuntimeBinder>,
>;

pub use ethbind_gen::*;
pub use ethbind_json::*;

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_gen() {
        _ = pretty_env_logger::try_init();

        let runtime_binder: JsonRuntimeBinder = include_str!("../macros/tests/mapping.json")
            .parse()
            .expect("Parse mapping");

        let mut contracts = BindingBuilder::new((RustGenerator::default(), runtime_binder))
            .bind_hardhat(include_str!("../macros/tests/abi.json"))
            .finalize()
            .expect("Generate data");

        contracts.pretty().expect("Pretty");
    }
}