mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
heze boilerplate
This commit is contained in:
@@ -265,7 +265,8 @@ mod tests {
|
||||
use bls::{FixedBytesExtended, Signature};
|
||||
use std::sync::Arc;
|
||||
use types::{
|
||||
BeaconBlockHeader, DataColumnSidecarFulu, DataColumnSidecarGloas, ForkName, MainnetEthSpec,
|
||||
BeaconBlockHeader, DataColumnSidecarFulu, DataColumnSidecarGloas, DataColumnSidecarHeze,
|
||||
ForkName, MainnetEthSpec,
|
||||
SignedBeaconBlockHeader,
|
||||
};
|
||||
|
||||
@@ -320,13 +321,31 @@ mod tests {
|
||||
}))
|
||||
}
|
||||
|
||||
/// Creates a Heze DataColumnSidecar for testing.
|
||||
/// Keyed by (beacon_block_root, slot) in the observation cache.
|
||||
fn get_data_column_sidecar_heze(
|
||||
slot: u64,
|
||||
beacon_block_root: Hash256,
|
||||
index: u64,
|
||||
) -> Arc<DataColumnSidecar<E>> {
|
||||
Arc::new(DataColumnSidecar::Heze(DataColumnSidecarHeze {
|
||||
index,
|
||||
column: vec![].try_into().unwrap(),
|
||||
kzg_proofs: vec![].try_into().unwrap(),
|
||||
slot: slot.into(),
|
||||
beacon_block_root,
|
||||
}))
|
||||
}
|
||||
|
||||
fn get_sidecar(
|
||||
slot: u64,
|
||||
key: u64,
|
||||
index: u64,
|
||||
fork_name: ForkName,
|
||||
) -> Arc<DataColumnSidecar<E>> {
|
||||
if fork_name.gloas_enabled() {
|
||||
if fork_name.heze_enabled() {
|
||||
get_data_column_sidecar_heze(slot, Hash256::from_low_u64_be(key), index)
|
||||
} else if fork_name.gloas_enabled() {
|
||||
get_data_column_sidecar_gloas(slot, Hash256::from_low_u64_be(key), index)
|
||||
} else {
|
||||
get_data_column_sidecar_fulu(slot, key, index)
|
||||
|
||||
Reference in New Issue
Block a user