Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Oct 16, 2024
1 parent c01fb30 commit d57d8e4
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions contracts/neutron_interchain_queries/src/testing/mock_querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ use std::marker::PhantomData;

use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage};
use cosmwasm_std::{
from_json, Binary, Coin, ContractResult, CustomQuery, FullDelegation, GrpcQuery, OwnedDeps,
Querier, QuerierResult, QueryRequest, SystemError, SystemResult, Uint128, Validator,
from_json, Binary, Coin, ContractResult, CustomQuery, GrpcQuery, OwnedDeps, Querier,
QuerierResult, QueryRequest, SystemError, SystemResult, Uint128,
};
use neutron_std::types::neutron::interchainqueries::{
QueryRegisteredQueriesRequest, QueryRegisteredQueryRequest, QueryRegisteredQueryResultRequest,
QueryRegisteredQueryResultResponse, QueryResult,
QueryRegisteredQueryRequest, QueryRegisteredQueryResultRequest,
};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -77,26 +76,21 @@ impl WasmMockQuerier {
match &request {
QueryRequest::Grpc(GrpcQuery { path, data }) => {
let quoted_path = path.trim_matches('"').to_string();
if quoted_path == "/neutron.interchainqueries.Query/QueryResult".to_string() {
if &quoted_path == "/neutron.interchainqueries.Query/QueryResult" {
let request: QueryRegisteredQueryResultRequest =
::prost::Message::decode(&data[..]).unwrap();
SystemResult::Ok(ContractResult::Ok(
(*self.query_responses.get(&request.query_id).unwrap()).clone(),
))
} else if quoted_path
== "/neutron.interchainqueries.Query/RegisteredQuery".to_string()
{
} else if &quoted_path == "/neutron.interchainqueries.Query/RegisteredQuery" {
let request: QueryRegisteredQueryRequest =
::prost::Message::decode(&data[..]).unwrap();
SystemResult::Ok(ContractResult::Ok(
(*self.registered_queries.get(&request.query_id).unwrap()).clone(),
))
} else if quoted_path == QueryRegisteredQueriesRequest::TYPE_URL.to_string() {
todo!()
} else {
println!("PATH: {}", quoted_path);
println!("SHOULD BE: {}", QueryRegisteredQueryRequest::TYPE_URL);
self.base.handle_query(&request)
self.base.handle_query(request)
}
}
_ => self.base.handle_query(request),
Expand Down

0 comments on commit d57d8e4

Please sign in to comment.