Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gui1117 committed Sep 2, 2020
1 parent cca3707 commit b3857a3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,18 @@ pub mod pallet_prelude {
/// #[pallet::origin]
/// pub struct Origin<T>(PhantomData<T>);
///
/// // Declare validate_unsigned implementation.
/// #[pallet::validate_unsigned]
/// impl<T: Trait> ValidateUnsigned for Module<T> {
/// type Call = Call<T>;
/// fn validate_unsigned(
/// source: TransactionSource,
/// call: &Self::Call
/// ) -> TransactionValidity {
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
/// }
/// }
///
/// // Declare inherent provider for module. (this is optional)
/// //
/// // The macro checks module is `Module<T>` or `Module<T, I>` and trait is `ProvideInherent`
Expand Down Expand Up @@ -1284,17 +1296,6 @@ pub mod pallet_prelude {
/// }
///
/// pub const INHERENT_IDENTIFIER: sp_inherents::InherentIdentifier = *b"testpall";
///
/// #[pallet::validate_unsigned]
/// impl<T: Trait> ValidateUnsigned for Module<T> {
/// type Call = Call<T>;
/// fn validate_unsigned(
/// source: TransactionSource,
/// call: &Self::Call
/// ) -> TransactionValidity {
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
/// }
/// }
/// }
/// ```
///
Expand Down Expand Up @@ -1372,6 +1373,17 @@ pub mod pallet_prelude {
/// #[pallet::origin]
/// pub struct Origin<T, I = DefaultInstance>(PhantomData<(T, I)>);
///
/// #[pallet::validate_unsigned]
/// impl<T: Trait<I>, I: Instance> ValidateUnsigned for Module<T, I> {
/// type Call = Call<T, I>;
/// fn validate_unsigned(
/// source: TransactionSource,
/// call: &Self::Call
/// ) -> TransactionValidity {
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
/// }
/// }
///
/// #[pallet::inherent]
/// impl<T: Trait<I>, I: Instance> ProvideInherent for Module<T, I> {
/// type Call = Call<T, I>;
Expand All @@ -1398,18 +1410,6 @@ pub mod pallet_prelude {
/// }
///
/// pub const INHERENT_IDENTIFIER: sp_inherents::InherentIdentifier = *b"testpall";
/// // TODO TODO: add validate unsigned
///
/// #[pallet::validate_unsigned]
/// impl<T: Trait<I>, I: Instance> ValidateUnsigned for Module<T, I> {
/// type Call = Call<T, I>;
/// fn validate_unsigned(
/// source: TransactionSource,
/// call: &Self::Call
/// ) -> TransactionValidity {
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
/// }
/// }
/// }
/// ```
pub use frame_support_procedural::pallet;

0 comments on commit b3857a3

Please sign in to comment.