Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

secret-store fix warning in tests #9074

Merged
merged 1 commit into from
Jul 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions secret_store/src/key_server_cluster/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,13 @@ pub mod tests {
let publics: Vec<_> = (0..n).map(|i| public_values_generation(t, &derived_point, &polynoms1[i], &polynoms2[i]).unwrap()).collect();

// keys verification
(0..n).map(|i| (0..n).map(|j| if i != j {
assert!(keys_verification(t, &derived_point, &id_numbers[i], &secrets1[j][i], &secrets2[j][i], &publics[j]).unwrap());
}).collect::<Vec<_>>()).collect::<Vec<_>>();
(0..n).for_each(|i| {
(0..n)
.filter(|&j| i != j)
.for_each(|j| {
assert!(keys_verification(t, &derived_point, &id_numbers[i], &secrets1[j][i], &secrets2[j][i], &publics[j]).unwrap());
})
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would find nested for loops easier to read, i.e.

for i in 0 .. n {
	for j in 0 .. n {
		if i != j {
			...
		}
	}
}


// data, generated during keys generation
let public_shares: Vec<_> = (0..n).map(|i| compute_public_share(&polynoms1[i][0]).unwrap()).collect();
Expand Down