1616// limitations under the License.
1717
1818use crate :: { Config , Key } ;
19+ use alloc:: vec;
1920use codec:: { Decode , DecodeWithMemTracking , Encode } ;
2021use core:: { fmt, marker:: PhantomData } ;
2122use frame_support:: { dispatch:: DispatchInfo , ensure, pallet_prelude:: TransactionSource } ;
2223use scale_info:: TypeInfo ;
2324use sp_runtime:: {
2425 impl_tx_ext_default,
25- traits:: { AsSystemOriginSigner , DispatchInfoOf , Dispatchable , TransactionExtension } ,
26+ traits:: { AsSystemOriginSigner , DispatchInfoOf , Dispatchable , Hash , TransactionExtension } ,
2627 transaction_validity:: {
2728 InvalidTransaction , TransactionPriority , TransactionValidityError , UnknownTransaction ,
2829 ValidTransaction ,
@@ -31,7 +32,7 @@ use sp_runtime::{
3132
3233/// Ensure that signed transactions are only valid if they are signed by sudo account.
3334///
34- /// In the initial phase of a chain without any tokens you can not prevent accounts from sending
35+ /// In the initial phase of a chain without any tokens you cannot prevent accounts from sending
3536/// transactions.
3637/// These transactions would enter the transaction pool as the succeed the validation, but would
3738/// fail on applying them as they are not allowed/disabled/whatever. This would be some huge dos
8990 fn validate (
9091 & self ,
9192 origin : <<T as frame_system:: Config >:: RuntimeCall as Dispatchable >:: RuntimeOrigin ,
92- _call : & <T as frame_system:: Config >:: RuntimeCall ,
93+ call : & <T as frame_system:: Config >:: RuntimeCall ,
9394 info : & DispatchInfoOf < <T as frame_system:: Config >:: RuntimeCall > ,
9495 _len : usize ,
9596 _self_implicit : Self :: Implicit ,
@@ -110,6 +111,7 @@ where
110111 Ok ( (
111112 ValidTransaction {
112113 priority : info. total_weight ( ) . ref_time ( ) as TransactionPriority ,
114+ provides : vec ! [ ( who, T :: Hashing :: hash_of( call) ) . encode( ) ] ,
113115 ..Default :: default ( )
114116 } ,
115117 ( ) ,
0 commit comments