Skip to content

Commit

Permalink
Merge pull request #399 from CosmWasm/cw721-public-queries
Browse files Browse the repository at this point in the history
Make cw721-base queries public
  • Loading branch information
maurolacy authored Sep 2, 2021
2 parents ee7fd08 + 07f56df commit 7dded44
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions contracts/cw721-base/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,23 +388,23 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
}
}

fn query_minter(deps: Deps) -> StdResult<MinterResponse> {
pub fn query_minter(deps: Deps) -> StdResult<MinterResponse> {
let minter_addr = MINTER.load(deps.storage)?;
Ok(MinterResponse {
minter: minter_addr.to_string(),
})
}

fn query_contract_info(deps: Deps) -> StdResult<ContractInfoResponse> {
pub fn query_contract_info(deps: Deps) -> StdResult<ContractInfoResponse> {
CONTRACT_INFO.load(deps.storage)
}

fn query_num_tokens(deps: Deps) -> StdResult<NumTokensResponse> {
pub fn query_num_tokens(deps: Deps) -> StdResult<NumTokensResponse> {
let count = num_tokens(deps.storage)?;
Ok(NumTokensResponse { count })
}

fn query_nft_info(deps: Deps, token_id: String) -> StdResult<NftInfoResponse> {
pub fn query_nft_info(deps: Deps, token_id: String) -> StdResult<NftInfoResponse> {
let info = tokens().load(deps.storage, &token_id)?;
Ok(NftInfoResponse {
name: info.name,
Expand All @@ -413,7 +413,7 @@ fn query_nft_info(deps: Deps, token_id: String) -> StdResult<NftInfoResponse> {
})
}

fn query_owner_of(
pub fn query_owner_of(
deps: Deps,
env: Env,
token_id: String,
Expand All @@ -429,7 +429,7 @@ fn query_owner_of(
const DEFAULT_LIMIT: u32 = 10;
const MAX_LIMIT: u32 = 30;

fn query_all_approvals(
pub fn query_all_approvals(
deps: Deps,
env: Env,
owner: String,
Expand Down Expand Up @@ -459,7 +459,7 @@ fn parse_approval(item: StdResult<Pair<Expiration>>) -> StdResult<cw721::Approva
})
}

fn query_tokens(
pub fn query_tokens(
deps: Deps,
owner: String,
start_after: Option<String>,
Expand All @@ -482,7 +482,7 @@ fn query_tokens(
Ok(TokensResponse { tokens })
}

fn query_all_tokens(
pub fn query_all_tokens(
deps: Deps,
start_after: Option<String>,
limit: Option<u32>,
Expand All @@ -499,7 +499,7 @@ fn query_all_tokens(
Ok(TokensResponse { tokens: tokens? })
}

fn query_all_nft_info(
pub fn query_all_nft_info(
deps: Deps,
env: Env,
token_id: String,
Expand Down

0 comments on commit 7dded44

Please sign in to comment.