mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
Update everything which uses dkg to the new APIs
This commit is contained in:
@@ -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" }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::{
|
||||
time::{SystemTime, Duration},
|
||||
};
|
||||
|
||||
use dkg::{Participant, tests::clone_without};
|
||||
use dkg::Participant;
|
||||
|
||||
use messages::{coordinator::*, SubstrateContext};
|
||||
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::{
|
||||
time::{SystemTime, Duration},
|
||||
};
|
||||
|
||||
use dkg::{Participant, tests::clone_without};
|
||||
use dkg::Participant;
|
||||
|
||||
use messages::{sign::SignId, SubstrateContext};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user