From 5f7a046b3c6cdd41682807b93f016406c3e1972d Mon Sep 17 00:00:00 2001 From: Akosh Farkash Date: Thu, 13 Jun 2024 14:22:53 +0100 Subject: [PATCH] BFT-457: Doc unique keys --- node/libs/roles/src/attester/messages/msg.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/libs/roles/src/attester/messages/msg.rs b/node/libs/roles/src/attester/messages/msg.rs index d498a615..2cc118ca 100644 --- a/node/libs/roles/src/attester/messages/msg.rs +++ b/node/libs/roles/src/attester/messages/msg.rs @@ -152,6 +152,8 @@ impl Committee { } /// Compute the sum of weights of as a list of public keys. + /// + /// The method assumes that the keys are unique and does not de-duplicate. pub fn weight_of_keys<'a>(&self, keys: impl Iterator) -> u64 { keys.filter_map(|pk| self.index(pk).map(|i| self.vec[i].weight)) .sum()