mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-30 11:13:34 +00:00
Merge remote-tracking branch 'origin/deneb-free-blobs' into tree-states
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
use crate::{DBColumn, Error, StoreItem};
|
||||
use ssz::{Decode, Encode};
|
||||
use types::{EthSpec, ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadMerge};
|
||||
use types::{
|
||||
BlobSidecarList, EthSpec, ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadDeneb,
|
||||
ExecutionPayloadMerge,
|
||||
};
|
||||
|
||||
macro_rules! impl_store_item {
|
||||
($ty_name:ident) => {
|
||||
@@ -21,6 +24,8 @@ macro_rules! impl_store_item {
|
||||
}
|
||||
impl_store_item!(ExecutionPayloadMerge);
|
||||
impl_store_item!(ExecutionPayloadCapella);
|
||||
impl_store_item!(ExecutionPayloadDeneb);
|
||||
impl_store_item!(BlobSidecarList);
|
||||
|
||||
/// This fork-agnostic implementation should be only used for writing.
|
||||
///
|
||||
@@ -36,9 +41,13 @@ impl<E: EthSpec> StoreItem for ExecutionPayload<E> {
|
||||
}
|
||||
|
||||
fn from_store_bytes(bytes: &[u8]) -> Result<Self, Error> {
|
||||
ExecutionPayloadCapella::from_ssz_bytes(bytes)
|
||||
.map(Self::Capella)
|
||||
.or_else(|_| ExecutionPayloadMerge::from_ssz_bytes(bytes).map(Self::Merge))
|
||||
ExecutionPayloadDeneb::from_ssz_bytes(bytes)
|
||||
.map(Self::Deneb)
|
||||
.or_else(|_| {
|
||||
ExecutionPayloadCapella::from_ssz_bytes(bytes)
|
||||
.map(Self::Capella)
|
||||
.or_else(|_| ExecutionPayloadMerge::from_ssz_bytes(bytes).map(Self::Merge))
|
||||
})
|
||||
.map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user