Derive Macro sov_modules_api::ModuleCallJsonSchema
source · #[derive(ModuleCallJsonSchema)]
Expand description
Derives the ModuleCallJsonSchema
trait for
the underlying type.
Example
use std::marker::PhantomData;
use sov_modules_api::{Context, Module, ModuleInfo, ModuleCallJsonSchema};
use sov_modules_api::default_context::ZkDefaultContext;
use sov_state::StateMap;
use sov_bank::CallMessage;
#[derive(ModuleInfo, ModuleCallJsonSchema)]
struct TestModule<C: Context> {
#[address]
admin: C::Address,
#[state]
pub state_map: StateMap<String, u32>,
}
impl<C: Context> Module for TestModule<C> {
type Context = C;
type Config = PhantomData<C>;
type CallMessage = CallMessage<C>;
}
println!("JSON Schema: {}", TestModule::<ZkDefaultContext>::json_schema());