mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
fmt
This commit is contained in:
@@ -12,9 +12,7 @@ pub fn inclusion_list_duties<T: BeaconChainTypes>(
|
||||
request_indices: &[u64],
|
||||
chain: &BeaconChain<T>,
|
||||
) -> Result<ApiDuties, warp::reject::Rejection> {
|
||||
let current_epoch = chain
|
||||
.epoch()
|
||||
.map_err(warp_utils::reject::unhandled_error)?;
|
||||
let current_epoch = chain.epoch().map_err(warp_utils::reject::unhandled_error)?;
|
||||
|
||||
// Determine what the current epoch would be if we fast-forward our system clock by
|
||||
// `MAXIMUM_GOSSIP_CLOCK_DISPARITY`.
|
||||
|
||||
@@ -2674,7 +2674,11 @@ impl ApiTester {
|
||||
let slot = self.chain.slot().unwrap();
|
||||
self.harness.extend_to_slot(slot).await;
|
||||
for validator_indices in self.interesting_validator_indices() {
|
||||
let res = self.client.post_validator_duties_inclusion_list(current_epoch, &validator_indices).await.unwrap();
|
||||
let res = self
|
||||
.client
|
||||
.post_validator_duties_inclusion_list(current_epoch, &validator_indices)
|
||||
.await
|
||||
.unwrap();
|
||||
println!("{:?}", res)
|
||||
}
|
||||
self
|
||||
@@ -7330,7 +7334,7 @@ async fn create_signed_inclusion_lists() {
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn test_post_validator_duties_inclusion_list () {
|
||||
async fn test_post_validator_duties_inclusion_list() {
|
||||
let mut config = ApiTesterConfig::default();
|
||||
config.spec.altair_fork_epoch = Some(Epoch::new(0));
|
||||
config.spec.bellatrix_fork_epoch = Some(Epoch::new(0));
|
||||
|
||||
@@ -339,7 +339,7 @@ impl<T: SlotClock + 'static, E: EthSpec> DutiesService<T, E> {
|
||||
let epoch = slot.epoch(E::slots_per_epoch());
|
||||
|
||||
if !self.spec.is_focil_enabled_for_epoch(epoch) {
|
||||
return vec![]
|
||||
return vec![];
|
||||
}
|
||||
|
||||
// Only collect validators that are considered safe in terms of doppelganger protection.
|
||||
|
||||
@@ -113,11 +113,15 @@ impl<T: SlotClock + 'static, E: EthSpec> InclusionListService<T, E> {
|
||||
/// Spawn a new task that downloads, signs and uploads the inclusion lists to the beacon node.
|
||||
// TODO(focil) I don't think we need `slot_duration` here, unless we need to make some calculation
|
||||
// related to the freeze deadline.
|
||||
fn spawn_inclusion_list_task(&self, _slot_duration: Duration, spec: &ChainSpec) -> Result<(), String> {
|
||||
fn spawn_inclusion_list_task(
|
||||
&self,
|
||||
_slot_duration: Duration,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<(), String> {
|
||||
let slot = self.slot_clock.now().ok_or("Failed to read slot clock")?;
|
||||
|
||||
if !spec.is_focil_enabled_for_epoch(slot.epoch(E::slots_per_epoch())) {
|
||||
return Ok(())
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// TODO(focil) unused variable
|
||||
|
||||
Reference in New Issue
Block a user