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

@@ -26,7 +26,7 @@ rand_core = { version = "0.6", default-features = false }
blake2 = "0.10"
ciphersuite = { path = "../../crypto/ciphersuite", default-features = false, features = ["ristretto", "secp256k1"] }
schnorrkel = "0.11"
dkg = { path = "../../crypto/dkg", default-features = false, features = ["tests"] }
dkg = { path = "../../crypto/dkg", default-features = false }
messages = { package = "serai-processor-messages", path = "../../processor/messages" }

View File

@@ -24,7 +24,7 @@ rand_core = { version = "0.6", default-features = false, features = ["getrandom"
curve25519-dalek = "4"
ciphersuite = { path = "../../crypto/ciphersuite", default-features = false, features = ["secp256k1", "ristretto"] }
dkg = { path = "../../crypto/dkg", default-features = false, features = ["tests"] }
dkg = { path = "../../crypto/dkg", default-features = false }
bitcoin-serai = { path = "../../networks/bitcoin" }

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};