Reputation changes requires reason (#4277)

This commit is contained in:
Arkadiy Paronyan
2019-12-03 11:33:33 +01:00
committed by Gavin Wood
parent 5edc4350b4
commit 5ec0923285
14 changed files with 233 additions and 156 deletions
@@ -37,7 +37,7 @@ enum Event {
RegisterValidator(Arc<dyn network_gossip::Validator<Block>>),
GossipMessage(Hash, Vec<u8>, bool),
SendMessage(Vec<network::PeerId>, Vec<u8>),
Report(network::PeerId, i32),
Report(network::PeerId, network::ReputationChange),
Announce(Hash),
}
@@ -85,7 +85,7 @@ impl super::Network<Block> for TestNetwork {
}
/// Report a peer's cost or benefit after some action.
fn report(&self, who: network::PeerId, cost_benefit: i32) {
fn report(&self, who: network::PeerId, cost_benefit: network::ReputationChange) {
let _ = self.sender.unbounded_send(Event::Report(who, cost_benefit));
}