Correct the coordinator tests

They weren't updated with the past couple of commits.
This commit is contained in:
Luke Parker
2023-09-29 04:35:00 -04:00
parent bd5491dfd5
commit aa59f53ead
4 changed files with 21 additions and 4 deletions

View File

@@ -7,10 +7,15 @@ use std::{
use zeroize::Zeroizing;
use rand_core::{RngCore, OsRng};
use blake2::{
digest::{consts::U32, Digest},
Blake2b,
};
use ciphersuite::{group::GroupEncoding, Ciphersuite, Ristretto, Secp256k1};
use dkg::Participant;
use scale::Encode;
use serai_client::{
primitives::{NetworkId, BlockHash, Signature},
in_instructions::{
@@ -35,6 +40,12 @@ pub async fn batch(
attempt: 0,
};
for processor in processors.iter_mut() {
processor
.send_message(messages::substrate::ProcessorMessage::Batch { batch: batch.clone() })
.await;
}
// Select a random participant to exclude, so we know for sure who *is* participating
assert_eq!(COORDINATORS - THRESHOLD, 1);
let excluded_signer =
@@ -168,7 +179,7 @@ pub async fn batch(
for processor in processors.iter_mut() {
processor
.send_message(messages::substrate::ProcessorMessage::Update { batch: batch.clone() })
.send_message(messages::substrate::ProcessorMessage::SignedBatch { batch: batch.clone() })
.await;
}
@@ -194,7 +205,8 @@ pub async fn batch(
InInstructionsEvent::Batch {
network: batch.batch.network,
id: batch.batch.id,
block: batch.batch.block
block: batch.batch.block,
instructions_hash: Blake2b::<U32>::digest(batch.batch.instructions.encode()).into(),
}
);
break 'outer;