Skip to content

Commit

Permalink
Migrate pallet-babe to pallet attribute macro. (paritytech#8310)
Browse files Browse the repository at this point in the history
* Migrate pallet-babe to pallet attribute macro.

* Remove unnecessary bound in pallet storage.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
  • Loading branch information
2 people authored and hirschenberger committed Apr 14, 2021
1 parent 5cc6958 commit c7e831d
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 269 deletions.
2 changes: 1 addition & 1 deletion frame/babe/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ mod tests {
let equivocation_proof = generate_equivocation_proof(
offending_authority_index,
offending_authority_pair,
CurrentSlot::get() + 1,
CurrentSlot::<Test>::get() + 1,
);

println!("equivocation_proof: {:?}", equivocation_proof);
Expand Down
4 changes: 2 additions & 2 deletions frame/babe/src/equivocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit c7e831d

Please sign in to comment.