Skip to content

Commit

Permalink
Hardcoded IBC ICS20 channel info for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed Dec 22, 2024
1 parent 35f0364 commit cb8e897
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions contracts/babylon/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use cosmwasm_std::{
to_json_binary, to_json_string, Addr, Binary, Deps, DepsMut, Empty, Env, IbcMsg, MessageInfo,
QueryResponse, Reply, Response, SubMsg, SubMsgResponse, WasmMsg,
};
use cosmwasm_std::{to_json_binary, to_json_string, Addr, Binary, Deps, DepsMut, Empty, Env, IbcChannel, IbcEndpoint, IbcMsg, IbcOrder, MessageInfo, QueryResponse, Reply, Response, SubMsg, SubMsgResponse, WasmMsg};
use cw2::set_contract_version;
use cw_utils::{must_pay, ParseReplyError};

Expand Down Expand Up @@ -285,7 +282,21 @@ pub fn execute(
// Build the memo payload
let memo_msg = to_json_string(&fp_distribution)?;
// Route to babylon over IBC
let channel = IBC_CHANNEL.load(deps.storage)?;
// let channel = IBC_CHANNEL.load(deps.storage)?;
// TODO: Get from the list of open channels
let channel = IbcChannel::new(
IbcEndpoint {
port_id: "transfer".to_string(),
channel_id: "channel-1".to_string(),
},
IbcEndpoint {
port_id: "transfer".to_string(),
channel_id: "channel-1".to_string(),
},
IbcOrder::Unordered,
"ics20-1",
"connection-0",
);

// Construct the transfer message
let ibc_msg = IbcMsg::Transfer {
Expand All @@ -301,6 +312,7 @@ pub fn execute(
#[cfg(not(any(test, feature = "library")))]
{
// TODO: Add events
deps.api.debug(&format!("FINALITY CONTRACT IBC msg: {:#?}", ibc_msg));
Ok(Response::new().add_message(ibc_msg))
}
#[cfg(any(test, feature = "library"))]
Expand Down

0 comments on commit cb8e897

Please sign in to comment.