Skip to content

Commit 24780bc

Browse files
committed
Clone-friendly KeyStore
1 parent eba5efd commit 24780bc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

timeboost-types/src/decryption.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl<const N: usize> From<KeyStore> for KeyStoreVec<N> {
287287
#[derive(Debug, Clone)]
288288
pub struct KeyStore {
289289
committee: Committee,
290-
keys: BTreeMap<KeyId, DkgEncKey>,
290+
keys: Arc<BTreeMap<KeyId, DkgEncKey>>,
291291
}
292292

293293
impl KeyStore {
@@ -298,10 +298,11 @@ impl KeyStore {
298298
{
299299
let this = Self {
300300
committee: c,
301-
keys: keys
302-
.into_iter()
303-
.map(|(i, k)| (i.into(), k))
304-
.collect::<BTreeMap<_, _>>(),
301+
keys: Arc::new(
302+
keys.into_iter()
303+
.map(|(i, k)| (i.into(), k))
304+
.collect::<BTreeMap<_, _>>(),
305+
),
305306
};
306307

307308
// basic sanity check

0 commit comments

Comments
 (0)