@@ -1169,7 +1169,13 @@ fn parse_upgrades(components: &[&str]) -> Option<Path> {
11691169#[ cfg( test) ]
11701170mod tests {
11711171 use super :: * ;
1172- const DEFAULT_CLIENT_ID : & str = "07-tendermint-0" ;
1172+ const DEFAULT_CLIENT_ID_STR : & str = "07-tendermint-0" ;
1173+ impl ClientId {
1174+ pub fn new_dummy ( ) -> Self {
1175+ ClientId :: from_str ( DEFAULT_CLIENT_ID_STR )
1176+ . expect ( "should not fail since we use a valid client id" )
1177+ }
1178+ }
11731179 #[ rstest:: rstest]
11741180 #[ case( NEXT_CLIENT_SEQUENCE , Path :: NextClientSequence ( NextClientSequencePath ) ) ]
11751181 #[ case(
@@ -1182,34 +1188,35 @@ mod tests {
11821188 ) ]
11831189 #[ case(
11841190 "clients/07-tendermint-0/clientState" ,
1185- Path :: ClientState ( ClientStatePath ( DEFAULT_CLIENT_ID . into( ) ) ) ) ]
1191+ Path :: ClientState ( ClientStatePath ( ClientId :: new_dummy( ) ) )
1192+ ) ]
11861193 #[ case(
11871194 "clients/07-tendermint-0/consensusStates/15-31" ,
11881195 Path :: ClientConsensusState ( ClientConsensusStatePath {
1189- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1196+ client_id: ClientId :: new_dummy ( ) ,
11901197 revision_number: 15 ,
11911198 revision_height: 31 ,
11921199 } )
11931200 ) ]
11941201 #[ case(
11951202 "clients/07-tendermint-0/consensusStates/15-31/processedTime" ,
11961203 Path :: ClientUpdateTime ( ClientUpdateTimePath {
1197- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1204+ client_id: ClientId :: new_dummy ( ) ,
11981205 revision_number: 15 ,
11991206 revision_height: 31 ,
12001207 } )
12011208 ) ]
12021209 #[ case(
12031210 "clients/07-tendermint-0/consensusStates/15-31/processedHeight" ,
12041211 Path :: ClientUpdateHeight ( ClientUpdateHeightPath {
1205- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1212+ client_id: ClientId :: new_dummy ( ) ,
12061213 revision_number: 15 ,
12071214 revision_height: 31 ,
12081215 } )
12091216 ) ]
12101217 #[ case(
12111218 "clients/07-tendermint-0/connections" ,
1212- Path :: ClientConnection ( ClientConnectionPath ( "07-tendermint-0" . into ( ) ) )
1219+ Path :: ClientConnection ( ClientConnectionPath ( ClientId :: new_dummy ( ) ) )
12131220 ) ]
12141221 #[ case(
12151222 "connections/connection-0" ,
@@ -1287,9 +1294,7 @@ mod tests {
12871294
12881295 assert_eq ! (
12891296 parse_client_paths( & components) ,
1290- Some ( Path :: ClientState ( ClientStatePath ( ClientId :: from(
1291- DEFAULT_CLIENT_ID
1292- ) ) ) )
1297+ Some ( Path :: ClientState ( ClientStatePath ( ClientId :: new_dummy( ) ) ) )
12931298 ) ;
12941299
12951300 let path = "clients/07-tendermint-0/consensusStates/15-31" ;
@@ -1298,7 +1303,7 @@ mod tests {
12981303 assert_eq ! (
12991304 parse_client_paths( & components) ,
13001305 Some ( Path :: ClientConsensusState ( ClientConsensusStatePath {
1301- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1306+ client_id: ClientId :: new_dummy ( ) ,
13021307 revision_number: 15 ,
13031308 revision_height: 31 ,
13041309 } ) )
@@ -1313,7 +1318,7 @@ mod tests {
13131318 assert_eq ! (
13141319 parse_client_paths( & components) ,
13151320 Some ( Path :: ClientUpdateTime ( ClientUpdateTimePath {
1316- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1321+ client_id: ClientId :: new_dummy ( ) ,
13171322 revision_number: 15 ,
13181323 revision_height: 31 ,
13191324 } ) )
@@ -1325,7 +1330,7 @@ mod tests {
13251330 assert_eq ! (
13261331 parse_client_paths( & components) ,
13271332 Some ( Path :: ClientUpdateHeight ( ClientUpdateHeightPath {
1328- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1333+ client_id: ClientId :: new_dummy ( ) ,
13291334 revision_number: 15 ,
13301335 revision_height: 31 ,
13311336 } ) )
0 commit comments