mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 13:54:44 +00:00
Event-based block lookup tests (#5534)
* WIP * Initial working version of new sync tests. * Remove sync traits and fix lints. * Reduce internal method visibility and make test method instead. Remove extra beacon chain harness instance created in tests. * Improve `SyncTester` api. * Fix lint. * Test example * Lookup tests using rig * Tests should interface with events only * lint * Skip deneb test pre-deneb * Add more assertions * Remove logging changes * Address @jimmygchen comments * Merge branch 'unstable' of https://github.com/sigp/lighthouse into bn-p2p-tests * remove unused assertions * fix lint
This commit is contained in:
@@ -76,6 +76,24 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn active_single_lookups(&self) -> Vec<Id> {
|
||||
self.single_block_lookups.keys().cloned().collect()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn active_parent_lookups(&self) -> Vec<Hash256> {
|
||||
self.parent_lookups
|
||||
.iter()
|
||||
.map(|r| r.chain_hash())
|
||||
.collect::<Vec<_>>()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn failed_chains_contains(&mut self, chain_hash: &Hash256) -> bool {
|
||||
self.failed_chains.contains(chain_hash)
|
||||
}
|
||||
|
||||
/* Lookup requests */
|
||||
|
||||
/// Creates a lookup for the block with the given `block_root` and immediately triggers it.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user