Skip to content

Commit

Permalink
Merge branch 'master' into andy/gaia-v5.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
andynog committed Nov 9, 2021
2 parents 6546701 + 52e0314 commit 703ee62
Show file tree
Hide file tree
Showing 61 changed files with 688 additions and 470 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1408-vega-protos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Support for compatibility with gaia Vega upgrade (protos matching ibc-go v1.2.2 and SDK v0.44.3)
([#1408](https://github.com/informalsystems/ibc-rs/issues/1408))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Upgrade IBC-rs TLA+ MBT models to modern Apalache type annotations
([#1544](https://github.com/informalsystems/ibc-rs/issues/1544))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Derive `PartialEq` and `Eq` on `IbcEvent` and inner types
([#1546](https://github.com/informalsystems/ibc-rs/issues/1546))
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/src/clients/ics07_tendermint/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::timestamp::Timestamp;
use crate::Height;

/// Tendermint consensus header
#[derive(Clone, PartialEq, Deserialize, Serialize)] // TODO: Add Eq bound once present in tendermint-rs
#[derive(Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct Header {
pub signed_header: SignedHeader, // contains the commitment root
pub validator_set: ValidatorSet, // the validator set that signed Header
Expand Down
8 changes: 4 additions & 4 deletions modules/src/core/ics02_client/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub fn extract_header_from_tx(event: &AbciEvent) -> Result<AnyHeader, Error> {

/// NewBlock event signals the committing & execution of a new block.
// TODO - find a better place for NewBlock
#[derive(Debug, Deserialize, Serialize, Clone, Copy)]
#[derive(Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq)]
pub struct NewBlock {
pub height: Height,
}
Expand Down Expand Up @@ -180,7 +180,7 @@ impl core::fmt::Display for Attributes {
}

/// CreateClient event signals the creation of a new on-chain client (IBC client).
#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct CreateClient(pub Attributes);

impl CreateClient {
Expand Down Expand Up @@ -224,7 +224,7 @@ impl core::fmt::Display for CreateClient {
}

/// UpdateClient event signals a recent update of an on-chain client (IBC Client).
#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct UpdateClient {
pub common: Attributes,
pub header: Option<AnyHeader>,
Expand Down Expand Up @@ -291,7 +291,7 @@ impl core::fmt::Display for UpdateClient {

/// ClientMisbehaviour event signals the update of an on-chain client (IBC Client) with evidence of
/// misbehaviour.
#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct ClientMisbehaviour(pub Attributes);

impl ClientMisbehaviour {
Expand Down
2 changes: 1 addition & 1 deletion modules/src/core/ics02_client/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub trait Header: Clone + core::fmt::Debug + Send + Sync {
fn wrap_any(self) -> AnyHeader;
}

#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] // TODO: Add Eq bound once possible
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
#[allow(clippy::large_enum_variant)]
pub enum AnyHeader {
Tendermint(TendermintHeader),
Expand Down
8 changes: 4 additions & 4 deletions modules/src/core/ics03_connection/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl From<Attributes> for Vec<Tag> {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenInit(Attributes);

impl OpenInit {
Expand Down Expand Up @@ -176,7 +176,7 @@ impl From<OpenInit> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenTry(Attributes);

impl OpenTry {
Expand Down Expand Up @@ -216,7 +216,7 @@ impl From<OpenTry> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenAck(Attributes);

impl OpenAck {
Expand Down Expand Up @@ -256,7 +256,7 @@ impl From<OpenAck> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenConfirm(Attributes);

impl OpenConfirm {
Expand Down
24 changes: 12 additions & 12 deletions modules/src/core/ics04_channel/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl TryFrom<Packet> for Vec<Tag> {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenInit(pub Attributes);

impl OpenInit {
Expand Down Expand Up @@ -372,7 +372,7 @@ impl From<OpenInit> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenTry(pub Attributes);

impl OpenTry {
Expand Down Expand Up @@ -415,7 +415,7 @@ impl From<OpenTry> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenAck(pub Attributes);

impl OpenAck {
Expand Down Expand Up @@ -462,7 +462,7 @@ impl From<OpenAck> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct OpenConfirm(pub Attributes);

impl OpenConfirm {
Expand Down Expand Up @@ -505,7 +505,7 @@ impl From<OpenConfirm> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct CloseInit(pub Attributes);

impl CloseInit {
Expand Down Expand Up @@ -572,7 +572,7 @@ impl core::fmt::Display for CloseInit {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct CloseConfirm(pub Attributes);

impl CloseConfirm {
Expand Down Expand Up @@ -609,7 +609,7 @@ impl From<CloseConfirm> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct SendPacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -674,7 +674,7 @@ impl core::fmt::Display for SendPacket {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct ReceivePacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -713,7 +713,7 @@ impl core::fmt::Display for ReceivePacket {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct WriteAcknowledgement {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -778,7 +778,7 @@ impl core::fmt::Display for WriteAcknowledgement {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct AcknowledgePacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -823,7 +823,7 @@ impl core::fmt::Display for AcknowledgePacket {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct TimeoutPacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -874,7 +874,7 @@ impl core::fmt::Display for TimeoutPacket {
}
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
pub struct TimeoutOnClosePacket {
pub height: Height,
pub packet: Packet,
Expand Down
2 changes: 1 addition & 1 deletion modules/src/core/ics04_channel/msgs/chan_close_confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mod tests {
name: "Bad port, name too long".to_string(),
raw: RawMsgChannelCloseConfirm {
port_id:
"abcdefghijklmnsdfasdfasdfasdfasdgafgadsfasdfasdfasdasfdasdfsadfopqrstu"
"abcdefghijklmnsdfasdfasdfasdfasdgafgadsfasdfasdfasdasfdasdfsadfopqrstuabcdefghijklmnsdfasdfasdfasdfasdgafgadsfasdfasdfasdasfdasdfsadfopqrstu"
.to_string(),
..default_raw_msg.clone()
},
Expand Down
2 changes: 1 addition & 1 deletion modules/src/core/ics04_channel/msgs/chan_close_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ mod tests {
Test {
name: "Bad port, name too long".to_string(),
raw: RawMsgChannelCloseInit {
port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(),
port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(),
..default_raw_msg.clone()
},
want_pass: false,
Expand Down
2 changes: 1 addition & 1 deletion modules/src/core/ics04_channel/msgs/chan_open_ack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ mod tests {
Test {
name: "Bad port, name too long".to_string(),
raw: RawMsgChannelOpenAck {
port_id: "abcdezdfDfsdfgfddsfsfdsdfdfvxcvzxcvsgdfsdfwefwvsdfdsfdasgagadgsadgsdffghijklmnopqrstu".to_string(),
port_id: "abcdezdfDfsdfgfddsfsfdsdfdfvxcvzxcvsgdfsdfwefwvsdfdsfdasgagadgsadgsdffghijklmnopqrstuabcdezdfDfsdfgfddsfsfdsdfdfvxcvzxcvsgdfsdfwefwvsdfdsfdasgagadgsadgsdffghijklmnopqrstu".to_string(),
..default_raw_msg.clone()
},
want_pass: false,
Expand Down
2 changes: 1 addition & 1 deletion modules/src/core/ics04_channel/msgs/chan_open_confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ mod tests {
Test {
name: "Bad port, name too long".to_string(),
raw: RawMsgChannelOpenConfirm {
port_id: "abcdesdfasdsdffasdfasdfasfasdgasdfgasdfasdfasdfasdfasdfasdffghijklmnopqrstu".to_string(),
port_id: "abcdesdfasdsdffasdfasdfasfasdgasdfgasdfasdfasdfasdfasdfasdffghijklmnopqrstuabcdesdfasdsdffasdfasdfasfasdgasdfgasdfasdfasdfasdfasdfasdffghijklmnopqrstu".to_string(),
..default_raw_msg.clone()
},
want_pass: false,
Expand Down
2 changes: 1 addition & 1 deletion modules/src/core/ics04_channel/msgs/chan_open_try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ mod tests {
Test {
name: "Bad port, name too long".to_string(),
raw: RawMsgChannelOpenTry {
port_id: "abcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfasdfasdfaklmnopqrstu".to_string(),
port_id: "abcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfaabcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfa".to_string(),
..default_raw_msg.clone()
},
want_pass: false,
Expand Down
6 changes: 3 additions & 3 deletions modules/src/core/ics04_channel/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl core::fmt::Display for Sequence {
}
}

#[derive(Clone, Debug, Default, Hash, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Hash, PartialEq, Eq, Deserialize, Serialize)]
pub struct Packet {
pub sequence: Sequence,
pub source_port: PortId,
Expand Down Expand Up @@ -317,7 +317,7 @@ mod tests {
Test {
name: "Bad src port, name too long".to_string(),
raw: RawPacket {
source_port: "abcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfasdfasdfaklmnopqrstu".to_string(),
source_port: "abcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfasdfasdfaklmnopqrstuabcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfasdfasdfaklmnopqrstu".to_string(),
..default_raw_msg.clone()
},
want_pass: false,
Expand All @@ -341,7 +341,7 @@ mod tests {
Test {
name: "Bad dst port, name too long".to_string(),
raw: RawPacket {
destination_port: "abcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfasdfasdfaklmnopqrstu".to_string(),
destination_port: "abcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfasdfasdfasdfaklmnopqrstuabcdefghijasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadgasgasdfas".to_string(),
..default_raw_msg.clone()
},
want_pass: false,
Expand Down
8 changes: 4 additions & 4 deletions modules/src/core/ics24_host/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ pub fn validate_connection_identifier(id: &str) -> Result<(), Error> {

/// Default validator function for Port identifiers.
///
/// A valid Identifier must be between 2-64 characters and only contain lowercase
/// A valid Identifier must be between 2-128 characters and only contain lowercase
/// alphabetic characters,
pub fn validate_port_identifier(id: &str) -> Result<(), Error> {
validate_identifier(id, 2, 64)
validate_identifier(id, 2, 128)
}

/// Default validator function for Channel identifiers.
Expand Down Expand Up @@ -92,9 +92,9 @@ mod tests {

#[test]
fn parse_invalid_port_id_max() {
// invalid max port id (test string length is 65 chars)
// invalid max port id (test string length is 130 chars)
let id = validate_port_identifier(
"9anxkcme6je544d5lnj46zqiiiygfqzf8w4bjecbnyj4lj6s7zlpst67yln64tixp",
"9anxkcme6je544d5lnj46zqiiiygfqzf8w4bjecbnyj4lj6s7zlpst67yln64tixp9anxkcme6je544d5lnj46zqiiiygfqzf8w4bjecbnyj4lj6s7zlpst67yln64tixp",
);
assert!(id.is_err())
}
Expand Down
2 changes: 1 addition & 1 deletion modules/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl FromStr for IbcEventType {
}

/// Events created by the IBC component of a chain, destined for a relayer.
#[derive(Debug, Clone, Deserialize, Serialize)]
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub enum IbcEvent {
NewBlock(NewBlock),

Expand Down
Loading

0 comments on commit 703ee62

Please sign in to comment.