aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/fold.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/federation/fold.rs')
-rw-r--r--src/federation/fold.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/federation/fold.rs b/src/federation/fold.rs
index 46dad27..dbe8d4f 100644
--- a/src/federation/fold.rs
+++ b/src/federation/fold.rs
@@ -221,6 +221,22 @@ impl State {
self.latest(&candidates)
}
+ /// The keys that sign for `party` by `current`, whatever they sign: those its version
+ /// names, and those of its key set as it counts; none where it is no party of it.
+ pub(crate) fn signing_keys(&self, party: &str, current: &Version) -> Vec<String> {
+ let mut keys = current
+ .parties
+ .get(party)
+ .map(|given| given.keys.clone())
+ .unwrap_or_default();
+ for key in self.keys_of(party, current) {
+ if !keys.contains(&key) {
+ keys.push(key);
+ }
+ }
+ keys
+ }
+
/// The keys of `party` by `current`: those of its key set, or those its version names.
pub(crate) fn keys_of(&self, party: &str, current: &Version) -> Vec<String> {
let Some(given) = current.parties.get(party) else {