Skip to content

Commit 760caac

Browse files
committed
chore: fix path in backup test
1 parent eb9abdb commit 760caac

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

core/service/src/client/tests/threshold/crs_gen_tests.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cfg_if::cfg_if! {
1414
use kms_grpc::RequestId;
1515
use serial_test::serial;
1616
use std::collections::HashMap;
17+
use std::path::Path;
1718
use std::sync::Arc;
1819
use threshold_execution::tfhe_internals::parameters::DKGParams;
1920
use tokio::task::JoinSet;
@@ -104,6 +105,7 @@ pub(crate) async fn crs_gen(
104105
insecure,
105106
&cur_id,
106107
max_bits,
108+
None,
107109
)
108110
.await;
109111
}
@@ -124,6 +126,7 @@ pub(crate) async fn crs_gen(
124126
insecure,
125127
&cur_id,
126128
max_bits,
129+
None,
127130
)
128131
.await;
129132
}
@@ -139,6 +142,7 @@ pub async fn run_crs(
139142
insecure: bool,
140143
crs_req_id: &RequestId,
141144
max_bits: Option<u32>,
145+
test_path: Option<&Path>,
142146
) -> Vec<CrsInfo> {
143147
let dkg_param: WrappedDKGParams = parameter.into();
144148
let domain = dummy_domain();
@@ -150,7 +154,14 @@ pub async fn run_crs(
150154
for response in responses {
151155
response.unwrap();
152156
}
153-
wait_for_crsgen_result(&vec![crs_req], kms_clients, internal_client, &dkg_param).await
157+
wait_for_crsgen_result(
158+
&vec![crs_req],
159+
kms_clients,
160+
internal_client,
161+
&dkg_param,
162+
test_path,
163+
)
164+
.await
154165
}
155166

156167
#[cfg(any(feature = "slow_tests", feature = "insecure"))]
@@ -198,6 +209,7 @@ pub async fn wait_for_crsgen_result(
198209
kms_clients: &HashMap<u32, CoreServiceEndpointClient<Channel>>,
199210
internal_client: &Client,
200211
param: &DKGParams,
212+
test_path: Option<&Path>,
201213
) -> Vec<CrsInfo> {
202214
let amount_parties = kms_clients.len();
203215
// wait a bit for the crs generation to finish
@@ -238,7 +250,7 @@ pub async fn wait_for_crsgen_result(
238250
.map(|(i, res)| {
239251
(res, {
240252
let prefix = PUBLIC_STORAGE_PREFIX_THRESHOLD_ALL[i as usize - 1].as_deref();
241-
FileStorage::new(None, StorageType::PUB, prefix).unwrap()
253+
FileStorage::new(test_path, StorageType::PUB, prefix).unwrap()
242254
})
243255
})
244256
.collect_vec();

core/service/src/client/tests/threshold/custodian_backup_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ async fn backup_after_crs(amount_custodians: usize, threshold: u32) {
193193
true,
194194
&crs_req,
195195
Some(16),
196+
test_path,
196197
)
197198
.await;
198199

core/service/src/client/tests/threshold/mpc_epoch_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ pub(crate) async fn new_epoch_with_reshare_and_crs(
230230
false,
231231
crs_id,
232232
Some(2048),
233+
None,
233234
)
234235
.await;
235236
assert_eq!(crs.len(), 1);

core/service/src/client/tests/threshold/restore_from_backup_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ async fn test_insecure_threshold_crs_backup() {
284284
true, // insecure execution
285285
&req_id,
286286
Some(16),
287+
None,
287288
)
288289
.await;
289290
// Generated crs, delete it from private storage

0 commit comments

Comments
 (0)