From dcfae6c5cfc0ac8a1e4ce2ad04fc1d34da759bcd Mon Sep 17 00:00:00 2001 From: Daniel Knopik Date: Sat, 17 Sep 2022 13:29:20 +0200 Subject: [PATCH] implement From for Payload --- beacon_node/beacon_chain/src/beacon_chain.rs | 3 ++- consensus/types/src/payload.rs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 39b2279c4..7418a66c1 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -99,6 +99,7 @@ use types::*; pub use crate::canonical_head::{CanonicalHead, CanonicalHeadRwLock}; pub use fork_choice::CountUnrealized; +use types::kzg_commitment::KzgCommitment; pub type ForkChoiceError = fork_choice::Error; @@ -3627,7 +3628,7 @@ impl BeaconChain { .ok_or(BlockProductionError::MissingSyncAggregate)?, execution_payload: execution_payload .ok_or(BlockProductionError::MissingExecutionPayload)?, - blob_kzg_commitments: todo!(), // part of partial block or?? + blob_kzg_commitments: blob_kzg_commitments.into(), }, }), }; diff --git a/consensus/types/src/payload.rs b/consensus/types/src/payload.rs index 134fe3815..7974c5ef3 100644 --- a/consensus/types/src/payload.rs +++ b/consensus/types/src/payload.rs @@ -32,6 +32,7 @@ pub trait ExecPayload: + Hash + TryFrom> + From> + + From> + Send + 'static { @@ -172,6 +173,12 @@ impl From> for BlindedPayload { } } +impl From> for BlindedPayload { + fn from(full_payload: FullPayload) -> Self { + full_payload.execution_payload.into() + } +} + impl TreeHash for BlindedPayload { fn tree_hash_type() -> tree_hash::TreeHashType { >::tree_hash_type()