File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -150,15 +150,21 @@ where
150150 dispatch_info : & DispatchInfoOf < T :: RuntimeCall > ,
151151 len : usize ,
152152 ) -> Option < TransactionValidity > {
153- if let Call :: transact { transaction, source : _ } = self {
153+ if let Call :: transact { transaction, source } = self {
154154 if let Err ( e) = CheckWeight :: < T > :: do_validate ( dispatch_info, len) {
155155 return Some ( Err ( e) ) ;
156156 }
157-
158- Some ( Pallet :: < T > :: validate_transaction_in_pool (
159- * origin,
160- transaction,
161- ) )
157+ match Pallet :: < T > :: recover_signer ( & transaction) {
158+ Some ( expect_source) => if expect_source != * source {
159+ return Some ( Err ( TransactionValidityError :: Invalid ( InvalidTransaction :: BadSigner ) ) ) ;
160+ } else {
161+ Some ( Pallet :: < T > :: validate_transaction_in_pool (
162+ * origin,
163+ transaction,
164+ ) )
165+ } ,
166+ None => return Some ( Err ( TransactionValidityError :: Invalid ( InvalidTransaction :: BadSigner ) ) ) ,
167+ }
162168 } else {
163169 None
164170 }
You can’t perform that action at this time.
0 commit comments