Update everything which uses dkg to the new APIs

This commit is contained in:
Luke Parker
2025-08-18 02:21:31 -04:00
parent b6edc94bcd
commit 72e80c1a3d
11 changed files with 29 additions and 14 deletions

View File

@@ -3,7 +3,7 @@ use std::{
time::{SystemTime, Duration},
};
use dkg::{Participant, tests::clone_without};
use dkg::Participant;
use messages::{coordinator::*, SubstrateContext};

View File

@@ -1,6 +1,6 @@
use std::{collections::HashMap, time::SystemTime};
use dkg::{Participant, ThresholdParams, tests::clone_without};
use dkg::{Participant, ThresholdParams};
use serai_client::{
primitives::{BlockHash, PublicKey, EXTERNAL_NETWORKS},

View File

@@ -15,6 +15,15 @@ mod send;
pub(crate) const COORDINATORS: usize = 4;
pub(crate) const THRESHOLD: usize = ((COORDINATORS * 2) / 3) + 1;
fn clone_without<K: Clone + core::cmp::Eq + core::hash::Hash, V: Clone>(
map: &HashMap<K, V>,
without: &K,
) -> HashMap<K, V> {
let mut res = map.clone();
res.remove(without).unwrap();
res
}
fn new_test(
network: ExternalNetworkId,
) -> (Vec<(Handles, <Ristretto as Ciphersuite>::F)>, DockerTest) {

View File

@@ -3,7 +3,7 @@ use std::{
time::{SystemTime, Duration},
};
use dkg::{Participant, tests::clone_without};
use dkg::Participant;
use messages::{sign::SignId, SubstrateContext};