Skip to content

Commit

Permalink
resolve remaining warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
avahowell committed Aug 31, 2023
1 parent 29cb343 commit 34ffb5c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions crates/core/component/ibc/src/component/grpc_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl ConnectionQuery for IbcQuery {
) -> std::result::Result<tonic::Response<QueryConnectionResponse>, tonic::Status> {
let snapshot = self.0.latest_snapshot();
let connection_id = &ConnectionId::from_str(&request.get_ref().connection_id)
.map_err(|e| tonic::Status::aborted("invalid connection id"))?;
.map_err(|e| tonic::Status::aborted(format!("invalid connection id: {e}")))?;

let (conn, proof) = snapshot
.get_with_proof_to_apphash(
Expand All @@ -82,7 +82,8 @@ impl ConnectionQuery for IbcQuery {
})
.map_err(|e| tonic::Status::aborted(format!("couldn't get connection: {e}")))?;

let conn = conn.map_err(|e| tonic::Status::aborted("couldn't decode connection: {e}"))?;
let conn =
conn.map_err(|e| tonic::Status::aborted(format!("couldn't decode connection: {e}")))?;

let height = Height {
revision_number: 0,
Expand All @@ -100,7 +101,7 @@ impl ConnectionQuery for IbcQuery {
/// Connections queries all the IBC connections of a chain.
async fn connections(
&self,
request: tonic::Request<QueryConnectionsRequest>,
_request: tonic::Request<QueryConnectionsRequest>,
) -> std::result::Result<tonic::Response<QueryConnectionsResponse>, tonic::Status> {
let snapshot = self.0.latest_snapshot();
let height = snapshot.version();
Expand Down Expand Up @@ -265,7 +266,7 @@ impl ConsensusQuery for IbcQuery {
let res = QueryConnectionChannelsResponse {
channels,
pagination: None,
height: None,
height: Some(height),
};

Ok(tonic::Response::new(res))
Expand Down Expand Up @@ -380,7 +381,10 @@ impl ConsensusQuery for IbcQuery {
) -> std::result::Result<tonic::Response<QueryPacketAcknowledgementsResponse>, tonic::Status>
{
let snapshot = self.0.latest_snapshot();
let height = snapshot.version();
let height = Height {
revision_number: 0,
revision_height: snapshot.version().into(),
};
let request = request.get_ref();

let chan_id: ChannelId = ChannelId::from_str(&request.channel_id)
Expand Down Expand Up @@ -425,7 +429,7 @@ impl ConsensusQuery for IbcQuery {
let res = QueryPacketAcknowledgementsResponse {
acknowledgements: acks,
pagination: None,
height: None,
height: Some(height),
};

Ok(tonic::Response::new(res))
Expand Down Expand Up @@ -547,13 +551,9 @@ impl ClientQuery for IbcQuery {
/// ClientStates queries all the IBC light clients of a chain.
async fn client_states(
&self,
request: tonic::Request<QueryClientStatesRequest>,
_request: tonic::Request<QueryClientStatesRequest>,
) -> std::result::Result<tonic::Response<QueryClientStatesResponse>, tonic::Status> {
let snapshot = self.0.latest_snapshot();
let height = Height {
revision_number: 0,
revision_height: snapshot.version().into(),
};

let client_counter = snapshot
.client_counter()
Expand Down

0 comments on commit 34ffb5c

Please sign in to comment.