mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 06:31:03 +00:00
Fixes validation for SkipCheckIfFeeless extension (#3993)
During validation, `SkipCheckIfFeeless` should check if the call is `feeless` and delegate to the wrapped extension if not.
This commit is contained in:
@@ -43,7 +43,7 @@ use frame_support::{
|
||||
use scale_info::{StaticTypeInfo, TypeInfo};
|
||||
use sp_runtime::{
|
||||
traits::{DispatchInfoOf, PostDispatchInfoOf, SignedExtension},
|
||||
transaction_validity::TransactionValidityError,
|
||||
transaction_validity::{TransactionValidity, TransactionValidityError, ValidTransaction},
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -122,6 +122,20 @@ where
|
||||
self.0.additional_signed()
|
||||
}
|
||||
|
||||
fn validate(
|
||||
&self,
|
||||
who: &Self::AccountId,
|
||||
call: &Self::Call,
|
||||
info: &DispatchInfoOf<Self::Call>,
|
||||
len: usize,
|
||||
) -> TransactionValidity {
|
||||
if call.is_feeless(&<T as frame_system::Config>::RuntimeOrigin::signed(who.clone())) {
|
||||
Ok(ValidTransaction::default())
|
||||
} else {
|
||||
self.0.validate(who, call, info, len)
|
||||
}
|
||||
}
|
||||
|
||||
fn pre_dispatch(
|
||||
self,
|
||||
who: &Self::AccountId,
|
||||
|
||||
Reference in New Issue
Block a user