Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed May 3, 2024
1 parent 13dc836 commit 05450e9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions ibc-clients/ics07-tendermint/cw-contract/src/entrypoint.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use cosmwasm_std::{
entry_point, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult,
};
use cosmwasm_std::{entry_point, Binary, Deps, DepsMut, Env, MessageInfo, Response};
use ibc_client_cw::context::Context;
use ibc_client_cw::types::{ContractError, InstantiateMsg, QueryMsg, SudoMsg};

Expand All @@ -16,25 +14,19 @@ pub fn instantiate(
msg: InstantiateMsg,
) -> Result<Response, ContractError> {
let mut ctx = TendermintContext::new_mut(deps, env)?;

let data = ctx.instantiate(msg)?;

Ok(Response::default().set_data(data))
}

#[entry_point]
pub fn sudo(deps: DepsMut<'_>, env: Env, msg: SudoMsg) -> Result<Response, ContractError> {
let mut ctx = TendermintContext::new_mut(deps, env)?;

let data = ctx.sudo(msg)?;

Ok(Response::default().set_data(data))
}

#[entry_point]
pub fn query(deps: Deps<'_>, env: Env, msg: QueryMsg) -> StdResult<Binary> {
pub fn query(deps: Deps<'_>, env: Env, msg: QueryMsg) -> Result<Binary, ContractError> {

Check warning on line 29 in ibc-clients/ics07-tendermint/cw-contract/src/entrypoint.rs

View check run for this annotation

Codecov / codecov/patch

ibc-clients/ics07-tendermint/cw-contract/src/entrypoint.rs#L29

Added line #L29 was not covered by tests
let ctx = TendermintContext::new_ref(deps, env)?;

ctx.query(msg)
.map_err(|e| StdError::generic_err(e.to_string()))
}

0 comments on commit 05450e9

Please sign in to comment.