mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
WIP faster attestation packing
This commit is contained in:
@@ -39,14 +39,18 @@ impl<'a, T: EthSpec> AttesterSlashingMaxCover<'a, T> {
|
||||
impl<'a, T: EthSpec> MaxCover for AttesterSlashingMaxCover<'a, T> {
|
||||
/// The result type, of which we would eventually like a collection of maximal quality.
|
||||
type Object = AttesterSlashing<T>;
|
||||
type Intermediate = AttesterSlashing<T>;
|
||||
/// The type used to represent sets.
|
||||
type Set = HashMap<u64, u64>;
|
||||
|
||||
/// Extract an object for inclusion in a solution.
|
||||
fn object(&self) -> &AttesterSlashing<T> {
|
||||
fn intermediate(&self) -> &AttesterSlashing<T> {
|
||||
self.slashing
|
||||
}
|
||||
|
||||
fn convert_to_object(slashing: &AttesterSlashing<T>) -> AttesterSlashing<T> {
|
||||
slashing.clone()
|
||||
}
|
||||
|
||||
/// Get the set of elements covered.
|
||||
fn covering_set(&self) -> &HashMap<u64, u64> {
|
||||
&self.effective_balances
|
||||
|
||||
Reference in New Issue
Block a user