implement From<FullPayload> for Payload
This commit is contained in:
parent
fe6be28e6b
commit
dcfae6c5cf
@ -99,6 +99,7 @@ use types::*;
|
|||||||
|
|
||||||
pub use crate::canonical_head::{CanonicalHead, CanonicalHeadRwLock};
|
pub use crate::canonical_head::{CanonicalHead, CanonicalHeadRwLock};
|
||||||
pub use fork_choice::CountUnrealized;
|
pub use fork_choice::CountUnrealized;
|
||||||
|
use types::kzg_commitment::KzgCommitment;
|
||||||
|
|
||||||
pub type ForkChoiceError = fork_choice::Error<crate::ForkChoiceStoreError>;
|
pub type ForkChoiceError = fork_choice::Error<crate::ForkChoiceStoreError>;
|
||||||
|
|
||||||
@ -3627,7 +3628,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
.ok_or(BlockProductionError::MissingSyncAggregate)?,
|
.ok_or(BlockProductionError::MissingSyncAggregate)?,
|
||||||
execution_payload: execution_payload
|
execution_payload: execution_payload
|
||||||
.ok_or(BlockProductionError::MissingExecutionPayload)?,
|
.ok_or(BlockProductionError::MissingExecutionPayload)?,
|
||||||
blob_kzg_commitments: todo!(), // part of partial block or??
|
blob_kzg_commitments: blob_kzg_commitments.into(),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
@ -32,6 +32,7 @@ pub trait ExecPayload<T: EthSpec>:
|
|||||||
+ Hash
|
+ Hash
|
||||||
+ TryFrom<ExecutionPayloadHeader<T>>
|
+ TryFrom<ExecutionPayloadHeader<T>>
|
||||||
+ From<ExecutionPayload<T>>
|
+ From<ExecutionPayload<T>>
|
||||||
|
+ From<FullPayload<T>>
|
||||||
+ Send
|
+ Send
|
||||||
+ 'static
|
+ 'static
|
||||||
{
|
{
|
||||||
@ -172,6 +173,12 @@ impl<T: EthSpec> From<ExecutionPayload<T>> for BlindedPayload<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: EthSpec> From<FullPayload<T>> for BlindedPayload<T> {
|
||||||
|
fn from(full_payload: FullPayload<T>) -> Self {
|
||||||
|
full_payload.execution_payload.into()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: EthSpec> TreeHash for BlindedPayload<T> {
|
impl<T: EthSpec> TreeHash for BlindedPayload<T> {
|
||||||
fn tree_hash_type() -> tree_hash::TreeHashType {
|
fn tree_hash_type() -> tree_hash::TreeHashType {
|
||||||
<ExecutionPayloadHeader<T>>::tree_hash_type()
|
<ExecutionPayloadHeader<T>>::tree_hash_type()
|
||||||
|
Loading…
Reference in New Issue
Block a user