Skip to content

Commit

Permalink
Add execute template
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed May 3, 2024
1 parent b7e0fc2 commit 0851355
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs-test-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
22 changes: 22 additions & 0 deletions docs-test-gen/templates/execute.tpl
Original file line number Diff line number Diff line change
@@ -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<Response> {
{{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();
}

0 comments on commit 0851355

Please sign in to comment.