Skip to content

Commit 7750afd

Browse files
committed
refactor: add Version::compatibles()
1 parent ec84de5 commit 7750afd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ibc-core/ics03-connection/types/src/version.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ impl Version {
5858
}
5959
Ok(())
6060
}
61+
/// Returns the lists of supported versions
62+
pub fn compatibles() -> Vec<Self> {
63+
vec![Self {
64+
identifier: "1".to_string(),
65+
features: vec!["ORDER_ORDERED".to_string(), "ORDER_UNORDERED".to_string()],
66+
}]
67+
}
6168
}
6269

6370
impl Protobuf<RawVersion> for Version {}
@@ -111,10 +118,7 @@ impl Display for Version {
111118

112119
/// Returns the lists of supported versions
113120
pub fn get_compatible_versions() -> Vec<Version> {
114-
vec![Version {
115-
identifier: "1".to_string(),
116-
features: vec!["ORDER_ORDERED".to_string(), "ORDER_UNORDERED".to_string()],
117-
}]
121+
Version::compatibles()
118122
}
119123

120124
/// Iterates over the descending ordered set of compatible IBC versions and

0 commit comments

Comments
 (0)