diff --git a/docs-test-gen/src/main.rs b/docs-test-gen/src/main.rs index df62bc82..8f99a2c6 100644 --- a/docs-test-gen/src/main.rs +++ b/docs-test-gen/src/main.rs @@ -7,6 +7,7 @@ use strum::{EnumIter, IntoEnumIterator}; static TEMPLATES: phf::Map<&'static str, &'static str> = phf_map! { "core" => include_str!("../templates/core.tpl"), + "execute" => include_str!("../templates/execute.tpl"), }; fn is_goey(fence: &str) -> bool { diff --git a/docs-test-gen/templates/execute.tpl b/docs-test-gen/templates/execute.tpl new file mode 100644 index 00000000..b6059bd0 --- /dev/null +++ b/docs-test-gen/templates/execute.tpl @@ -0,0 +1,22 @@ +use cosmwasm_std::*; +use cosmwasm_schema::cw_serde; + +#[cw_serde] +struct ExecuteMsg {} + +#[entry_point] +pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> StdResult { + {{code}} +} + +#[test] +fn doctest() { + use cosmwasm_std::testing::*; + + let mut deps = mock_dependencies(); + let env = mock_env(); + let info = mock_info("sender", &[]); + let msg = ExecuteMsg {}; + + let res = execute(deps.as_mut(), env, info, msg).unwrap(); +}