Add dedicated BatchSignId

This commit is contained in:
Luke Parker
2023-11-06 19:50:32 -05:00
parent 96f94966b7
commit c03fb6c71b
17 changed files with 112 additions and 116 deletions

View File

@@ -23,7 +23,7 @@ use serai_client::{
InInstructionsEvent,
},
};
use messages::{sign::SignId, SubstrateContext, CoordinatorMessage};
use messages::{coordinator::BatchSignId, SubstrateContext, CoordinatorMessage};
use crate::{*, tests::*};
@@ -33,10 +33,10 @@ pub async fn batch(
substrate_key: &Zeroizing<<Ristretto as Ciphersuite>::F>,
batch: Batch,
) -> u64 {
let mut id = [0; 32];
let mut id = [0; 5];
OsRng.fill_bytes(&mut id);
let id = SignId {
key: (<Ristretto as Ciphersuite>::generator() * **substrate_key).to_bytes().to_vec(),
let id = BatchSignId {
key: (<Ristretto as Ciphersuite>::generator() * **substrate_key).to_bytes(),
id,
attempt: 0,
};

View File

@@ -89,7 +89,7 @@ pub async fn key_gen<C: Ciphersuite>(
(
participant_is[usize::from(l)],
vec![
u8::try_from(u16::try_from(participant_is[i]).unwrap()).unwrap(),
u8::try_from(u16::from(participant_is[i])).unwrap(),
u8::try_from(u16::from(participant_is[usize::from(l)])).unwrap(),
],
)