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

Commit b3857a3

Browse files
committed
doc
1 parent cca3707 commit b3857a3

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

frame/support/src/lib.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,18 @@ pub mod pallet_prelude {
12551255
/// #[pallet::origin]
12561256
/// pub struct Origin<T>(PhantomData<T>);
12571257
///
1258+
/// // Declare validate_unsigned implementation.
1259+
/// #[pallet::validate_unsigned]
1260+
/// impl<T: Trait> ValidateUnsigned for Module<T> {
1261+
/// type Call = Call<T>;
1262+
/// fn validate_unsigned(
1263+
/// source: TransactionSource,
1264+
/// call: &Self::Call
1265+
/// ) -> TransactionValidity {
1266+
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
1267+
/// }
1268+
/// }
1269+
///
12581270
/// // Declare inherent provider for module. (this is optional)
12591271
/// //
12601272
/// // The macro checks module is `Module<T>` or `Module<T, I>` and trait is `ProvideInherent`
@@ -1284,17 +1296,6 @@ pub mod pallet_prelude {
12841296
/// }
12851297
///
12861298
/// pub const INHERENT_IDENTIFIER: sp_inherents::InherentIdentifier = *b"testpall";
1287-
///
1288-
/// #[pallet::validate_unsigned]
1289-
/// impl<T: Trait> ValidateUnsigned for Module<T> {
1290-
/// type Call = Call<T>;
1291-
/// fn validate_unsigned(
1292-
/// source: TransactionSource,
1293-
/// call: &Self::Call
1294-
/// ) -> TransactionValidity {
1295-
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
1296-
/// }
1297-
/// }
12981299
/// }
12991300
/// ```
13001301
///
@@ -1372,6 +1373,17 @@ pub mod pallet_prelude {
13721373
/// #[pallet::origin]
13731374
/// pub struct Origin<T, I = DefaultInstance>(PhantomData<(T, I)>);
13741375
///
1376+
/// #[pallet::validate_unsigned]
1377+
/// impl<T: Trait<I>, I: Instance> ValidateUnsigned for Module<T, I> {
1378+
/// type Call = Call<T, I>;
1379+
/// fn validate_unsigned(
1380+
/// source: TransactionSource,
1381+
/// call: &Self::Call
1382+
/// ) -> TransactionValidity {
1383+
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
1384+
/// }
1385+
/// }
1386+
///
13751387
/// #[pallet::inherent]
13761388
/// impl<T: Trait<I>, I: Instance> ProvideInherent for Module<T, I> {
13771389
/// type Call = Call<T, I>;
@@ -1398,18 +1410,6 @@ pub mod pallet_prelude {
13981410
/// }
13991411
///
14001412
/// pub const INHERENT_IDENTIFIER: sp_inherents::InherentIdentifier = *b"testpall";
1401-
/// // TODO TODO: add validate unsigned
1402-
///
1403-
/// #[pallet::validate_unsigned]
1404-
/// impl<T: Trait<I>, I: Instance> ValidateUnsigned for Module<T, I> {
1405-
/// type Call = Call<T, I>;
1406-
/// fn validate_unsigned(
1407-
/// source: TransactionSource,
1408-
/// call: &Self::Call
1409-
/// ) -> TransactionValidity {
1410-
/// Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
1411-
/// }
1412-
/// }
14131413
/// }
14141414
/// ```
14151415
pub use frame_support_procedural::pallet;

0 commit comments

Comments
 (0)