cw_boolean_contract/entry_points/query.rs
1pub mod get_value;
2
3use crate::msgs::query_msg::QueryMsg;
4use cosmwasm_std::entry_point;
5use cosmwasm_std::{to_binary, Binary, Deps, Env, StdResult};
6
7/// Query entry point
8/// See a list of query variants in the [QueryMsg](QueryMsg) enum
9#[cfg_attr(not(feature = "library"), entry_point)]
10pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
11 // inside this match, we list all the queries we have in this contract
12 // we only have one, GetValue, which is turned into snake case,
13 // so contracts and end users will call "get_value"
14 let res = match msg {
15 QueryMsg::GetValue {} => get_value::query(deps, env)?,
16 };
17
18 to_binary(&res)
19}