Skip to content

Commit 677b096

Browse files
committed
Feature-gate grpc query
1 parent e1aa326 commit 677b096

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

docs/CAPABILITIES-BUILT-IN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ might define others.
2323
`DistributionQuery::DelegationTotalRewards` and
2424
`DistributionQuery::DelegatorValidators` queries. Only chains running CosmWasm
2525
`1.4.0` or higher support this.
26-
- `cosmwasm_2_0` enables `CosmosMsg::Any`. Only chains running CosmWasm `2.0.0`
27-
or higher support this.
26+
- `cosmwasm_2_0` enables `CosmosMsg::Any` and `QueryRequest::Grpc`. Only chains
27+
running CosmWasm `2.0.0` or higher support this.

packages/std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ cosmwasm_1_3 = ["cosmwasm_1_2"]
4747
# It requires the host blockchain to run CosmWasm `1.4.0` or higher.
4848
cosmwasm_1_4 = ["cosmwasm_1_3"]
4949
# This enables functionality that is only available on 2.0 chains.
50-
# It adds `CosmosMsg::Any`, replacing `CosmosMsg::Stargate`.
50+
# It adds `CosmosMsg::Any`, replacing `CosmosMsg::Stargate`. It also adds `QueryRequest::Grpc`.
5151
cosmwasm_2_0 = ["cosmwasm_1_4"]
5252

5353
[dependencies]

packages/std/src/query/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub enum QueryRequest<C> {
6666
#[cfg(feature = "stargate")]
6767
Ibc(IbcQuery),
6868
Wasm(WasmQuery),
69+
#[cfg(feature = "cosmwasm_2_0")]
6970
Grpc(GrpcQuery),
7071
}
7172

@@ -139,6 +140,7 @@ impl<C: CustomQuery> From<WasmQuery> for QueryRequest<C> {
139140
}
140141
}
141142

143+
#[cfg(feature = "cosmwasm_2_0")]
142144
impl<C: CustomQuery> From<GrpcQuery> for QueryRequest<C> {
143145
fn from(msg: GrpcQuery) -> Self {
144146
QueryRequest::Grpc(msg)

packages/std/src/testing/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ impl<C: CustomQuery + DeserializeOwned> MockQuerier<C> {
606606
QueryRequest::Stargate { .. } => SystemResult::Err(SystemError::UnsupportedRequest {
607607
kind: "Stargate".to_string(),
608608
}),
609+
#[cfg(feature = "cosmwasm_2_0")]
609610
QueryRequest::Grpc(_) => SystemResult::Err(SystemError::UnsupportedRequest {
610611
kind: "GRPC".to_string(),
611612
}),

0 commit comments

Comments
 (0)