Skip to content

Commit

Permalink
Add query handlers to wormhole-ibc contract
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-suri committed Apr 13, 2023
1 parent b4c1606 commit 9723755
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cosmwasm/contracts/wormhole-ibc/src/contract.rs
Expand Up @@ -4,9 +4,9 @@ use cosmwasm_std::entry_point;
use crate::ibc::PACKET_LIFETIME;
use anyhow::Context;
use cosmwasm_std::{
to_binary, DepsMut, Env, IbcMsg, IbcQuery, ListChannelsResponse, MessageInfo, Response,
to_binary, DepsMut, Env, IbcMsg, IbcQuery, ListChannelsResponse, MessageInfo, Response, Deps, StdResult, Binary,
};
use wormhole::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg};
use wormhole::msg::{ExecuteMsg, QueryMsg, InstantiateMsg, MigrateMsg};

use crate::msg::WormholeIbcPacketMsg;

Expand Down Expand Up @@ -102,5 +102,11 @@ fn post_message_ibc(
.add_message(ibc_msg))
}

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
// defer to the core contract logic for all query handling
wormhole::contract::query(deps, env, msg)
}

#[cfg(test)]
mod tests;

0 comments on commit 9723755

Please sign in to comment.