Migrate pallet-babe to pallet attribute macro. (#8310)

* Migrate pallet-babe to pallet attribute macro.

* Remove unnecessary bound in pallet storage.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Shaun Wang
2021-03-18 09:47:39 +13:00
committed by GitHub
parent da6bf01ad9
commit c7d32ba9a6
6 changed files with 313 additions and 257 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ use sp_staking::{
};
use sp_std::prelude::*;
use crate::{Call, Module, Config};
use crate::{Call, Pallet, Config};
/// A trait with utility methods for handling equivocation reports in BABE.
/// The trait provides methods for reporting an offence triggered by a valid
@@ -182,7 +182,7 @@ where
/// A `ValidateUnsigned` implementation that restricts calls to `report_equivocation_unsigned`
/// to local calls (i.e. extrinsics generated on this node) or that already in a block. This
/// guarantees that only block authors can include unsigned equivocation reports.
impl<T: Config> frame_support::unsigned::ValidateUnsigned for Module<T> {
impl<T: Config> frame_support::unsigned::ValidateUnsigned for Pallet<T> {
type Call = Call<T>;
fn validate_unsigned(source: TransactionSource, call: &Self::Call) -> TransactionValidity {
if let Call::report_equivocation_unsigned(equivocation_proof, key_owner_proof) = call {