Skip to content

Commit

Permalink
cleanup path trims and TODO message
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Oct 28, 2024
1 parent 215d9af commit 8851b44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/dex_grpc/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub fn execute(
order_type,
expiration_time,
max_amount_out,
min_average_sell_price: "".to_string(), // TODO
min_average_sell_price: "".to_string(),
})),
ExecuteMsg::WithdrawFilledLimitOrder { tranche_key } => {
Ok(Response::new().add_message(MsgWithdrawFilledLimitOrder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,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
5 changes: 3 additions & 2 deletions contracts/neutron_interchain_queries/src/testing/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ use cosmwasm_std::testing::{message_info, mock_env, MockApi, MockStorage};
use cosmwasm_std::{
from_json, Addr, Binary, Coin, Decimal, Env, MessageInfo, OwnedDeps, StdError, Uint128,
};
use neutron_sdk::interchain_queries::helpers::{decode_and_convert, kv_key_from_string};
use neutron_sdk::interchain_queries::hex::decode_hex;
use neutron_sdk::interchain_queries::helpers::{
decode_and_convert, decode_hex, kv_key_from_string,
};
use neutron_sdk::interchain_queries::types::{
QueryType, TransactionFilterItem, TransactionFilterOp, TransactionFilterValue,
};
Expand Down

0 comments on commit 8851b44

Please sign in to comment.