Tidy validation signatures
This commit is contained in:
parent
26537c1184
commit
c55b94053b
@ -18,11 +18,12 @@ pub enum SignatureVerificationError {
|
||||
DBError(String),
|
||||
}
|
||||
|
||||
fn verify_aggregate_signature_for_indices<T>(message: &[u8],
|
||||
agg_sig: &AggregateSignature,
|
||||
attestation_indices: &[usize],
|
||||
bitfield: &Bitfield,
|
||||
validator_store: &ValidatorStore<T>)
|
||||
pub fn verify_aggregate_signature_for_indices<T>(
|
||||
message: &[u8],
|
||||
agg_sig: &AggregateSignature,
|
||||
attestation_indices: &[usize],
|
||||
bitfield: &Bitfield,
|
||||
validator_store: &ValidatorStore<T>)
|
||||
-> Result<(bool, Option<HashSet<usize>>), SignatureVerificationError>
|
||||
where T: ClientDB + Sized
|
||||
{
|
||||
@ -68,6 +69,15 @@ mod tests {
|
||||
use super::super::db::MemoryDB;
|
||||
use std::sync::Arc;
|
||||
|
||||
/*
|
||||
* Cases that still need testing:
|
||||
*
|
||||
* - No signatures.
|
||||
* - Database failure.
|
||||
* - Unknown validator index.
|
||||
* - Extra validator on signature.
|
||||
*/
|
||||
|
||||
#[test]
|
||||
fn test_signature_verification() {
|
||||
let message = "cats".as_bytes();
|
||||
|
Loading…
Reference in New Issue
Block a user