mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 02:51:01 +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:
@@ -162,7 +162,6 @@ impl frame_system::Config for Runtime {
|
||||
type Version = Version;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
|
||||
type ExtensionsWeightInfo = weights::frame_system_extensions::WeightInfo<Runtime>;
|
||||
type SS58Prefix = SS58Prefix;
|
||||
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
|
||||
type MaxConsumers = frame_support::traits::ConstU32<16>;
|
||||
@@ -219,7 +218,6 @@ impl pallet_transaction_payment::Config for Runtime {
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightInfo = weights::pallet_transaction_payment::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -737,9 +735,6 @@ impl pallet_asset_conversion_tx_payment::Config for Runtime {
|
||||
type Fungibles = LocalAndForeignAssets;
|
||||
type OnChargeAssetTransaction =
|
||||
AssetConversionAdapter<Balances, AssetConversion, WestendLocationV3>;
|
||||
type WeightInfo = weights::pallet_asset_conversion_tx_payment::WeightInfo<Runtime>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = AssetConversionTxHelper;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -925,8 +920,8 @@ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type SignedBlock = generic::SignedBlock<Block>;
|
||||
/// BlockId type as expected by this runtime.
|
||||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The extension to the basic transaction logic.
|
||||
pub type TxExtension = (
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
frame_system::CheckNonZeroSender<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
@@ -938,7 +933,7 @@ pub type TxExtension = (
|
||||
);
|
||||
/// Unchecked extrinsic type as expected by this runtime.
|
||||
pub type UncheckedExtrinsic =
|
||||
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
|
||||
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
|
||||
|
||||
/// Migrations to apply on runtime upgrade.
|
||||
pub type Migrations = (
|
||||
@@ -1070,77 +1065,14 @@ pub type Executive = frame_executive::Executive<
|
||||
Migrations,
|
||||
>;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub struct AssetConversionTxHelper;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
impl
|
||||
pallet_asset_conversion_tx_payment::BenchmarkHelperTrait<
|
||||
AccountId,
|
||||
xcm::v3::MultiLocation,
|
||||
xcm::v3::MultiLocation,
|
||||
> for AssetConversionTxHelper
|
||||
{
|
||||
fn create_asset_id_parameter(seed: u32) -> (xcm::v3::MultiLocation, xcm::v3::MultiLocation) {
|
||||
// Use a different parachain' foreign assets pallet so that the asset is indeed foreign.
|
||||
let asset_id = xcm::v3::MultiLocation::new(
|
||||
1,
|
||||
xcm::v3::Junctions::X3(
|
||||
xcm::v3::Junction::Parachain(3000),
|
||||
xcm::v3::Junction::PalletInstance(53),
|
||||
xcm::v3::Junction::GeneralIndex(seed.into()),
|
||||
),
|
||||
);
|
||||
(asset_id, asset_id)
|
||||
}
|
||||
|
||||
fn setup_balances_and_pool(asset_id: xcm::v3::MultiLocation, account: AccountId) {
|
||||
use frame_support::{assert_ok, traits::fungibles::Mutate};
|
||||
assert_ok!(ForeignAssets::force_create(
|
||||
RuntimeOrigin::root(),
|
||||
asset_id.into(),
|
||||
account.clone().into(), /* owner */
|
||||
true, /* is_sufficient */
|
||||
1,
|
||||
));
|
||||
|
||||
let lp_provider = account.clone();
|
||||
use frame_support::traits::Currency;
|
||||
let _ = Balances::deposit_creating(&lp_provider, u64::MAX.into());
|
||||
assert_ok!(ForeignAssets::mint_into(asset_id.into(), &lp_provider, u64::MAX.into()));
|
||||
|
||||
let token_native = Box::new(xcm::v3::MultiLocation::new(1, xcm::v3::Junctions::Here));
|
||||
let token_second = Box::new(asset_id);
|
||||
|
||||
assert_ok!(AssetConversion::create_pool(
|
||||
RuntimeOrigin::signed(lp_provider.clone()),
|
||||
token_native.clone(),
|
||||
token_second.clone()
|
||||
));
|
||||
|
||||
assert_ok!(AssetConversion::add_liquidity(
|
||||
RuntimeOrigin::signed(lp_provider.clone()),
|
||||
token_native,
|
||||
token_second,
|
||||
(u32::MAX / 2).into(), // 1 desired
|
||||
u32::MAX.into(), // 2 desired
|
||||
1, // 1 min
|
||||
1, // 2 min
|
||||
lp_provider,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
mod benches {
|
||||
frame_benchmarking::define_benchmarks!(
|
||||
[frame_system, SystemBench::<Runtime>]
|
||||
[frame_system_extensions, SystemExtensionsBench::<Runtime>]
|
||||
[pallet_assets, Local]
|
||||
[pallet_assets, Foreign]
|
||||
[pallet_assets, Pool]
|
||||
[pallet_asset_conversion, AssetConversion]
|
||||
[pallet_asset_conversion_tx_payment, AssetTxPayment]
|
||||
[pallet_balances, Balances]
|
||||
[pallet_message_queue, MessageQueue]
|
||||
[pallet_multisig, Multisig]
|
||||
@@ -1151,7 +1083,6 @@ mod benches {
|
||||
[pallet_uniques, Uniques]
|
||||
[pallet_utility, Utility]
|
||||
[pallet_timestamp, Timestamp]
|
||||
[pallet_transaction_payment, TransactionPayment]
|
||||
[pallet_collator_selection, CollatorSelection]
|
||||
[cumulus_pallet_parachain_system, ParachainSystem]
|
||||
[cumulus_pallet_xcmp_queue, XcmpQueue]
|
||||
@@ -1448,7 +1379,6 @@ impl_runtime_apis! {
|
||||
use frame_benchmarking::{Benchmarking, BenchmarkList};
|
||||
use frame_support::traits::StorageInfoTrait;
|
||||
use frame_system_benchmarking::Pallet as SystemBench;
|
||||
use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
|
||||
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
|
||||
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
|
||||
use pallet_xcm_bridge_hub_router::benchmarking::Pallet as XcmBridgeHubRouterBench;
|
||||
@@ -1483,7 +1413,6 @@ impl_runtime_apis! {
|
||||
use sp_storage::TrackedStorageKey;
|
||||
|
||||
use frame_system_benchmarking::Pallet as SystemBench;
|
||||
use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
|
||||
impl frame_system_benchmarking::Config for Runtime {
|
||||
fn setup_set_code_requirements(code: &sp_std::vec::Vec<u8>) -> Result<(), BenchmarkError> {
|
||||
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
|
||||
|
||||
Reference in New Issue
Block a user