From 136645aa4c9afa8d94faa3526fb98f1629df8109 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Fri, 29 Dec 2017 02:56:04 +0100 Subject: [PATCH] remove unused context trait and fix warning --- substrate/Cargo.lock | 20 +++++++++---------- .../src/bft/accumulator.rs | 12 ----------- substrate/candidate-agreement/src/table.rs | 2 +- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 82f9c97706..a185bd50e0 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1,13 +1,3 @@ -[root] -name = "polkadot-validator" -version = "0.1.0" -dependencies = [ - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "polkadot-primitives 0.1.0", - "polkadot-serializer 0.1.0", - "serde 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "aho-corasick" version = "0.6.3" @@ -722,6 +712,16 @@ dependencies = [ "triehash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "polkadot-validator" +version = "0.1.0" +dependencies = [ + "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "polkadot-primitives 0.1.0", + "polkadot-serializer 0.1.0", + "serde 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pretty_assertions" version = "0.4.0" diff --git a/substrate/candidate-agreement/src/bft/accumulator.rs b/substrate/candidate-agreement/src/bft/accumulator.rs index 78f2958bc5..3bd5147e98 100644 --- a/substrate/candidate-agreement/src/bft/accumulator.rs +++ b/substrate/candidate-agreement/src/bft/accumulator.rs @@ -22,18 +22,6 @@ use std::hash::Hash; use super::{Message, LocalizedMessage}; -/// Context necessary to execute a round of BFT. -pub trait Context { - /// A full candidate. - type Candidate: Clone; - /// Unique digest of a proposed candidate (think hash). - type Digest: Hash + Eq + Clone; - /// Validator ID. - type ValidatorId: Hash + Eq; - /// A signature. - type Signature: Eq + Clone; -} - /// Justification at a given round. #[derive(PartialEq, Eq, Debug, Clone)] pub struct Justification { diff --git a/substrate/candidate-agreement/src/table.rs b/substrate/candidate-agreement/src/table.rs index cfcab5e1e4..f7dfb97666 100644 --- a/substrate/candidate-agreement/src/table.rs +++ b/substrate/candidate-agreement/src/table.rs @@ -284,7 +284,7 @@ impl Table { let candidate = &candidate_data.candidate; match best_candidates.entry(group_id.clone()) { BTreeEntry::Occupied(mut occ) => { - let mut candidate_ref = occ.get_mut(); + let candidate_ref = occ.get_mut(); if *candidate_ref < candidate { *candidate_ref = candidate; }