mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 07:05:42 +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:
@@ -14,7 +14,9 @@
|
||||
// limitations under the License.
|
||||
|
||||
use super::*;
|
||||
use crate::mock::{pallet_dummy::Call, DummyExtension, PreDispatchCount, Runtime, RuntimeCall};
|
||||
use crate::mock::{
|
||||
pallet_dummy::Call, DummyExtension, PreDispatchCount, Runtime, RuntimeCall, ValidateCount,
|
||||
};
|
||||
use frame_support::dispatch::DispatchInfo;
|
||||
|
||||
#[test]
|
||||
@@ -31,3 +33,20 @@ fn skip_feeless_payment_works() {
|
||||
.unwrap();
|
||||
assert_eq!(PreDispatchCount::get(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn validate_works() {
|
||||
assert_eq!(ValidateCount::get(), 0);
|
||||
|
||||
let call = RuntimeCall::DummyPallet(Call::<Runtime>::aux { data: 1 });
|
||||
SkipCheckIfFeeless::<Runtime, DummyExtension>::from(DummyExtension)
|
||||
.validate(&0, &call, &DispatchInfo::default(), 0)
|
||||
.unwrap();
|
||||
assert_eq!(ValidateCount::get(), 1);
|
||||
|
||||
let call = RuntimeCall::DummyPallet(Call::<Runtime>::aux { data: 0 });
|
||||
SkipCheckIfFeeless::<Runtime, DummyExtension>::from(DummyExtension)
|
||||
.validate(&0, &call, &DispatchInfo::default(), 0)
|
||||
.unwrap();
|
||||
assert_eq!(ValidateCount::get(), 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user