mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 03:03:45 +00:00
Resolve into_attestation_and_indices todo
This commit is contained in:
@@ -105,12 +105,7 @@ impl<T: BeaconChainTypes> VerifiedAttestation<T> for VerifiedAggregate<T> {
|
|||||||
|
|
||||||
/// Efficient clone-free implementation that moves out of the `Box`.
|
/// Efficient clone-free implementation that moves out of the `Box`.
|
||||||
fn into_attestation_and_indices(self) -> (Attestation<T::EthSpec>, Vec<u64>) {
|
fn into_attestation_and_indices(self) -> (Attestation<T::EthSpec>, Vec<u64>) {
|
||||||
// TODO(electra): technically we shouldn't have to clone..
|
let attestation = self.signed_aggregate.into_attestation();
|
||||||
let attestation = self
|
|
||||||
.signed_aggregate
|
|
||||||
.message()
|
|
||||||
.aggregate()
|
|
||||||
.clone_as_attestation();
|
|
||||||
let attesting_indices = self.indexed_attestation.attesting_indices_to_vec();
|
let attesting_indices = self.indexed_attestation.attesting_indices_to_vec();
|
||||||
(attestation, attesting_indices)
|
(attestation, attesting_indices)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use super::{
|
|||||||
Signature, SignedRoot,
|
Signature, SignedRoot,
|
||||||
};
|
};
|
||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
|
use crate::Attestation;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
use superstruct::superstruct;
|
use superstruct::superstruct;
|
||||||
@@ -109,4 +110,11 @@ impl<E: EthSpec> SignedAggregateAndProof<E> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn into_attestation(self) -> Attestation<E> {
|
||||||
|
match self {
|
||||||
|
Self::Base(att) => Attestation::Base(att.message.aggregate),
|
||||||
|
Self::Electra(att) => Attestation::Electra(att.message.aggregate),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user