mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 20:02:43 +00:00
Merge pull request #5975 from michaelsproul/electra-slasher-no-migration
Avoid changing slasher schema for Electra
This commit is contained in:
@@ -240,38 +240,6 @@ mod quoted_variable_list_u64 {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Encode, Decode, PartialEq)]
|
||||
#[ssz(enum_behaviour = "union")]
|
||||
pub enum IndexedAttestationOnDisk<E: EthSpec> {
|
||||
Base(IndexedAttestationBase<E>),
|
||||
Electra(IndexedAttestationElectra<E>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Encode, PartialEq)]
|
||||
#[ssz(enum_behaviour = "union")]
|
||||
pub enum IndexedAttestationRefOnDisk<'a, E: EthSpec> {
|
||||
Base(&'a IndexedAttestationBase<E>),
|
||||
Electra(&'a IndexedAttestationElectra<E>),
|
||||
}
|
||||
|
||||
impl<'a, E: EthSpec> From<&'a IndexedAttestation<E>> for IndexedAttestationRefOnDisk<'a, E> {
|
||||
fn from(attestation: &'a IndexedAttestation<E>) -> Self {
|
||||
match attestation {
|
||||
IndexedAttestation::Base(attestation) => Self::Base(attestation),
|
||||
IndexedAttestation::Electra(attestation) => Self::Electra(attestation),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> From<IndexedAttestationOnDisk<E>> for IndexedAttestation<E> {
|
||||
fn from(attestation: IndexedAttestationOnDisk<E>) -> Self {
|
||||
match attestation {
|
||||
IndexedAttestationOnDisk::Base(attestation) => Self::Base(attestation),
|
||||
IndexedAttestationOnDisk::Electra(attestation) => Self::Electra(attestation),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -176,8 +176,7 @@ pub use crate::fork_versioned_response::{ForkVersionDeserialize, ForkVersionedRe
|
||||
pub use crate::graffiti::{Graffiti, GRAFFITI_BYTES_LEN};
|
||||
pub use crate::historical_batch::HistoricalBatch;
|
||||
pub use crate::indexed_attestation::{
|
||||
IndexedAttestation, IndexedAttestationBase, IndexedAttestationElectra,
|
||||
IndexedAttestationOnDisk, IndexedAttestationRef, IndexedAttestationRefOnDisk,
|
||||
IndexedAttestation, IndexedAttestationBase, IndexedAttestationElectra, IndexedAttestationRef,
|
||||
};
|
||||
pub use crate::light_client_bootstrap::{
|
||||
LightClientBootstrap, LightClientBootstrapAltair, LightClientBootstrapCapella,
|
||||
|
||||
Reference in New Issue
Block a user