Skip to content

Commit

Permalink
fix compile with new compiler - dead code (paritytech#4530)
Browse files Browse the repository at this point in the history
* make compiler happy

* node side compile warning quiet

* ffs

* malus: remove unused keystore
  • Loading branch information
drahnr committed Dec 15, 2021
1 parent cf433f5 commit 634f649
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions node/core/dispute-coordinator/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ use polkadot_node_subsystem_util::metrics::{self, prometheus};
#[derive(Clone)]
struct MetricsInner {
/// Number of opened disputes.
#[cfg(feature = "disputes")]
open: prometheus::Counter<prometheus::U64>,
/// Votes of all disputes.
#[cfg(feature = "disputes")]
votes: prometheus::CounterVec<prometheus::U64>,
/// Conclusion across all disputes.
#[cfg(feature = "disputes")]
concluded: prometheus::CounterVec<prometheus::U64>,
/// Number of participations that have been queued.
#[cfg(feature = "disputes")]
queued_participations: prometheus::CounterVec<prometheus::U64>,
}

Expand Down Expand Up @@ -78,6 +82,13 @@ impl Metrics {
}

impl metrics::Metrics for Metrics {
#[cfg(not(feature = "disputes"))]
fn try_register(_registry: &prometheus::Registry) -> Result<Self, prometheus::PrometheusError> {
let metrics = MetricsInner {};
Ok(Metrics(Some(metrics)))
}

#[cfg(feature = "disputes")]
fn try_register(registry: &prometheus::Registry) -> Result<Self, prometheus::PrometheusError> {
let metrics = MetricsInner {
open: prometheus::register(
Expand Down
3 changes: 1 addition & 2 deletions node/malus/src/variants/suggest_garbage_candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ struct ReplacePoVBytes<Sender>
where
Sender: Send,
{
keystore: SyncCryptoStorePtr,
queue: metered::UnboundedMeteredSender<(Sender, Hash, CandidateReceipt)>,
}

Expand Down Expand Up @@ -112,7 +111,7 @@ impl OverseerGen for SuggestGarbageCandidate {
let (sink, source) = metered::unbounded();
let keystore = args.keystore.clone() as SyncCryptoStorePtr;

let filter = ReplacePoVBytes { keystore: keystore.clone(), queue: sink };
let filter = ReplacePoVBytes { queue: sink };

let keystore2 = keystore.clone();
let spawner2 = spawner.clone();
Expand Down
2 changes: 2 additions & 0 deletions utils/staking-miner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,12 @@ struct MonitorConfig {
#[derive(Debug, Clone, StructOpt)]
struct EmergencySolutionConfig {
/// The block hash at which scraping happens. If none is provided, the latest head is used.
#[allow(dead_code)]
#[structopt(long)]
at: Option<Hash>,

/// The solver algorithm to use.
#[allow(dead_code)]
#[structopt(subcommand)]
solver: Solvers,

Expand Down

0 comments on commit 634f649

Please sign in to comment.