Apply DKG TX handling code to all sign TXs

The existing code was almost entirely applicable. It just needed to be scoped
with an ID. While the handle function is now a bit convoluted, I don't see a
better option.
This commit is contained in:
Luke Parker
2023-04-20 06:27:00 -04:00
parent 8b5eaa8092
commit 9c2a44f9df
4 changed files with 138 additions and 50 deletions

View File

@@ -327,6 +327,13 @@ impl TransactionTrait for Transaction {
fn verify(&self) -> Result<(), TransactionError> {
// TODO: Augment with checks that the Vecs can be deser'd and are for recognized IDs
if let Transaction::BatchShare(data) = self {
if data.data.len() != 32 {
Err(TransactionError::InvalidContent)?;
}
}
Ok(())
}
}