Skip to content

Commit

Permalink
Support for new message.actions strings of ICS27
Browse files Browse the repository at this point in the history
Based on discussion from
cosmos/cosmos-sdk#9139 (comment)
This is not yet tested!
  • Loading branch information
adizere committed Jul 15, 2021
1 parent 09ad7b8 commit b912347
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions modules/src/application/mod.rs
Original file line number Diff line number Diff line change
@@ -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";
7 changes: 5 additions & 2 deletions relayer/src/event/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ pub fn build_event(mut object: RawObject) -> Result<IbcEvent, BoxError> {
// 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)?))
}
Expand Down

0 comments on commit b912347

Please sign in to comment.