mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Update spec tests to v1.1.0-beta.4 (#2548)
## Proposed Changes
Bump the spec tests to beta.4, including the new randomised tests (which all pass 🎉)
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
use crate::{generic_public_key::GenericPublicKey, Error};
|
||||
use crate::{
|
||||
generic_public_key::{GenericPublicKey, TPublicKey},
|
||||
Error,
|
||||
};
|
||||
use std::fmt::{self, Debug};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
/// Implemented on some struct from a BLS library so it may be used internally in this crate.
|
||||
@@ -35,3 +39,13 @@ where
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<Pub, AggPub> Debug for GenericAggregatePublicKey<Pub, AggPub>
|
||||
where
|
||||
AggPub: TAggregatePublicKey<Pub>,
|
||||
Pub: TPublicKey,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{:?}", self.to_public_key())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,6 +194,20 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper for `fast_aggregate_verify` accepting `G2_POINT_AT_INFINITY` signature when
|
||||
/// `pubkeys` is empty.
|
||||
pub fn eth_fast_aggregate_verify(
|
||||
&self,
|
||||
msg: Hash256,
|
||||
pubkeys: &[&GenericPublicKey<Pub>],
|
||||
) -> bool {
|
||||
if pubkeys.is_empty() && self.is_infinity() {
|
||||
true
|
||||
} else {
|
||||
self.fast_aggregate_verify(msg, pubkeys)
|
||||
}
|
||||
}
|
||||
|
||||
/// Verify that `self` represents an aggregate signature where all `pubkeys` have signed their
|
||||
/// corresponding message in `msgs`.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user