Files
pezkuwi-subxt/substrate/frame/transaction-payment/skip-feeless-payment/src/tests.rs
T
georgepisaltu bbd51ce867 Revert "FRAME: Create TransactionExtension as a replacement for SignedExtension (#2280)" (#3665)
This PR reverts #2280 which introduced `TransactionExtension` to replace
`SignedExtension`.

As a result of the discussion
[here](https://github.com/paritytech/polkadot-sdk/pull/3623#issuecomment-1986789700),
the changes will be reverted for now with plans to reintroduce the
concept in the future.

---------

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
2024-03-13 14:10:59 +00:00

34 lines
1.3 KiB
Rust

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use super::*;
use crate::mock::{pallet_dummy::Call, DummyExtension, PreDispatchCount, Runtime, RuntimeCall};
use frame_support::dispatch::DispatchInfo;
#[test]
fn skip_feeless_payment_works() {
let call = RuntimeCall::DummyPallet(Call::<Runtime>::aux { data: 1 });
SkipCheckIfFeeless::<Runtime, DummyExtension>::from(DummyExtension)
.pre_dispatch(&0, &call, &DispatchInfo::default(), 0)
.unwrap();
assert_eq!(PreDispatchCount::get(), 1);
let call = RuntimeCall::DummyPallet(Call::<Runtime>::aux { data: 0 });
SkipCheckIfFeeless::<Runtime, DummyExtension>::from(DummyExtension)
.pre_dispatch(&0, &call, &DispatchInfo::default(), 0)
.unwrap();
assert_eq!(PreDispatchCount::get(), 1);
}