@@ -1169,7 +1169,13 @@ fn parse_upgrades(components: &[&str]) -> Option<Path> {
1169
1169
#[ cfg( test) ]
1170
1170
mod tests {
1171
1171
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
+ }
1173
1179
#[ rstest:: rstest]
1174
1180
#[ case( NEXT_CLIENT_SEQUENCE , Path :: NextClientSequence ( NextClientSequencePath ) ) ]
1175
1181
#[ case(
@@ -1182,34 +1188,35 @@ mod tests {
1182
1188
) ]
1183
1189
#[ case(
1184
1190
"clients/07-tendermint-0/clientState" ,
1185
- Path :: ClientState ( ClientStatePath ( DEFAULT_CLIENT_ID . into( ) ) ) ) ]
1191
+ Path :: ClientState ( ClientStatePath ( ClientId :: new_dummy( ) ) )
1192
+ ) ]
1186
1193
#[ case(
1187
1194
"clients/07-tendermint-0/consensusStates/15-31" ,
1188
1195
Path :: ClientConsensusState ( ClientConsensusStatePath {
1189
- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1196
+ client_id: ClientId :: new_dummy ( ) ,
1190
1197
revision_number: 15 ,
1191
1198
revision_height: 31 ,
1192
1199
} )
1193
1200
) ]
1194
1201
#[ case(
1195
1202
"clients/07-tendermint-0/consensusStates/15-31/processedTime" ,
1196
1203
Path :: ClientUpdateTime ( ClientUpdateTimePath {
1197
- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1204
+ client_id: ClientId :: new_dummy ( ) ,
1198
1205
revision_number: 15 ,
1199
1206
revision_height: 31 ,
1200
1207
} )
1201
1208
) ]
1202
1209
#[ case(
1203
1210
"clients/07-tendermint-0/consensusStates/15-31/processedHeight" ,
1204
1211
Path :: ClientUpdateHeight ( ClientUpdateHeightPath {
1205
- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1212
+ client_id: ClientId :: new_dummy ( ) ,
1206
1213
revision_number: 15 ,
1207
1214
revision_height: 31 ,
1208
1215
} )
1209
1216
) ]
1210
1217
#[ case(
1211
1218
"clients/07-tendermint-0/connections" ,
1212
- Path :: ClientConnection ( ClientConnectionPath ( "07-tendermint-0" . into ( ) ) )
1219
+ Path :: ClientConnection ( ClientConnectionPath ( ClientId :: new_dummy ( ) ) )
1213
1220
) ]
1214
1221
#[ case(
1215
1222
"connections/connection-0" ,
@@ -1287,9 +1294,7 @@ mod tests {
1287
1294
1288
1295
assert_eq ! (
1289
1296
parse_client_paths( & components) ,
1290
- Some ( Path :: ClientState ( ClientStatePath ( ClientId :: from(
1291
- DEFAULT_CLIENT_ID
1292
- ) ) ) )
1297
+ Some ( Path :: ClientState ( ClientStatePath ( ClientId :: new_dummy( ) ) ) )
1293
1298
) ;
1294
1299
1295
1300
let path = "clients/07-tendermint-0/consensusStates/15-31" ;
@@ -1298,7 +1303,7 @@ mod tests {
1298
1303
assert_eq ! (
1299
1304
parse_client_paths( & components) ,
1300
1305
Some ( Path :: ClientConsensusState ( ClientConsensusStatePath {
1301
- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1306
+ client_id: ClientId :: new_dummy ( ) ,
1302
1307
revision_number: 15 ,
1303
1308
revision_height: 31 ,
1304
1309
} ) )
@@ -1313,7 +1318,7 @@ mod tests {
1313
1318
assert_eq ! (
1314
1319
parse_client_paths( & components) ,
1315
1320
Some ( Path :: ClientUpdateTime ( ClientUpdateTimePath {
1316
- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1321
+ client_id: ClientId :: new_dummy ( ) ,
1317
1322
revision_number: 15 ,
1318
1323
revision_height: 31 ,
1319
1324
} ) )
@@ -1325,7 +1330,7 @@ mod tests {
1325
1330
assert_eq ! (
1326
1331
parse_client_paths( & components) ,
1327
1332
Some ( Path :: ClientUpdateHeight ( ClientUpdateHeightPath {
1328
- client_id: DEFAULT_CLIENT_ID . into ( ) ,
1333
+ client_id: ClientId :: new_dummy ( ) ,
1329
1334
revision_number: 15 ,
1330
1335
revision_height: 31 ,
1331
1336
} ) )
0 commit comments