mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
heze boilerplate
This commit is contained in:
@@ -22,7 +22,7 @@ use types::{
|
||||
LightClientOptimisticUpdate, LightClientUpdate, SignedBeaconBlock, SignedBeaconBlockAltair,
|
||||
SignedBeaconBlockBase, SignedBeaconBlockBellatrix, SignedBeaconBlockCapella,
|
||||
SignedBeaconBlockDeneb, SignedBeaconBlockElectra, SignedBeaconBlockFulu,
|
||||
SignedBeaconBlockGloas,
|
||||
SignedBeaconBlockGloas, SignedBeaconBlockHeze,
|
||||
};
|
||||
use unsigned_varint::codec::Uvi;
|
||||
|
||||
@@ -896,6 +896,9 @@ fn handle_rpc_response<E: EthSpec>(
|
||||
Some(ForkName::Gloas) => Ok(Some(RpcSuccessResponse::BlocksByRange(Arc::new(
|
||||
SignedBeaconBlock::Gloas(SignedBeaconBlockGloas::from_ssz_bytes(decoded_buffer)?),
|
||||
)))),
|
||||
Some(ForkName::Heze) => Ok(Some(RpcSuccessResponse::BlocksByRange(Arc::new(
|
||||
SignedBeaconBlock::Heze(SignedBeaconBlockHeze::from_ssz_bytes(decoded_buffer)?),
|
||||
)))),
|
||||
None => Err(RPCError::ErrorResponse(
|
||||
RpcErrorResponse::InvalidRequest,
|
||||
format!(
|
||||
@@ -935,6 +938,9 @@ fn handle_rpc_response<E: EthSpec>(
|
||||
Some(ForkName::Gloas) => Ok(Some(RpcSuccessResponse::BlocksByRoot(Arc::new(
|
||||
SignedBeaconBlock::Gloas(SignedBeaconBlockGloas::from_ssz_bytes(decoded_buffer)?),
|
||||
)))),
|
||||
Some(ForkName::Heze) => Ok(Some(RpcSuccessResponse::BlocksByRoot(Arc::new(
|
||||
SignedBeaconBlock::Heze(SignedBeaconBlockHeze::from_ssz_bytes(decoded_buffer)?),
|
||||
)))),
|
||||
None => Err(RPCError::ErrorResponse(
|
||||
RpcErrorResponse::InvalidRequest,
|
||||
format!(
|
||||
@@ -992,6 +998,7 @@ mod tests {
|
||||
chain_spec.electra_fork_epoch = Some(Epoch::new(5));
|
||||
chain_spec.fulu_fork_epoch = Some(Epoch::new(6));
|
||||
chain_spec.gloas_fork_epoch = Some(Epoch::new(7));
|
||||
chain_spec.heze_fork_epoch = Some(Epoch::new(8));
|
||||
|
||||
// check that we have all forks covered
|
||||
assert!(chain_spec.fork_epoch(ForkName::latest()).is_some());
|
||||
@@ -1008,6 +1015,7 @@ mod tests {
|
||||
ForkName::Electra => spec.electra_fork_epoch,
|
||||
ForkName::Fulu => spec.fulu_fork_epoch,
|
||||
ForkName::Gloas => spec.gloas_fork_epoch,
|
||||
ForkName::Heze => spec.heze_fork_epoch,
|
||||
};
|
||||
let current_slot = current_epoch.unwrap().start_slot(Spec::slots_per_epoch());
|
||||
ForkContext::new::<Spec>(current_slot, Hash256::zero(), spec)
|
||||
|
||||
Reference in New Issue
Block a user