registry_distro_test/
lib.rs

1pub const TRUST_GRAPH_WASM: &'static [u8] = include_bytes!("../registry-service/registry.wasm");
2pub const SQLITE_WASM: &'static [u8] = include_bytes!("../registry-service/sqlite3.wasm");
3pub const CONFIG: &'static [u8] = include_bytes!("../registry-service/Config.toml");
4pub const CLEAR_EXPIRED_AIR: &'static str =
5    include_str!("../registry-service/air/registry-scheduled-scripts.clearExpired_86400.air");
6pub const CLEAR_EXPIRED_PERIOD_SEC: u32 = 86400;
7
8pub const RENEW_AIR: &'static str =
9    include_str!("../registry-service/air/registry-scheduled-scripts.renew_43200.air");
10pub const RENEW_PERIOD_SEC: u32 = 43200;
11
12pub const REPLICATE_AIR: &'static str =
13    include_str!("../registry-service/air/registry-scheduled-scripts.replicate_3600.air");
14pub const REPLICATE_PERIOD_SEC: u32 = 3600;
15
16pub mod build_info {
17    include!(concat!(env!("OUT_DIR"), "/built.rs"));
18}
19
20pub use build_info::PKG_VERSION as VERSION;
21
22pub fn modules() -> std::collections::HashMap<&'static str, &'static [u8]> {
23    maplit::hashmap! {
24        "sqlite3" => SQLITE_WASM,
25        "registry" => TRUST_GRAPH_WASM,
26    }
27}
28
29pub struct Script {
30    pub air: &'static str,
31    pub period_sec: u32,
32}
33
34pub fn scripts() -> Vec<Script> {
35    vec![
36        Script {
37            air: CLEAR_EXPIRED_AIR,
38            period_sec: CLEAR_EXPIRED_PERIOD_SEC,
39        },
40        Script {
41            air: RENEW_AIR,
42            period_sec: RENEW_PERIOD_SEC,
43        },
44        Script {
45            air: REPLICATE_AIR,
46            period_sec: REPLICATE_PERIOD_SEC,
47        },
48    ]
49}