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:
gupnik
2024-04-09 14:05:46 +05:30
committed by GitHub
parent d733c77ee2
commit 0e27b881a4
3 changed files with 48 additions and 2 deletions
@@ -33,6 +33,7 @@ impl Config for Runtime {
parameter_types! {
pub static PreDispatchCount: u32 = 0;
pub static ValidateCount: u32 = 0;
}
#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, TypeInfo)]
@@ -47,6 +48,18 @@ impl SignedExtension for DummyExtension {
fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> {
Ok(())
}
fn validate(
&self,
_who: &Self::AccountId,
_call: &Self::Call,
_info: &DispatchInfoOf<Self::Call>,
_len: usize,
) -> TransactionValidity {
ValidateCount::mutate(|c| *c += 1);
Ok(Default::default())
}
fn pre_dispatch(
self,
_who: &Self::AccountId,