Use an actual, cryptographically-binding ID for batches in SignId

The intent system expected one.
This commit is contained in:
Luke Parker
2023-08-24 18:44:09 -04:00
parent 61418b4e9f
commit 67109c648c
2 changed files with 49 additions and 18 deletions

View File

@@ -25,11 +25,9 @@ async fn test_substrate_signer() {
let participant_one = Participant::new(1).unwrap();
let id: u32 = 5;
let mut id_arr = [0u8; 32];
id_arr[.. 4].copy_from_slice(&id.to_le_bytes());
let block = BlockHash([0xaa; 32]);
let actual_id =
SignId { key: keys[&participant_one].group_key().to_bytes().to_vec(), id: id_arr, attempt: 0 };
let mut actual_id =
SignId { key: keys[&participant_one].group_key().to_bytes().to_vec(), id: [0; 32], attempt: 0 };
let batch = Batch {
network: NetworkId::Monero,
@@ -88,6 +86,9 @@ async fn test_substrate_signer() {
preprocess,
}) = signers.get_mut(&i).unwrap().events.pop_front().unwrap()
{
if actual_id.id == [0; 32] {
actual_id.id = id.id;
}
assert_eq!(id, actual_id);
assert_eq!(batch_block, block);
if signing_set.contains(&i) {