From d73368e38bdb7f0e1be7ee7e420a360568c274d8 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Sat, 2 Nov 2024 22:01:56 -0400 Subject: [PATCH] evm compilation post macro updates --- .../runtime/src/configs/asset_config.rs | 2 +- evm-template/runtime/src/configs/mod.rs | 59 +++++++++---------- evm-template/runtime/src/types.rs | 20 +++---- generic-template/runtime/src/configs/mod.rs | 3 +- 4 files changed, 37 insertions(+), 47 deletions(-) diff --git a/evm-template/runtime/src/configs/asset_config.rs b/evm-template/runtime/src/configs/asset_config.rs index 307c397e..f8c2ae04 100644 --- a/evm-template/runtime/src/configs/asset_config.rs +++ b/evm-template/runtime/src/configs/asset_config.rs @@ -10,7 +10,7 @@ use sp_std::{ use xcm::latest::Location; use crate::{ - types::{AssetId, Balance}, + types::{AccountId, AssetId, Balance}, AssetManager, Assets, Runtime, RuntimeCall, RuntimeOrigin, }; diff --git a/evm-template/runtime/src/configs/mod.rs b/evm-template/runtime/src/configs/mod.rs index 034e5c64..514a3a23 100644 --- a/evm-template/runtime/src/configs/mod.rs +++ b/evm-template/runtime/src/configs/mod.rs @@ -2,7 +2,7 @@ pub mod asset_config; pub mod governance; pub mod xcm_config; -pub use asset_config::{AssetRegistrar, AssetRegistrarMetadata, AssetType}; +use asset_config::*; #[cfg(feature = "async-backing")] use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; #[cfg(not(feature = "async-backing"))] @@ -51,11 +51,9 @@ use xcm_builder::{ FrameTransactionalProcessor, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic, }; -use xcm_config::{ - AssetTransactors, BalancesPalletLocation, FeeManager, LocalOriginToLocation, - LocationToAccountId, Reserves, XcmOriginToTransactDispatchOrigin, -}; +use xcm_config::*; use xcm_executor::XcmExecutor; +use xcm_primitives::{AbsoluteAndRelativeReserve, AccountIdToLocation, AsAssetType}; #[cfg(feature = "runtime-benchmarks")] use crate::benchmark::{OpenHrmpChannel, PayWithEnsure}; @@ -70,7 +68,7 @@ use crate::{ AccountId, AssetId, AssetKind, Balance, Beneficiary, Block, BlockNumber, CollatorSelectionUpdateOrigin, ConsensusHook, Hash, MessageQueueServiceWeight, Nonce, PrecompilesValue, PriceForSiblingParachainDelivery, ProxyType, TreasuryInteriorLocation, - TreasuryPalletId, TreasuryPaymaster, Version, XcmFeesToAccount, + TreasuryPalletId, TreasuryPaymaster, Version, }, weights::{self, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}, AllPalletsWithSystem, AssetManager, Aura, Balances, BaseFee, CollatorSelection, EVMChainId, @@ -114,50 +112,47 @@ impl GovernanceConfig for OpenZeppelinRuntime { type WhitelistOrigin = EnsureRoot; } impl XcmConfig for OpenZeppelinRuntime { - type AccountIdToLocation; + type AccountIdToLocation = AccountIdToLocation; type AddSupportedAssetOrigin = EnsureRoot; - type AssetFeesFilter; + type AssetFeesFilter = AssetFeesFilter; type AssetTransactors = AssetTransactors; - type BaseXcmWeight; - type CurrencyId; - type CurrencyIdToLocation; - type DerivativeAddressRegistrationOrigin; - type EditSupportedAssetOrigin; + type BaseXcmWeight = BaseXcmWeight; + type CurrencyId = CurrencyId; + type CurrencyIdToLocation = CurrencyIdToLocation>; + type DerivativeAddressRegistrationOrigin = EnsureRoot; + type EditSupportedAssetOrigin = EnsureRoot; type FeeManager = FeeManager; type HrmpManipulatorOrigin = EnsureRoot; type HrmpOpenOrigin = EnsureRoot; type LocalOriginToLocation = LocalOriginToLocation; type LocationToAccountId = LocationToAccountId; - type MaxAssetsForTransfer; - type MaxHrmpRelayFee; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MaxHrmpRelayFee = MaxHrmpRelayFee; type MessageQueueHeapSize = ConstU32<{ 64 * 1024 }>; type MessageQueueMaxStale = ConstU32<8>; type MessageQueueServiceWeight = MessageQueueServiceWeight; - type ParachainMinFee; + type ParachainMinFee = ParachainMinFee; type PauseSupportedAssetOrigin = EnsureRoot; - type RelayLocation; + type RelayLocation = RelayLocation; type RemoveSupportedAssetOrigin = EnsureRoot; - type ReserveProvider; - type ReserveProviders; type Reserves = Reserves; type ResumeSupportedAssetOrigin = EnsureRoot; - type SelfLocation; - type SelfReserve; - type SovereignAccountDispatcherOrigin; - type Trader = ( - UsingComponents, - xcm_primitives::FirstAssetTrader, - ); - type Transactors; - type UniversalLocation; - type WeightToFee; + type SelfLocation = SelfLocation; + type SelfReserve = SelfReserve; + type SovereignAccountDispatcherOrigin = EnsureRoot; + type Trader = pallet_xcm_weight_trader::Trader; + type TransactorReserveProvider = AbsoluteAndRelativeReserve; + type Transactors = Transactors; + type UniversalLocation = UniversalLocation; + type WeightToFee = WeightToFee; type XcmAdminOrigin = EnsureRoot; - type XcmFeesAccount; + type XcmFeesAccount = TreasuryAccount; type XcmOriginToTransactDispatchOrigin = XcmOriginToTransactDispatchOrigin; - type XcmSender; - type XcmWeigher; + type XcmSender = XcmRouter; + type XcmWeigher = XcmWeigher; type XcmpQueueControllerOrigin = EnsureRoot; type XcmpQueueMaxInboundSuspended = ConstU32<1000>; + type XtokensReserveProviders = ReserveProviders; } impl EvmConfig for OpenZeppelinRuntime { type AddressMapping = IdentityAddressMapping; diff --git a/evm-template/runtime/src/types.rs b/evm-template/runtime/src/types.rs index f0d98ee2..54f0b678 100644 --- a/evm-template/runtime/src/types.rs +++ b/evm-template/runtime/src/types.rs @@ -27,11 +27,16 @@ use xcm_builder::{ConvertedConcreteId, PayOverXcm}; use xcm_executor::traits::JustTry; use xcm_primitives::AsAssetType; -pub use crate::{ +use crate::{ configs::{ - xcm_config::RelayLocation, FeeAssetId, StakingAdminBodyId, ToSiblingBaseDeliveryFee, - TransactionByteFee, + asset_config::AssetType, + xcm_config::{self, RelayLocation}, + FeeAssetId, StakingAdminBodyId, ToSiblingBaseDeliveryFee, TransactionByteFee, }, + constants::HOURS, + AssetManager, Assets, +}; +pub use crate::{ constants::{ BLOCK_PROCESSING_VELOCITY, RELAY_CHAIN_SLOT_DURATION_MILLIS, UNINCLUDED_SEGMENT_CAPACITY, VERSION, @@ -39,15 +44,6 @@ pub use crate::{ AllPalletsWithSystem, OpenZeppelinPrecompiles, Runtime, RuntimeBlockWeights, RuntimeCall, Treasury, XcmpQueue, }; -use crate::{ - configs::{ - xcm_config::{self, RelayLocation}, - AssetType, FeeAssetId, StakingAdminBodyId, ToSiblingBaseDeliveryFee, TransactionByteFee, - TreasuryInteriorLocation, - }, - constants::HOURS, - AssetManager, Assets, -}; /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = diff --git a/generic-template/runtime/src/configs/mod.rs b/generic-template/runtime/src/configs/mod.rs index e1500ba8..4b89a908 100644 --- a/generic-template/runtime/src/configs/mod.rs +++ b/generic-template/runtime/src/configs/mod.rs @@ -134,8 +134,7 @@ impl XcmConfig for OpenZeppelinRuntime { type SelfLocation = SelfLocation; type SelfReserve = SelfReserve; type SovereignAccountDispatcherOrigin = EnsureRoot; - type Trader = - UsingComponents>; + type Trader = pallet_xcm_weight_trader::Trader; type TransactorReserveProvider = AbsoluteAndRelativeReserve; type Transactors = Transactors; type UniversalLocation = UniversalLocation;