Skip to content

Commit

Permalink
remove unnecessary trim from mock_querier
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Oct 28, 2024
1 parent bc49eae commit 94567bb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,19 @@ impl WasmMockQuerier {
pub fn handle_query(&self, request: &QueryRequest) -> QuerierResult {
match &request {
QueryRequest::Grpc(GrpcQuery { path, data }) => {
let quoted_path = path.trim_matches('"').to_string();
if &quoted_path == "/neutron.interchainqueries.Query/QueryResult" {
if 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" {
} else if 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 {
println!("PATH: {}", quoted_path);
self.base.handle_query(request)
}
}
Expand Down
14 changes: 7 additions & 7 deletions contracts/neutron_interchain_txs/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
use cosmos_sdk_proto::traits::Message;
use cosmwasm_std::{
to_json_binary, Addr, Binary, CosmosMsg, CustomQuery, Deps, DepsMut, Env, MessageInfo, Reply,
Response, StdError, StdResult, SubMsg,
};
use cw2::set_contract_version;
use neutron_std::shim::Timestamp;
use crate::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};
use crate::storage::{
add_error_to_queue, read_errors_from_queue, read_reply_payload, read_sudo_payload,
save_reply_payload, save_sudo_payload, AcknowledgementResult, SudoPayload,
ACKNOWLEDGEMENT_RESULTS, INTERCHAIN_ACCOUNTS, SUDO_PAYLOAD_REPLY_ID,
};
use cosmos_sdk_proto::traits::Message;
use cosmwasm_std::{
to_json_binary, Addr, Binary, CosmosMsg, CustomQuery, Deps, DepsMut, Env, MessageInfo, Reply,
Response, StdError, StdResult, SubMsg,
};
use cw2::set_contract_version;
use neutron_sdk::interchain_txs::helpers::register_interchain_account;
use neutron_sdk::{
interchain_txs::helpers::{decode_message_response, get_port_id},
interchain_txs::v047::helpers::decode_acknowledgement_response,
sudo::msg::{RequestPacket, SudoMsg},
NeutronError, NeutronResult,
};
use neutron_std::shim::Timestamp;
use neutron_std::types::cosmos::base::v1beta1::Coin as SDKCoin;
use neutron_std::types::cosmos::base::v1beta1::Coin;
use neutron_std::types::cosmos::staking::v1beta1::{
Expand Down
1 change: 0 additions & 1 deletion packages/neutron-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// #![forbid(unsafe_code)]
#![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)]


pub mod bindings;
mod errors;
pub mod interchain_queries;
Expand Down

0 comments on commit 94567bb

Please sign in to comment.