Skip to content

Commit

Permalink
evm compilation post macro updates
Browse files Browse the repository at this point in the history
  • Loading branch information
4meta5 committed Nov 3, 2024
1 parent 13ccfa9 commit d73368e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 47 deletions.
2 changes: 1 addition & 1 deletion evm-template/runtime/src/configs/asset_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
59 changes: 27 additions & 32 deletions evm-template/runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down Expand Up @@ -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};
Expand All @@ -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,
Expand Down Expand Up @@ -114,50 +112,47 @@ impl GovernanceConfig for OpenZeppelinRuntime {
type WhitelistOrigin = EnsureRoot<AccountId>;
}
impl XcmConfig for OpenZeppelinRuntime {
type AccountIdToLocation;
type AccountIdToLocation = AccountIdToLocation<AccountId>;
type AddSupportedAssetOrigin = EnsureRoot<AccountId>;
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<AsAssetType<AssetId, AssetType, AssetManager>>;
type DerivativeAddressRegistrationOrigin = EnsureRoot<AccountId>;
type EditSupportedAssetOrigin = EnsureRoot<AccountId>;
type FeeManager = FeeManager;
type HrmpManipulatorOrigin = EnsureRoot<AccountId>;
type HrmpOpenOrigin = EnsureRoot<AccountId>;
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<AccountId>;
type RelayLocation;
type RelayLocation = RelayLocation;
type RemoveSupportedAssetOrigin = EnsureRoot<AccountId>;
type ReserveProvider;
type ReserveProviders;
type Reserves = Reserves;
type ResumeSupportedAssetOrigin = EnsureRoot<AccountId>;
type SelfLocation;
type SelfReserve;
type SovereignAccountDispatcherOrigin;
type Trader = (
UsingComponents<WeightToFee, BalancesPalletLocation, AccountId, Balances, ()>,
xcm_primitives::FirstAssetTrader<AssetType, AssetManager, XcmFeesToAccount>,
);
type Transactors;
type UniversalLocation;
type WeightToFee;
type SelfLocation = SelfLocation;
type SelfReserve = SelfReserve;
type SovereignAccountDispatcherOrigin = EnsureRoot<AccountId>;
type Trader = pallet_xcm_weight_trader::Trader<Runtime>;
type TransactorReserveProvider = AbsoluteAndRelativeReserve<SelfLocationAbsolute>;
type Transactors = Transactors;
type UniversalLocation = UniversalLocation;
type WeightToFee = WeightToFee;
type XcmAdminOrigin = EnsureRoot<AccountId>;
type XcmFeesAccount;
type XcmFeesAccount = TreasuryAccount;
type XcmOriginToTransactDispatchOrigin = XcmOriginToTransactDispatchOrigin;
type XcmSender;
type XcmWeigher;
type XcmSender = XcmRouter;
type XcmWeigher = XcmWeigher;
type XcmpQueueControllerOrigin = EnsureRoot<AccountId>;
type XcmpQueueMaxInboundSuspended = ConstU32<1000>;
type XtokensReserveProviders = ReserveProviders;
}
impl EvmConfig for OpenZeppelinRuntime {
type AddressMapping = IdentityAddressMapping;
Expand Down
20 changes: 8 additions & 12 deletions evm-template/runtime/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,23 @@ 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,
},
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 =
Expand Down
3 changes: 1 addition & 2 deletions generic-template/runtime/src/configs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ impl XcmConfig for OpenZeppelinRuntime {
type SelfLocation = SelfLocation;
type SelfReserve = SelfReserve;
type SovereignAccountDispatcherOrigin = EnsureRoot<AccountId>;
type Trader =
UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ToAuthor<Runtime>>;
type Trader = pallet_xcm_weight_trader::Trader<Runtime>;
type TransactorReserveProvider = AbsoluteAndRelativeReserve<SelfLocationAbsolute>;
type Transactors = Transactors;
type UniversalLocation = UniversalLocation;
Expand Down

0 comments on commit d73368e

Please sign in to comment.