Skip to content

Commit

Permalink
fix last query bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberHoward committed May 30, 2024
1 parent 9a0f7e4 commit 66bc36d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions contracts/interchain-gov/src/handlers/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ fn request_vote_results(
host.to_string(),
WasmQuery::Smart {
contract_addr: module_addr,
msg: to_json_binary(&InterchainGovQueryMsg::Vote {
msg: to_json_binary(&crate::msg::QueryMsg::Module(InterchainGovQueryMsg::Vote {
prop_id: prop_id.clone(),
})?,
}))?,
},
CallbackInfo::new(REGISTER_VOTE_ID, None),
)?;
Expand Down
6 changes: 3 additions & 3 deletions contracts/interchain-gov/src/ibc_callbacks/vote_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use abstract_adapter::std::ibc::{CallbackResult, IbcResponseMsg};
use cosmwasm_std::{from_json, to_json_string, DepsMut, Env, MessageInfo, QueryRequest, WasmQuery};

use crate::contract::{AdapterResult, InterchainGov};
use crate::msg::{InterchainGovQueryMsg, VoteResponse};
use crate::msg::{InterchainGovQueryMsg, QueryMsg, VoteResponse};
use crate::state::{GovernanceVote, VOTE_RESULTS};
use crate::InterchainGovError;

Expand All @@ -30,9 +30,9 @@ pub fn vote_result_callback(
let prop_id = match query {
QueryRequest::Wasm(wasm) => match wasm {
WasmQuery::Smart { contract_addr, msg } => {
let msg: InterchainGovQueryMsg = from_json(msg)?;
let msg: QueryMsg = from_json(msg)?;
match msg {
InterchainGovQueryMsg::Vote { prop_id } => prop_id,
QueryMsg::Module(InterchainGovQueryMsg::Vote { prop_id }) => prop_id,
_ => unimplemented!("InterchainGovQueryMsg"),
}
}
Expand Down
6 changes: 1 addition & 5 deletions contracts/interchain-gov/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,10 @@ mod members {
let res = interchain.wait_ibc(A_CHAIN_ID, res)?;
dbg!(&res.packets[0].outcome);

// a_gov.execute_proposal(prop_id.clone())?;
a_gov.execute_proposal(prop_id.clone())?;

let a_members = dbg!(a_gov.members()?);
assert_eq!(a_members.members.members.len(), 3);
// let b_members = dbg!(b_gov.members()?);
// assert_eq!(b_members.members.members.len(), 3);
// let c_members = dbg!(c_gov.members()?);
// assert_eq!(c_members.members.members.len(), 3);
Ok(())
}
}
Expand Down

0 comments on commit 66bc36d

Please sign in to comment.