Skip to content

Commit 51f4c22

Browse files
committed
rm TimeoutOnClose
1 parent 7c9b0ef commit 51f4c22

File tree

6 files changed

+12
-137
lines changed

6 files changed

+12
-137
lines changed

ibc-eureka-core/ics04-channel/src/handler/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ mod acknowledgement;
33
mod recv_packet;
44
mod send_packet;
55
mod timeout;
6-
mod timeout_on_close;
76

87
pub use acknowledgement::*;
98
pub use recv_packet::*;
109
pub use send_packet::*;
1110
pub use timeout::*;
12-
pub use timeout_on_close::*;

ibc-eureka-core/ics04-channel/src/handler/timeout.rs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use ibc_eureka_core_channel_types::commitment::compute_packet_commitment;
22
use ibc_eureka_core_channel_types::error::ChannelError;
33
use ibc_eureka_core_channel_types::events::TimeoutPacket;
4-
use ibc_eureka_core_channel_types::msgs::{MsgTimeout, MsgTimeoutOnClose};
4+
use ibc_eureka_core_channel_types::msgs::MsgTimeout;
55
use ibc_eureka_core_client::context::prelude::*;
66
use ibc_eureka_core_handler_types::events::{IbcEvent, MessageEvent};
77
use ibc_eureka_core_host::types::path::{
@@ -11,46 +11,30 @@ use ibc_eureka_core_host::{ExecutionContext, ValidationContext};
1111
use ibc_eureka_core_router::module::Module;
1212
use ibc_primitives::prelude::*;
1313

14-
use super::timeout_on_close;
15-
16-
pub enum TimeoutMsgType {
17-
Timeout(MsgTimeout),
18-
TimeoutOnClose(MsgTimeoutOnClose),
19-
}
20-
2114
pub fn timeout_packet_validate<ValCtx>(
2215
ctx_a: &ValCtx,
2316
module: &dyn Module,
24-
timeout_msg_type: TimeoutMsgType,
17+
msg: MsgTimeout,
2518
) -> Result<(), ChannelError>
2619
where
2720
ValCtx: ValidationContext,
2821
{
29-
match &timeout_msg_type {
30-
TimeoutMsgType::Timeout(msg) => validate(ctx_a, msg),
31-
TimeoutMsgType::TimeoutOnClose(msg) => timeout_on_close::validate(ctx_a, msg),
32-
}?;
33-
34-
let (packet, signer) = match timeout_msg_type {
35-
TimeoutMsgType::Timeout(msg) => (msg.packet, msg.signer),
36-
TimeoutMsgType::TimeoutOnClose(msg) => (msg.packet, msg.signer),
37-
};
22+
validate(ctx_a, &msg)?;
23+
24+
let (packet, signer) = (msg.packet, msg.signer);
3825

3926
module.on_timeout_packet_validate(&packet, &signer)
4027
}
4128

4229
pub fn timeout_packet_execute<ExecCtx>(
4330
ctx_a: &mut ExecCtx,
4431
module: &mut dyn Module,
45-
timeout_msg_type: TimeoutMsgType,
32+
msg: MsgTimeout,
4633
) -> Result<(), ChannelError>
4734
where
4835
ExecCtx: ExecutionContext,
4936
{
50-
let (packet, signer) = match timeout_msg_type {
51-
TimeoutMsgType::Timeout(msg) => (msg.packet, msg.signer),
52-
TimeoutMsgType::TimeoutOnClose(msg) => (msg.packet, msg.signer),
53-
};
37+
let (packet, signer) = (msg.packet, msg.signer);
5438

5539
let payload = &packet.payloads[0];
5640

ibc-eureka-core/ics04-channel/src/handler/timeout_on_close.rs

Lines changed: 0 additions & 90 deletions
This file was deleted.

ibc-eureka-core/ics04-channel/types/src/msgs/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ pub enum PacketMsg {
2626
Recv(MsgRecvPacket),
2727
Ack(MsgAcknowledgement),
2828
Timeout(MsgTimeout),
29-
TimeoutOnClose(MsgTimeoutOnClose),
3029
}
3130

3231
pub fn packet_msg_to_port_id(msg: &PacketMsg) -> &PortId {
3332
match msg {
3433
PacketMsg::Recv(msg) => &msg.packet.payloads[0].header.target_port.1,
3534
PacketMsg::Ack(msg) => &msg.packet.payloads[0].header.source_port.1,
3635
PacketMsg::Timeout(msg) => &msg.packet.payloads[0].header.source_port.1,
37-
PacketMsg::TimeoutOnClose(msg) => &msg.packet.payloads[0].header.source_port.1,
3836
}
3937
}

ibc-eureka-core/ics25-handler/src/entrypoint.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use ibc_eureka_core_channel::handler::{
22
acknowledgement_packet_execute, acknowledgement_packet_validate, recv_packet_execute,
3-
recv_packet_validate, timeout_packet_execute, timeout_packet_validate, TimeoutMsgType,
3+
recv_packet_validate, timeout_packet_execute, timeout_packet_validate,
44
};
55
use ibc_eureka_core_channel::types::msgs::{packet_msg_to_port_id, PacketMsg};
66
use ibc_eureka_core_client::context::{ClientExecutionContext, ClientValidationContext};
@@ -73,12 +73,7 @@ where
7373
match msg {
7474
PacketMsg::Recv(msg) => recv_packet_validate(ctx, msg)?,
7575
PacketMsg::Ack(msg) => acknowledgement_packet_validate(ctx, module, msg)?,
76-
PacketMsg::Timeout(msg) => {
77-
timeout_packet_validate(ctx, module, TimeoutMsgType::Timeout(msg))?
78-
}
79-
PacketMsg::TimeoutOnClose(msg) => {
80-
timeout_packet_validate(ctx, module, TimeoutMsgType::TimeoutOnClose(msg))?
81-
}
76+
PacketMsg::Timeout(msg) => timeout_packet_validate(ctx, module, msg)?,
8277
}
8378
}
8479
};
@@ -123,12 +118,7 @@ where
123118
match msg {
124119
PacketMsg::Recv(msg) => recv_packet_execute(ctx, module, msg)?,
125120
PacketMsg::Ack(msg) => acknowledgement_packet_execute(ctx, module, msg)?,
126-
PacketMsg::Timeout(msg) => {
127-
timeout_packet_execute(ctx, module, TimeoutMsgType::Timeout(msg))?
128-
}
129-
PacketMsg::TimeoutOnClose(msg) => {
130-
timeout_packet_execute(ctx, module, TimeoutMsgType::TimeoutOnClose(msg))?
131-
}
121+
PacketMsg::Timeout(msg) => timeout_packet_execute(ctx, module, msg)?,
132122
}
133123
}
134124
}

ibc-eureka-core/ics25-handler/types/src/msgs.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use ibc_eureka_core_channel_types::msgs::{
2-
MsgAcknowledgement, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, PacketMsg,
3-
ACKNOWLEDGEMENT_TYPE_URL, RECV_PACKET_TYPE_URL, TIMEOUT_ON_CLOSE_TYPE_URL, TIMEOUT_TYPE_URL,
2+
MsgAcknowledgement, MsgRecvPacket, MsgTimeout, PacketMsg, ACKNOWLEDGEMENT_TYPE_URL,
3+
RECV_PACKET_TYPE_URL, TIMEOUT_TYPE_URL,
44
};
55
#[allow(deprecated)]
66
use ibc_eureka_core_client_types::msgs::{
@@ -64,11 +64,6 @@ impl TryFrom<Any> for MsgEnvelope {
6464
let domain_msg = MsgTimeout::decode_vec(&any_msg.value)?;
6565
Ok(MsgEnvelope::Packet(PacketMsg::Timeout(domain_msg)))
6666
}
67-
TIMEOUT_ON_CLOSE_TYPE_URL => {
68-
let domain_msg = MsgTimeoutOnClose::decode_vec(&any_msg.value)?;
69-
Ok(MsgEnvelope::Packet(PacketMsg::TimeoutOnClose(domain_msg)))
70-
}
71-
7267
_ => Err(DecodingError::UnknownTypeUrl(any_msg.type_url))?,
7368
}
7469
}

0 commit comments

Comments
 (0)