Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify
  • Loading branch information
drahnr committed Sep 3, 2021
commit d6280d4ca0fa1a3f038a2ccdc819bacd1ea45555
3 changes: 2 additions & 1 deletion node/core/candidate-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ pub struct Config {
pub struct CandidateValidationSubsystem {
#[allow(missing_docs)]
pub metrics: Metrics,
pvf_metrics: polkadot_node_core_pvf::Metrics,
#[allow(missing_docs)]
pub pvf_metrics: polkadot_node_core_pvf::Metrics,
config: Config,
}

Expand Down
9 changes: 4 additions & 5 deletions node/malus/src/variant-a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ use polkadot_cli::{

// Import extra types relevant to the particular
// subsystem.
use polkadot_node_core_candidate_validation::{CandidateValidationSubsystem, Metrics};
use polkadot_node_core_candidate_validation::CandidateValidationSubsystem;
use polkadot_node_subsystem::messages::CandidateValidationMessage;
use polkadot_node_subsystem_util::metrics::Metrics as _;

// Filter wrapping related types.
use malus::*;
Expand Down Expand Up @@ -89,14 +88,14 @@ impl OverseerGen for BehaveMaleficient {
let all_subsystems = create_default_subsystems(args)?.replace_candidate_validation(
// create the filtered subsystem
|orig: CandidateValidationSubsystem| {
Ok(FilteredSubsystem::new(
FilteredSubsystem::new(
CandidateValidationSubsystem::with_config(
candidate_validation_config,
Metrics::register(registry)?,
orig.metrics,
orig.pvf_metrics,
),
Skippy::default(),
))
)
},
);

Expand Down
3 changes: 2 additions & 1 deletion node/overseer/all-subsystems-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ fn impl_subsystems_gen(item: TokenStream) -> Result<proc_macro2::TokenStream> {
impl #orig_generics #strukt_ty #orig_generics {
#[doc = #msg]
pub fn #fname < NEW, F > (self, gen_replacement_fn: F) -> #strukt_ty #modified_generics
where F: FnOnce(#replacable_item_ty) -> NEW,
where
F: FnOnce(#replacable_item_ty) -> NEW,
{
let Self {
// To be replaced field:
Expand Down
4 changes: 2 additions & 2 deletions node/overseer/examples/minimal-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ fn main() {
});

let all_subsystems = AllSubsystems::<()>::dummy()
.replace_candidate_validation(|_| Subsystem2)
.replace_candidate_backing(|orig| orig);
.replace_candidate_validation(|_| Ok(Subsystem2))
.replace_candidate_backing(|orig| Ok(orig));

let (overseer, _handle) =
Overseer::new(vec![], all_subsystems, None, AlwaysSupportsParachains, spawner).unwrap();
Expand Down