diff options
Diffstat (limited to 'zkvms/zkm/wrapper_macro/src/lib.rs')
| -rw-r--r-- | zkvms/zkm/wrapper_macro/src/lib.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/zkvms/zkm/wrapper_macro/src/lib.rs b/zkvms/zkm/wrapper_macro/src/lib.rs index 4bb580c..216d3d8 100644 --- a/zkvms/zkm/wrapper_macro/src/lib.rs +++ b/zkvms/zkm/wrapper_macro/src/lib.rs @@ -4,6 +4,29 @@ use proc_macro::TokenStream; mod parse_fn; use crate::parse_fn::{ split_fn, args_split, args_divide_public, args_divide_grouped, group_streams }; +/// Create a body, which reads all public and private inputs, stores them in +/// variables, then executes the guest entrypoint function with those arguments +/// and commits its output. +/// +/// `default_public_input.toml` shows which variables are public. +/// +/// # Usage +/// +/// Inside ZKM's guest (excluding the `entrypoint_expr` call): +/// +/// ```rust +/// make_wrapper!{fn main(...) -> ...} +/// ``` +/// +/// # Example output +/// +/// ```rust +/// { +/// let (...) : (...) = read(); // Public inputs +/// let (...) : (...) = read(); // Private inputs +/// commit::<...>(&zkp::main(..., ..., ...)); +/// } +/// ``` #[proc_macro] pub fn make_wrapper(item: TokenStream) -> TokenStream { let (name, args, ret) = split_fn(&item); |
