Skip to content
Snippets Groups Projects
Commit 771df7ef authored by bgallois's avatar bgallois Committed by Hugo Trentesaux
Browse files

fix slashing strategy

parent f312f70d
No related branches found
No related tags found
1 merge request!161Offences management
......@@ -124,7 +124,7 @@ where
};
// Define the slash strategy.
let slash_strategy = if O::ID != *b"im-online:offlin" {
let slash_strategy = if O::ID == *b"im-online:offlin" {
SlashStrategy::Disconnect
} else {
SlashStrategy::BlackList
......
......@@ -37,6 +37,19 @@ fn should_report_an_authority_and_trigger_on_offence_and_add_to_blacklist() {
Offences::report_offence(vec![], offence).unwrap();
// then
assert_eq!(
offence_reports(KIND, time_slot),
vec![
OffenceDetails {
offender: 5,
reporters: vec![]
},
OffenceDetails {
offender: 9,
reporters: vec![]
}
]
);
});
}
......@@ -62,6 +75,13 @@ fn should_not_report_the_same_authority_twice_in_the_same_slot() {
);
// then
assert_eq!(
offence_reports(KIND, time_slot),
vec![OffenceDetails {
offender: 5,
reporters: vec![]
},]
);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment