Macro cosmwasm_std::create_entry_points [−][src]
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 instantiate( deps: DepsMut, env: Env, info: MessageInfo, msg: InstantiateMsg, ) -> Result<Response, StdError> { } pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result<Response, StdError> { } pub fn query( deps: Deps, env: Env, msg: QueryMsg, ) -> Result<QueryResponse, StdError> { }
where InstantiateMsg
, ExecuteMsg
, and QueryMsg
are types that implement DeserializeOwned + JsonSchema
.
Example
ⓘ
use contract; // The contract module cosmwasm_std::create_entry_points!(contract);