Remove uncles related code (#13216)

The code was added without any clear usage. The inherent for example is not benchmarked and not used.
This commit is contained in:
Bastian Köcher
2023-01-29 21:56:10 +01:00
committed by GitHub
parent 700a732170
commit e851b3ae73
22 changed files with 47 additions and 906 deletions
-4
View File
@@ -607,10 +607,6 @@ impl<T: Config + pallet_authorship::Config>
fn note_author(author: ValidatorId<T>) {
Self::note_authorship(author);
}
fn note_uncle(author: ValidatorId<T>, _age: T::BlockNumber) {
Self::note_authorship(author);
}
}
impl<T: Config> Pallet<T> {
-2
View File
@@ -169,8 +169,6 @@ impl pallet_session::historical::Config for Runtime {
impl pallet_authorship::Config for Runtime {
type FindAuthor = ();
type UncleGenerations = ConstU64<5>;
type FilterUncle = ();
type EventHandler = ImOnline;
}
+2 -3
View File
@@ -308,11 +308,10 @@ fn should_mark_online_validator_when_block_is_authored() {
// when
ImOnline::note_author(1);
ImOnline::note_uncle(2, 0);
// then
assert!(ImOnline::is_online(0));
assert!(ImOnline::is_online(1));
assert!(!ImOnline::is_online(1));
assert!(!ImOnline::is_online(2));
});
}
@@ -338,7 +337,7 @@ fn should_not_send_a_report_if_already_online() {
assert_eq!(Session::current_index(), 2);
assert_eq!(Session::validators(), vec![1, 2, 3]);
ImOnline::note_author(2);
ImOnline::note_uncle(3, 0);
ImOnline::note_author(3);
// when
UintAuthorityId::set_all_keys(vec![1, 2, 3]);