Skip to content

Commit

Permalink
remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Aug 12, 2024
1 parent ff09533 commit 00e00fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
5 changes: 0 additions & 5 deletions contracts/babylon/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ pub fn instantiate(
_info: MessageInfo,
msg: InstantiateMsg,
) -> Result<Response<BabylonMsg>, ContractError> {
deps.api.debug("CONTRACT: Entering instantiate function");
deps.api.debug(&format!("CONTRACT: Consumer Name: {}", msg.consumer_name));
deps.api.debug(&format!("CONTRACT: Consumer Description: {}", msg.consumer_description));


msg.validate()?;

// initialise config
Expand Down
31 changes: 3 additions & 28 deletions contracts/babylon/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub fn ibc_channel_open(
_env: Env,
msg: IbcChannelOpenMsg,
) -> Result<IbcChannelOpenResponse, ContractError> {
deps.api.debug("CONTRACT: Entered function: ibc_channel_open");
// Ensure we have no channel yet
if IBC_CHANNEL.may_load(deps.storage)?.is_some() {
return Err(ContractError::IbcChannelAlreadyOpen {});
Expand Down Expand Up @@ -61,8 +60,6 @@ pub fn ibc_channel_connect(
env: &Env,
msg: IbcChannelConnectMsg,
) -> Result<IbcBasicResponse, ContractError> {
deps.api.debug("CONTRACT: Entered function: ibc_channel_connect");

// Ensure we have no channel yet
if IBC_CHANNEL.may_load(deps.storage)?.is_some() {
return Err(ContractError::IbcChannelAlreadyOpen {});
Expand Down Expand Up @@ -90,8 +87,6 @@ pub fn ibc_channel_connect(
consumer_description: cfg.consumer_description,
};

deps.api.debug(&format!("ConsumerRegisterIBCPacket:\n{:#?}", consumer_register_packet));

// Create the ZoneconciergePacketData
let packet_data = ZoneconciergePacketData {
packet: Some(Packet::ConsumerRegister(consumer_register_packet)),
Expand All @@ -106,8 +101,6 @@ pub fn ibc_channel_connect(
timeout: packet_timeout(env),
};

deps.api.debug(&format!("Sending IBC message from ibc_channel_connect: {:?}", ibc_msg));

let chan_id = &channel.endpoint.channel_id;
Ok(IbcBasicResponse::new()
.add_message(ibc_msg)
Expand Down Expand Up @@ -382,29 +375,11 @@ pub fn packet_timeout(env: &Env) -> IbcTimeout {
}

pub fn ibc_packet_ack(
deps: DepsMut,
_deps: DepsMut,
_env: Env,
msg: IbcPacketAckMsg,
_msg: IbcPacketAckMsg,
) -> Result<IbcBasicResponse, ContractError> {
deps.api.debug(&format!("Received acknowledgement: {:?}", msg.acknowledgement));

// Parse the acknowledgement and handle success/error
let ack: StdAck = from_json(&msg.acknowledgement.data)?;
match ack {
StdAck::Success(data) => {
// Handle successful acknowledgement
deps.api.debug(&format!("Packet successfully processed by receiver: {:?}", data));
// Add any necessary state updates or further actions
}
StdAck::Error(error) => {
// Handle error acknowledgement
deps.api.debug(&format!("Packet processing error: {}", error));
// Add any necessary error handling or recovery logic
}
}

Ok(IbcBasicResponse::new()
.add_attribute("action", "acknowledge_packet"))
Ok(IbcBasicResponse::default())
}

pub fn ibc_packet_timeout(
Expand Down

0 comments on commit 00e00fe

Please sign in to comment.