[−][src]Macro cosmwasm_std::create_entry_points
This macro generates the boilerplate required to call into the contract-specific logic from the entry-points to the Wasm module.
It should be invoked in a module scope(that is, not inside a function), and the argument to the macro should be the name of a second rust module that is imported in the invocation scope. The second module should export three functions with the following signatures:
pub fn init( deps: DepsMut, env: Env, info: MessageInfo, msg: InitMsg, ) -> Result<InitResponse, StdError> { } pub fn handle( deps: DepsMut, env: Env, info: MessageInfo, msg: HandleMsg, ) -> Result<HandleResponse, StdError> { } pub fn query( deps: Deps, env: Env, msg: QueryMsg, ) -> Result<QueryResponse, StdError> { }
where InitMsg
, HandleMsg
, and QueryMsg
are types that implement DeserializeOwned + JsonSchema
.
Example
ⓘ
use contract; // The contract module cosmwasm_std::create_entry_points!(contract);