Skip to content

Commit

Permalink
delete is_finalized function
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrachi1 committed Nov 30, 2022
1 parent c827f29 commit 7e8a079
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions beacon_node/http_api/src/block_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,26 +211,6 @@ impl BlockId {
}
}
}

pub fn is_finalized<T: BeaconChainTypes>(&self, chain: &BeaconChain<T>) -> bool {
let finalized_slot = chain
.canonical_head
.cached_head()
.finalized_checkpoint()
.epoch
.start_slot(T::EthSpec::slots_per_epoch());
match &self.0 {
CoreBlockId::Head => false,
CoreBlockId::Genesis => true,
CoreBlockId::Finalized => true,
CoreBlockId::Justified => false,
CoreBlockId::Slot(slot) => slot <= &finalized_slot,
CoreBlockId::Root(root) => {
let block_slot = chain.get_blinded_block(root).unwrap().unwrap().slot();
block_slot <= finalized_slot
}
}
}
}

impl FromStr for BlockId {
Expand Down

0 comments on commit 7e8a079

Please sign in to comment.