mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-15 01:14:59 -05:00
feat(op): allow import without state (#7661)
This commit is contained in:
@@ -187,6 +187,18 @@ where
|
||||
self
|
||||
}
|
||||
|
||||
/// Disables all given stages. See [`disable`](Self::disable).
|
||||
pub fn disable_all(mut self, stages: &[StageId]) -> Self {
|
||||
for stage_id in stages {
|
||||
let entry = self
|
||||
.stages
|
||||
.get_mut(stage_id)
|
||||
.expect("Cannot disable a stage that is not in the set.");
|
||||
entry.enabled = false;
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Disables the given stage if the given closure returns true.
|
||||
///
|
||||
/// See [Self::disable]
|
||||
@@ -200,6 +212,19 @@ where
|
||||
self
|
||||
}
|
||||
|
||||
/// Disables all given stages if the given closure returns true.
|
||||
///
|
||||
/// See [Self::disable]
|
||||
pub fn disable_all_if<F>(self, stages: &[StageId], f: F) -> Self
|
||||
where
|
||||
F: FnOnce() -> bool,
|
||||
{
|
||||
if f() {
|
||||
return self.disable_all(stages)
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Consumes the builder and returns the contained [`Stage`]s in the order specified.
|
||||
pub fn build(mut self) -> Vec<Box<dyn Stage<DB>>> {
|
||||
let mut stages = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user