mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-24 18:21:08 +00:00
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>
This commit is contained in:
@@ -30,7 +30,6 @@ use frame_support::{
|
||||
StorageNoopGuard,
|
||||
};
|
||||
use frame_system::Event as SysEvent;
|
||||
use sp_runtime::traits::DispatchTransaction;
|
||||
|
||||
const ID_1: LockIdentifier = *b"1 ";
|
||||
const ID_2: LockIdentifier = *b"2 ";
|
||||
@@ -241,17 +240,17 @@ fn lock_should_work_reserve() {
|
||||
TokenError::Frozen
|
||||
);
|
||||
assert_noop!(Balances::reserve(&1, 1), Error::<Test>::LiquidityRestrictions,);
|
||||
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
|
||||
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
|
||||
ChargeTransactionPayment::from(1),
|
||||
Some(1).into(),
|
||||
&1,
|
||||
CALL,
|
||||
&info_from_weight(Weight::from_parts(1, 0)),
|
||||
1,
|
||||
)
|
||||
.is_err());
|
||||
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
|
||||
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
|
||||
ChargeTransactionPayment::from(0),
|
||||
Some(1).into(),
|
||||
&1,
|
||||
CALL,
|
||||
&info_from_weight(Weight::from_parts(1, 0)),
|
||||
1,
|
||||
@@ -272,17 +271,17 @@ fn lock_should_work_tx_fee() {
|
||||
TokenError::Frozen
|
||||
);
|
||||
assert_noop!(Balances::reserve(&1, 1), Error::<Test>::LiquidityRestrictions,);
|
||||
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
|
||||
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
|
||||
ChargeTransactionPayment::from(1),
|
||||
Some(1).into(),
|
||||
&1,
|
||||
CALL,
|
||||
&info_from_weight(Weight::from_parts(1, 0)),
|
||||
1,
|
||||
)
|
||||
.is_err());
|
||||
assert!(ChargeTransactionPayment::<Test>::validate_and_prepare(
|
||||
assert!(<ChargeTransactionPayment<Test> as SignedExtension>::pre_dispatch(
|
||||
ChargeTransactionPayment::from(0),
|
||||
Some(1).into(),
|
||||
&1,
|
||||
CALL,
|
||||
&info_from_weight(Weight::from_parts(1, 0)),
|
||||
1,
|
||||
|
||||
@@ -37,7 +37,7 @@ use scale_info::TypeInfo;
|
||||
use sp_core::hexdisplay::HexDisplay;
|
||||
use sp_io;
|
||||
use sp_runtime::{
|
||||
traits::{BadOrigin, Zero},
|
||||
traits::{BadOrigin, SignedExtension, Zero},
|
||||
ArithmeticError, BuildStorage, DispatchError, DispatchResult, FixedPointNumber, RuntimeDebug,
|
||||
TokenError,
|
||||
};
|
||||
@@ -96,13 +96,13 @@ impl frame_system::Config for Test {
|
||||
type AccountData = super::AccountData<u64>;
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig as pallet_transaction_payment::DefaultConfig)]
|
||||
impl pallet_transaction_payment::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction = CurrencyAdapter<Pallet<Test>, ()>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = IdentityFee<u64>;
|
||||
type LengthToFee = IdentityFee<u64>;
|
||||
type FeeMultiplierUpdate = ();
|
||||
}
|
||||
|
||||
pub(crate) type Balance = u64;
|
||||
|
||||
Reference in New Issue
Block a user