Skip to content

Commit

Permalink
Support for ICS27 (informalsystems#839)
Browse files Browse the repository at this point in the history
* Add ICS-27 message action, fix error output

* Handle intertx send

* Update changelog

* Removing config example
  • Loading branch information
ancazamfir authored May 1, 2021
1 parent 228806a commit 7230c1d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

> [TODO: high level summary]
### FEATURES

- [ibc-relayer]
- Support for ICS27 ([#794])

### IMPROVEMENTS

- [ibc]
Expand Down Expand Up @@ -29,6 +34,7 @@

[#758]: https://github.com/informalsystems/ibc-rs/issues/758
[#785]: https://github.com/informalsystems/ibc-rs/issues/785
[#794]: https://github.com/informalsystems/ibc-rs/issues/794
[#811]: https://github.com/informalsystems/ibc-rs/issues/811
[#840]: https://github.com/informalsystems/ibc-rs/issues/840
[#851]: https://github.com/informalsystems/ibc-rs/issues/851
Expand Down
2 changes: 2 additions & 0 deletions relayer/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ pub trait Chain: Sized {
// TODO - query the chain, currently hardcoded
if port_id.as_str() == "transfer" {
"ics20-1".to_string()
} else if port_id.as_str() == "ibcaccount" {
"ics27-1".to_string()
} else {
"".to_string()
}
Expand Down
8 changes: 5 additions & 3 deletions relayer/src/event/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ pub fn build_event(mut object: RawObject) -> Result<IbcEvent, BoxError> {

// Packet events
// Note: There is no message.action "send_packet", the only one we can hook into is the
// module's action, "transfer" being the only one in IBC1.0. However the attributes
// are all prefixed with "send_packet" therefore the overwrite here
// module's action:
// - "transfer" for ICS20
// - "register" and "send" for ICS27
// However the attributes are all prefixed with "send_packet" therefore the overwrite here
// TODO: This need to be sorted out
"transfer" => {
"transfer" | "register" | "send" => {
object.action = "send_packet".to_string();
Ok(IbcEvent::from(ChannelEvents::SendPacket::try_from(object)?))
}
Expand Down
6 changes: 3 additions & 3 deletions relayer/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ pub enum LinkError {
#[error("failed during query to chain id {0} with underlying error: {1}")]
QueryError(ChainId, Error),

#[error("ConnectionError:")]
#[error("ConnectionError: {0}:")]
ConnectionError(#[from] ConnectionError),

#[error("ChannelError:")]
#[error("ChannelError: {0}:")]
ChannelError(#[from] ChannelError),

#[error("Failed during a client operation: {0}:")]
ClientError(ForeignClientError),

#[error("PacketError:")]
#[error("PacketError: {0}:")]
PacketError(#[from] Error),

#[error("clearing of old packets failed")]
Expand Down

0 comments on commit 7230c1d

Please sign in to comment.