From 6e76c28e907e67898a3f2b9c918e83f1a783c33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Mon, 18 Mar 2024 18:28:35 +0100 Subject: [PATCH] Clarification --- ferveo/src/refresh.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/ferveo/src/refresh.rs b/ferveo/src/refresh.rs index 4b2f2469..000241a0 100644 --- a/ferveo/src/refresh.rs +++ b/ferveo/src/refresh.rs @@ -582,15 +582,16 @@ mod tests_refresh { .collect::>(); // Each participant prepares an update for each other participant: - let share_updates = contexts + let share_updates_by_producer = contexts .iter() .map(|p| { - let share_updates = ShareUpdate::::create_refresh_updates( - domain_points_and_keys, - security_threshold as u32, - rng, - ); - (p.index as u32, share_updates) + let a_share_updates_map: HashMap> = + ShareUpdate::::create_refresh_updates( + domain_points_and_keys, + security_threshold as u32, + rng, + ); + (p.index as u32, a_share_updates_map) }) .collect::>(); @@ -599,10 +600,14 @@ mod tests_refresh { .iter() .map(|p| { // Current participant receives updates from other participants - let updates_for_participant: Vec<_> = share_updates + let updates_for_participant: Vec<_> = share_updates_by_producer .values() - .map(|updates| { - updates.get(&(p.index as u32)).cloned().unwrap() + .map(|updates_from_producer| { + let update_for_participant = updates_from_producer + .get(&(p.index as u32)) + .cloned() + .unwrap(); + update_for_participant }) .collect();