Skip to content

Commit

Permalink
bump prost, tendermint, ibc-proto, ics23
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFluffy committed Dec 6, 2024
1 parent 4cd8fc0 commit 25fcbbe
Show file tree
Hide file tree
Showing 16 changed files with 811 additions and 491 deletions.
12 changes: 6 additions & 6 deletions crates/ibc-types-core-channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ ibc-types-domain-type = { version = "0.14.1", path = "../ibc-types-domain-type",
ibc-types-identifier = { version = "0.14.1", path = "../ibc-types-identifier", default-features = false }
ibc-types-timestamp = { version = "0.14.1", path = "../ibc-types-timestamp", default-features = false }
# Proto definitions for all IBC-related interfaces, e.g., connections or channels.
ibc-proto = { version = "0.42.2", default-features = false }
ibc-proto = { version = "0.51.1", default-features = false }
## for borsh encode or decode
borsh = {version = "0.10.0", default-features = false, optional = true }
bytes = { version = "1.2.1", default-features = false }
cfg-if = { version = "1.0.0", optional = true }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display"] }
displaydoc = { version = "0.2", default-features = false }
ics23 = { version = "0.11.3", default-features = false, features = ["host-functions"] }
ics23 = { version = "0.12.0", default-features = false, features = ["host-functions"] }
num-traits = { version = "0.2.15", default-features = false }
## for codec encode or decode
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true }
parking_lot = { version = "0.12.1", default-features = false, optional = true }
prost = { version = "0.12", default-features = false }
prost = { version = "0.13.3", default-features = false }
safe-regex = { version = "0.2.5", default-features = false }
# proc-macro2 to unbreak docs.rs build, see GH#56
proc-macro2 = { version = "0.1", default-features = false }
Expand All @@ -87,15 +87,15 @@ scale-info = { version = "2.1.2", default-features = false, features = ["derive"
anyhow = { version = "1", default-features = false }

[dependencies.tendermint]
version = "0.34.0"
version = "0.40.0"
default-features = false

[dependencies.tendermint-proto]
version = "0.34.0"
version = "0.40.0"
default-features = false

[dependencies.tendermint-testgen]
version = "0.34.0"
version = "0.40.0"
optional = true
default-features = false

Expand Down
214 changes: 139 additions & 75 deletions crates/ibc-types-core-channel/src/events/channel.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use alloc::borrow::ToOwned;
use ibc_types_core_connection::ConnectionId;
use tendermint::abci::{Event, TypedEvent};

use crate::prelude::*;
use crate::{ChannelId, PortId, Version};

use super::Error;
Expand Down Expand Up @@ -56,23 +56,32 @@ impl TryFrom<Event> for OpenInit {
let mut version = None;

for attr in event.attributes {
match attr.key.as_ref() {
"port_id" => {
port_id = Some(PortId(attr.value));
match attr.key_bytes() {
b"port_id" => {
port_id = Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"channel_id" => {
channel_id = Some(ChannelId(attr.value));
b"channel_id" => {
channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"counterparty_port_id" => {
counterparty_port_id = Some(PortId(attr.value));
b"counterparty_port_id" => {
counterparty_port_id =
Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"connection_id" => {
connection_id = Some(ConnectionId(attr.value));
b"connection_id" => {
connection_id = Some(ConnectionId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"version" => {
version = Some(Version(attr.value));
b"version" => {
version = Some(Version(String::from_utf8_lossy(attr.value_bytes()).into()));
}
unknown => {
return Err(Error::UnexpectedAttribute(
String::from_utf8_lossy(unknown).into(),
))
}
unknown => return Err(Error::UnexpectedAttribute(unknown.to_owned())),
}
}

Expand Down Expand Up @@ -136,26 +145,37 @@ impl TryFrom<Event> for OpenTry {
let mut version = None;

for attr in event.attributes {
match attr.key.as_ref() {
"port_id" => {
port_id = Some(PortId(attr.value));
match attr.key_bytes() {
b"port_id" => {
port_id = Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
b"channel_id" => {
channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"channel_id" => {
channel_id = Some(ChannelId(attr.value));
b"counterparty_port_id" => {
counterparty_port_id =
Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"counterparty_port_id" => {
counterparty_port_id = Some(PortId(attr.value));
b"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(attr.value));
b"connection_id" => {
connection_id = Some(ConnectionId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"connection_id" => {
connection_id = Some(ConnectionId(attr.value));
b"version" => {
version = Some(Version(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"version" => {
version = Some(Version(attr.value));
unknown => {
return Err(Error::UnexpectedAttribute(
String::from_utf8_lossy(unknown).into(),
))
}
unknown => return Err(Error::UnexpectedAttribute(unknown.to_owned())),
}
}

Expand Down Expand Up @@ -218,23 +238,34 @@ impl TryFrom<Event> for OpenAck {
let mut connection_id = None;

for attr in event.attributes {
match attr.key.as_ref() {
"port_id" => {
port_id = Some(PortId(attr.value));
match attr.key_bytes() {
b"port_id" => {
port_id = Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
b"channel_id" => {
channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"channel_id" => {
channel_id = Some(ChannelId(attr.value));
b"counterparty_port_id" => {
counterparty_port_id =
Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"counterparty_port_id" => {
counterparty_port_id = Some(PortId(attr.value));
b"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(attr.value));
b"connection_id" => {
connection_id = Some(ConnectionId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"connection_id" => {
connection_id = Some(ConnectionId(attr.value));
unknown => {
return Err(Error::UnexpectedAttribute(
String::from_utf8_lossy(unknown).into(),
))
}
unknown => return Err(Error::UnexpectedAttribute(unknown.to_owned())),
}
}

Expand Down Expand Up @@ -296,23 +327,34 @@ impl TryFrom<Event> for OpenConfirm {
let mut connection_id = None;

for attr in event.attributes {
match attr.key.as_ref() {
"port_id" => {
port_id = Some(PortId(attr.value));
match attr.key_bytes() {
b"port_id" => {
port_id = Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"channel_id" => {
channel_id = Some(ChannelId(attr.value));
b"channel_id" => {
channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"counterparty_port_id" => {
counterparty_port_id = Some(PortId(attr.value));
b"counterparty_port_id" => {
counterparty_port_id =
Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(attr.value));
b"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"connection_id" => {
connection_id = Some(ConnectionId(attr.value));
b"connection_id" => {
connection_id = Some(ConnectionId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
unknown => {
return Err(Error::UnexpectedAttribute(
String::from_utf8_lossy(unknown).into(),
))
}
unknown => return Err(Error::UnexpectedAttribute(unknown.to_owned())),
}
}

Expand Down Expand Up @@ -374,23 +416,34 @@ impl TryFrom<Event> for CloseInit {
let mut connection_id = None;

for attr in event.attributes {
match attr.key.as_ref() {
"port_id" => {
port_id = Some(PortId(attr.value));
match attr.key_bytes() {
b"port_id" => {
port_id = Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
b"channel_id" => {
channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"channel_id" => {
channel_id = Some(ChannelId(attr.value));
b"counterparty_port_id" => {
counterparty_port_id =
Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"counterparty_port_id" => {
counterparty_port_id = Some(PortId(attr.value));
b"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(attr.value));
b"connection_id" => {
connection_id = Some(ConnectionId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"connection_id" => {
connection_id = Some(ConnectionId(attr.value));
unknown => {
return Err(Error::UnexpectedAttribute(
String::from_utf8_lossy(unknown).into(),
))
}
unknown => return Err(Error::UnexpectedAttribute(unknown.to_owned())),
}
}

Expand Down Expand Up @@ -452,23 +505,34 @@ impl TryFrom<Event> for CloseConfirm {
let mut connection_id = None;

for attr in event.attributes {
match attr.key.as_ref() {
"port_id" => {
port_id = Some(PortId(attr.value));
match attr.key_bytes() {
b"port_id" => {
port_id = Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
b"channel_id" => {
channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"channel_id" => {
channel_id = Some(ChannelId(attr.value));
b"counterparty_port_id" => {
counterparty_port_id =
Some(PortId(String::from_utf8_lossy(attr.value_bytes()).into()));
}
"counterparty_port_id" => {
counterparty_port_id = Some(PortId(attr.value));
b"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"counterparty_channel_id" => {
counterparty_channel_id = Some(ChannelId(attr.value));
b"connection_id" => {
connection_id = Some(ConnectionId(
String::from_utf8_lossy(attr.value_bytes()).into(),
));
}
"connection_id" => {
connection_id = Some(ConnectionId(attr.value));
unknown => {
return Err(Error::UnexpectedAttribute(
String::from_utf8_lossy(unknown).into(),
))
}
unknown => return Err(Error::UnexpectedAttribute(unknown.to_owned())),
}
}

Expand Down
Loading

0 comments on commit 25fcbbe

Please sign in to comment.