From b9123478151aed717b0e7f21d27fd2a592d7eaaf Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Thu, 15 Jul 2021 16:35:36 +0200 Subject: [PATCH] Support for new message.actions strings of ICS27 Based on discussion from https://github.com/cosmos/cosmos-sdk/pull/9139#discussion_r628159208 This is not yet tested! --- modules/src/application/mod.rs | 4 ++++ relayer/src/event/rpc.rs | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/src/application/mod.rs b/modules/src/application/mod.rs index bff5c4c1d5..c536e71083 100644 --- a/modules/src/application/mod.rs +++ b/modules/src/application/mod.rs @@ -1 +1,5 @@ pub mod ics20_fungible_token_transfer; + +// TODO: These consts should move into the ICS27 namespace +pub const ICS27_SEND_TYPE_URL: &str = "/cosmos.bank.v1beta1.MsgSend"; +pub const ICS27_REGISTER_TYPE_URL: &str = "/intertx.MsgRegister"; diff --git a/relayer/src/event/rpc.rs b/relayer/src/event/rpc.rs index 1c8a50d8a3..b10b2618e7 100644 --- a/relayer/src/event/rpc.rs +++ b/relayer/src/event/rpc.rs @@ -108,10 +108,13 @@ pub fn build_event(mut object: RawObject) -> Result { // Note: There is no message.action "send_packet", the only one we can hook into is the // module's action: // - "transfer" for ICS20 - // - "register" and "send" for ICS27 + // - "MsgSend" and "MsgRegister" for ICS27 // However the attributes are all prefixed with "send_packet" therefore the overwrite here // TODO: This need to be sorted out - "transfer" | ibc::application::ics20_fungible_token_transfer::msgs::transfer::TYPE_URL => { + "transfer" + | ibc::application::ics20_fungible_token_transfer::msgs::transfer::TYPE_URL + | ibc::application::ICS27_SEND_TYPE_URL + | ibc::application::ICS27_REGISTER_TYPE_URL => { object.action = "send_packet".to_string(); Ok(IbcEvent::from(ChannelEvents::SendPacket::try_from(object)?)) }