Skip to content

Commit a860979

Browse files
committed
refactor(ics24-host): make 07-tendermint-0 a constant in tests
1 parent f279965 commit a860979

File tree

1 file changed

+9
-10
lines changed
  • ibc-core/ics24-host/types/src

1 file changed

+9
-10
lines changed

ibc-core/ics24-host/types/src/path.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ fn parse_upgrades(components: &[&str]) -> Option<Path> {
11691169
#[cfg(test)]
11701170
mod tests {
11711171
use super::*;
1172-
1172+
const DUMMY_CLIENT_ID: &str = "07-tendermint-0";
11731173
#[rstest::rstest]
11741174
#[case(NEXT_CLIENT_SEQUENCE, Path::NextClientSequence(NextClientSequencePath))]
11751175
#[case(
@@ -1182,28 +1182,27 @@ mod tests {
11821182
)]
11831183
#[case(
11841184
"clients/07-tendermint-0/clientState",
1185-
Path::ClientState(ClientStatePath("07-tendermint-0".into()))
1186-
)]
1185+
Path::ClientState(ClientStatePath(DUMMY_CLIENT_ID.into())))]
11871186
#[case(
11881187
"clients/07-tendermint-0/consensusStates/15-31",
11891188
Path::ClientConsensusState(ClientConsensusStatePath {
1190-
client_id: "07-tendermint-0".into(),
1189+
client_id: DUMMY_CLIENT_ID.into(),
11911190
revision_number: 15,
11921191
revision_height: 31,
11931192
})
11941193
)]
11951194
#[case(
11961195
"clients/07-tendermint-0/consensusStates/15-31/processedTime",
11971196
Path::ClientUpdateTime(ClientUpdateTimePath {
1198-
client_id: "07-tendermint-0".into(),
1197+
client_id: DUMMY_CLIENT_ID.into(),
11991198
revision_number: 15,
12001199
revision_height: 31,
12011200
})
12021201
)]
12031202
#[case(
12041203
"clients/07-tendermint-0/consensusStates/15-31/processedHeight",
12051204
Path::ClientUpdateHeight(ClientUpdateHeightPath {
1206-
client_id: "07-tendermint-0".into(),
1205+
client_id: DUMMY_CLIENT_ID.into(),
12071206
revision_number: 15,
12081207
revision_height: 31,
12091208
})
@@ -1289,7 +1288,7 @@ mod tests {
12891288
assert_eq!(
12901289
parse_client_paths(&components),
12911290
Some(Path::ClientState(ClientStatePath(ClientId::from(
1292-
"07-tendermint-0"
1291+
DUMMY_CLIENT_ID
12931292
))))
12941293
);
12951294

@@ -1299,7 +1298,7 @@ mod tests {
12991298
assert_eq!(
13001299
parse_client_paths(&components),
13011300
Some(Path::ClientConsensusState(ClientConsensusStatePath {
1302-
client_id: "07-tendermint-0".into(),
1301+
client_id: DUMMY_CLIENT_ID.into(),
13031302
revision_number: 15,
13041303
revision_height: 31,
13051304
}))
@@ -1314,7 +1313,7 @@ mod tests {
13141313
assert_eq!(
13151314
parse_client_paths(&components),
13161315
Some(Path::ClientUpdateTime(ClientUpdateTimePath {
1317-
client_id: "07-tendermint-0".into(),
1316+
client_id: DUMMY_CLIENT_ID.into(),
13181317
revision_number: 15,
13191318
revision_height: 31,
13201319
}))
@@ -1326,7 +1325,7 @@ mod tests {
13261325
assert_eq!(
13271326
parse_client_paths(&components),
13281327
Some(Path::ClientUpdateHeight(ClientUpdateHeightPath {
1329-
client_id: "07-tendermint-0".into(),
1328+
client_id: DUMMY_CLIENT_ID.into(),
13301329
revision_number: 15,
13311330
revision_height: 31,
13321331
}))

0 commit comments

Comments
 (0)