Skip to content

Commit

Permalink
fix: moved code to correct directory
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Jun 15, 2023
1 parent 34ef1c2 commit 855302e
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 52 deletions.
52 changes: 52 additions & 0 deletions src/ibc_module/handshake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
DepsMut, Env, IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg,
IbcChannelOpenResponse,
};

use crate::ContractError;

/// Handles the `OpenInit` and `OpenTry` parts of the IBC handshake.
/// In this application, we only handle `OpenInit` messages.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_open(
_deps: DepsMut,
_env: Env,
msg: IbcChannelOpenMsg,
) -> Result<IbcChannelOpenResponse, ContractError> {
match msg {
IbcChannelOpenMsg::OpenInit { channel } => todo!(),
IbcChannelOpenMsg::OpenTry { .. } => unimplemented!(),
}
}

/// Handles the `OpenAck` and `OpenConfirm` parts of the IBC handshake.
/// In this application, we only handle `OpenAck` messages.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_connect(
_deps: DepsMut,
_env: Env,
msg: IbcChannelConnectMsg,
) -> Result<IbcBasicResponse, ContractError> {
match msg {
IbcChannelConnectMsg::OpenAck {
channel,
counterparty_version,
} => todo!(),
IbcChannelConnectMsg::OpenConfirm { .. } => unimplemented!(),
}
}

/// Handles the `OnChanCloseConfirm` for the IBC module.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_close(
deps: DepsMut,
_env: Env,
msg: IbcChannelCloseMsg,
) -> Result<IbcBasicResponse, ContractError> {
match msg {
IbcChannelCloseMsg::CloseInit { .. } => unimplemented!(),
IbcChannelCloseMsg::CloseConfirm { channel } => todo!(),
}
}
53 changes: 1 addition & 52 deletions src/ibc_module/mod.rs
Original file line number Diff line number Diff line change
@@ -1,52 +1 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
DepsMut, Env, IbcBasicResponse, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg,
IbcChannelOpenResponse,
};

use crate::ContractError;

/// Handles the `OpenInit` and `OpenTry` parts of the IBC handshake.
/// In this application, we only handle `OpenInit` messages.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_open(
_deps: DepsMut,
_env: Env,
msg: IbcChannelOpenMsg,
) -> Result<IbcChannelOpenResponse, ContractError> {
match msg {
IbcChannelOpenMsg::OpenInit { channel } => todo!(),
IbcChannelOpenMsg::OpenTry { .. } => unimplemented!(),
}
}

/// Handles the `OpenAck` and `OpenConfirm` parts of the IBC handshake.
/// In this application, we only handle `OpenAck` messages.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_connect(
_deps: DepsMut,
_env: Env,
msg: IbcChannelConnectMsg,
) -> Result<IbcBasicResponse, ContractError> {
match msg {
IbcChannelConnectMsg::OpenAck {
channel,
counterparty_version,
} => todo!(),
IbcChannelConnectMsg::OpenConfirm { .. } => unimplemented!(),
}
}

/// Handles the `OnChanCloseConfirm` for the IBC module.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_close(
deps: DepsMut,
_env: Env,
msg: IbcChannelCloseMsg,
) -> Result<IbcBasicResponse, ContractError> {
match msg {
IbcChannelCloseMsg::CloseInit { .. } => unimplemented!(),
IbcChannelCloseMsg::CloseConfirm { channel } => todo!(),
}
}
pub mod handshake;

0 comments on commit 855302e

Please sign in to comment.