@@ -132,13 +132,12 @@ mod tests {
132132 use crate :: assets:: cleanup:: EpochData ;
133133 use crate :: assets:: cleanup:: { delete_stale_triples_and_presignatures, get_epoch_data} ;
134134 use crate :: assets:: test_utils;
135- use crate :: assets:: test_utils:: TestContext ;
136- use crate :: assets:: test_utils:: get_participant_ids;
137- use crate :: assets:: test_utils:: make_triple;
138- use crate :: assets:: test_utils:: random_verifying_key;
139- use crate :: assets:: test_utils:: triple_v2_key;
135+ use crate :: assets:: test_utils:: {
136+ TestContext , get_participant_ids, make_triple, random_verifying_key, triple_v2_key,
137+ } ;
140138 use crate :: db:: EPOCH_ID_KEY ;
141139 use crate :: db:: { DBCol , SecretDB } ;
140+ use crate :: network:: testing:: new_test_client;
142141 use crate :: primitives:: UniqueId ;
143142 use crate :: providers:: ecdsa:: triple:: TripleStorage ;
144143 use mpc_primitives:: domain:: DomainId ;
@@ -241,17 +240,13 @@ mod tests {
241240 let ( mut start_data, my_participant_id, reconstruction_threshold) =
242241 test_utils:: gen_four_participants ( ) ;
243242 let all_participants = get_participant_ids ( start_data. clone ( ) ) ;
244- let alive_participants = Arc :: new ( Mutex :: new ( all_participants. clone ( ) ) ) ;
245243 let dir = tempfile:: tempdir ( ) . unwrap ( ) ;
246244 let db = SecretDB :: new ( dir. path ( ) , [ 1 ; 16 ] ) . unwrap ( ) ;
245+ let client = new_test_client ( all_participants. clone ( ) , my_participant_id) ;
247246 let triple_store = TripleStorage :: new (
248247 FakeClock :: default ( ) . clock ( ) ,
249248 db. clone ( ) ,
250- my_participant_id,
251- {
252- let alive = alive_participants. clone ( ) ;
253- Arc :: new ( move || alive. lock ( ) . unwrap ( ) . clone ( ) )
254- } ,
249+ client,
255250 reconstruction_threshold,
256251 )
257252 . unwrap ( ) ;
@@ -310,17 +305,13 @@ mod tests {
310305 . take ( all_participants. len ( ) - 1 )
311306 . copied ( )
312307 . collect ( ) ;
313- let alive_participants = Arc :: new ( Mutex :: new ( all_participants. clone ( ) ) ) ;
314308 let dir = tempfile:: tempdir ( ) . unwrap ( ) ;
315309 let db = SecretDB :: new ( dir. path ( ) , [ 1 ; 16 ] ) . unwrap ( ) ;
310+ let client = new_test_client ( all_participants. clone ( ) , my_participant_id) ;
316311 let triple_store = TripleStorage :: new (
317312 FakeClock :: default ( ) . clock ( ) ,
318313 db. clone ( ) ,
319- my_participant_id,
320- {
321- let alive = alive_participants. clone ( ) ;
322- Arc :: new ( move || alive. lock ( ) . unwrap ( ) . clone ( ) )
323- } ,
314+ client,
324315 reconstruction_threshold,
325316 )
326317 . unwrap ( ) ;
@@ -369,17 +360,13 @@ mod tests {
369360 . iter ( )
370361 . find ( |p| * * p != my_participant_id)
371362 . unwrap ( ) ;
372- let alive_participants = Arc :: new ( Mutex :: new ( all_participants. clone ( ) ) ) ;
373363 let dir = tempfile:: tempdir ( ) . unwrap ( ) ;
374364 let db = SecretDB :: new ( dir. path ( ) , [ 1 ; 16 ] ) . unwrap ( ) ;
365+ let client = new_test_client ( all_participants. clone ( ) , my_participant_id) ;
375366 let triple_store = TripleStorage :: new (
376367 FakeClock :: default ( ) . clock ( ) ,
377368 db. clone ( ) ,
378- my_participant_id,
379- {
380- let alive = alive_participants. clone ( ) ;
381- Arc :: new ( move || alive. lock ( ) . unwrap ( ) . clone ( ) )
382- } ,
369+ client,
383370 reconstruction_threshold,
384371 )
385372 . unwrap ( ) ;
0 commit comments