Skip to content

Commit

Permalink
chore: Add deprecation mark
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikthebird committed Sep 10, 2024
1 parent 3b15bfb commit 891866f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/std/src/query/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub enum BankQuery {
/// This calls into the native bank module for all denominations.
/// Note that this may be much more expensive than Balance and should be avoided if possible.
/// Return value is AllBalanceResponse.
#[deprecated]
AllBalances { address: String },
/// This calls into the native bank module for querying metadata for a specific bank token.
/// Return value is DenomMetadataResponse
Expand Down
1 change: 1 addition & 0 deletions packages/std/src/query/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum IbcQuery {
/// If `port_id` is omitted, this list all channels bound to the contract's port.
///
/// Returns a `ListChannelsResponse`.
#[deprecated = "Returns a potentially unbound number of results. Research showed that no user needs this query."]
ListChannels { port_id: Option<String> },
/// Lists all information for a (portID, channelID) pair.
/// If port_id is omitted, it will default to the contract's own channel.
Expand Down
2 changes: 2 additions & 0 deletions packages/std/src/testing/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ impl BankQuerier {
};
to_json_binary(&bank_res).into()
}
#[allow(deprecated)]
BankQuery::AllBalances { address } => {
// proper error on not found, serialize result on found
let bank_res = AllBalanceResponse {
Expand Down Expand Up @@ -936,6 +937,7 @@ impl IbcQuerier {
let res = ChannelResponse { channel };
to_json_binary(&res).into()
}
#[allow(deprecated)]
IbcQuery::ListChannels { port_id } => {
let channels = self
.channels
Expand Down
2 changes: 2 additions & 0 deletions packages/std/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ impl<'a, C: CustomQuery> QuerierWrapper<'a, C> {
Ok(res.amount)
}

#[deprecated]
pub fn query_all_balances(&self, address: impl Into<String>) -> StdResult<Vec<Coin>> {
#[allow(deprecated)]
let request = BankQuery::AllBalances {
address: address.into(),
}
Expand Down

0 comments on commit 891866f

Please sign in to comment.