[−][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, ) -> InitResult { } pub fn handle( deps: DepsMut, env: Env, info: MessageInfo, msg: HandleMsg, ) -> HandleResult { } pub fn query( deps: Deps, env: Env, msg: QueryMsg, ) -> QueryResult { }
Where InitMsg
, HandleMsg
, and QueryMsg
are types that implement DeserializeOwned + JsonSchema
Example
ⓘThis example is not tested
use contract; // The contract module cosmwasm_std::create_entry_points!(contract);