pub mod access;
pub mod auth;
pub mod components;
pub mod faucets;
pub mod inspection;
pub mod interface;
pub mod policies;
pub mod wallets;
pub use inspection::AccountBuilderSchemaCommitmentExt;
#[macro_export]
macro_rules! procedure_root {
($name:ident, $component_name:expr, $proc_name:expr, $component_code:expr) => {
static $name: miden_protocol::utils::sync::LazyLock<
miden_protocol::account::AccountProcedureRoot,
> = miden_protocol::utils::sync::LazyLock::new(|| {
let full_path = ::alloc::format!("{}::{}", $component_name, $proc_name);
let code: &miden_protocol::account::AccountComponentCode = $component_code;
code.get_procedure_root_by_path(full_path.as_str())
.unwrap_or_else(|| panic!("component should contain procedure '{}'", full_path))
});
};
}
macro_rules! account_component_code {
($name:ident, $relative_path:expr) => {
static $name: miden_protocol::utils::sync::LazyLock<
miden_protocol::account::component::AccountComponentCode,
> = miden_protocol::utils::sync::LazyLock::new(|| {
let bytes =
include_bytes!(concat!(env!("OUT_DIR"), "/assets/components/", $relative_path));
let package = miden_protocol::vm::Package::read_from_bytes_trusted(bytes)
.expect("shipped account-component package failed to deserialize");
miden_protocol::account::component::AccountComponentCode::from(package)
});
};
}
pub(crate) use account_component_code;