Skip to content

Commit

Permalink
save fixes wip
Browse files Browse the repository at this point in the history
  • Loading branch information
4meta5 committed Oct 30, 2024
1 parent c046c6f commit fd11b53
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
2 changes: 2 additions & 0 deletions evm-template/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions evm-template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", features =
], tag = "polkadot-stable2407-1" }
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
Expand Down
2 changes: 2 additions & 0 deletions evm-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ pallet-xcm-weight-trader = { workspace = true }
xcm-primitives = { workspace = true }

[dev-dependencies]
polkadot-runtime-parachains = { workspace = true }
polkadot-core-primitives = { workspace = true }
sp-io = { workspace = true }
xcm-simulator = { workspace = true }

Expand Down
26 changes: 7 additions & 19 deletions evm-template/runtime/tests/xcm_mock/parachain.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Parachain runtime mock.
use cumulus_primitives_core::relay_chain::HrmpChannelId;
pub use evm_runtime_template::configs::asset_config::AssetType;
use frame_support::{
construct_runtime,
dispatch::GetDispatchInfo,
Expand All @@ -12,15 +13,14 @@ use frame_support::{
PalletId,
};
use frame_system::{pallet_prelude::BlockNumberFor, EnsureNever, EnsureRoot};
pub use moonbase_runtime::xcm_config::AssetType;
#[cfg(feature = "runtime-benchmarks")]
use moonbeam_runtime_common::benchmarking::BenchmarkHelper as ArgumentsBenchmarkHelper;
// #[cfg(feature = "runtime-benchmarks")]
// use benchmarking::BenchmarkHelper as ArgumentsBenchmarkHelper;
use orml_traits::parameter_type_with_key;
use pallet_ethereum::PostLogContent;
use pallet_xcm::migration::v1::VersionUncheckedMigrateToV1;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use polkadot_core_primitives::BlockNumber as RelayBlockNumber;
use polkadot_parachain::primitives::{Id as ParaId, Sibling};
use polkadot_parachain_primitives::primitives::{Id as ParaId, Sibling};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::{
Expand Down Expand Up @@ -51,7 +51,7 @@ use xcm_simulator::{
XcmpMessageHandlerT as XcmpMessageHandler,
};

pub type AccountId = moonbeam_core_primitives::AccountId;
pub type AccountId = AccountId;
pub type Balance = u128;
pub type AssetId = u128;
pub type BlockNumber = BlockNumberFor<Runtime>;
Expand Down Expand Up @@ -315,7 +315,6 @@ parameter_types! {
use frame_system::RawOrigin;
use sp_runtime::{traits::PostDispatchInfoOf, DispatchErrorWithPostInfo};
use xcm_executor::traits::CallDispatcher;
moonbeam_runtime_common::impl_moonbeam_xcm_call!();

pub struct XcmConfig;
impl Config for XcmConfig {
Expand All @@ -326,7 +325,8 @@ impl Config for XcmConfig {
type AssetTransactor = AssetTransactors;
type AssetTrap = PolkadotXcm;
type Barrier = XcmBarrier;
type CallDispatcher = MoonbeamCall;
type CallDispatcher = ();
//TODO
type FeeManager = ();
type IsReserve = orml_xcm_support::MultiNativeAsset<
xcm_primitives::AbsoluteAndRelativeReserve<SelfLocationAbsolute>,
Expand Down Expand Up @@ -958,8 +958,6 @@ pub enum ProxyType {
Any = 1,
}

impl pallet_evm_precompile_proxy::EvmProxyCallFilter for ProxyType {}

impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, _c: &RuntimeCall) -> bool {
match self {
Expand Down Expand Up @@ -1015,15 +1013,6 @@ impl xcm_primitives::EnsureProxy<AccountId> for EthereumXcmEnsureProxy {
}
}

impl pallet_ethereum_xcm::Config for Runtime {
type ControllerOrigin = EnsureRoot<AccountId>;
type EnsureProxy = EthereumXcmEnsureProxy;
type InvalidEvmTransactionError = pallet_ethereum::InvalidTransactionWrapper;
type ReservedXcmpWeight = ReservedXcmpWeight;
type ValidatedTransaction = pallet_ethereum::ValidatedTransaction<Self>;
type XcmEthereumOrigin = pallet_ethereum_xcm::EnsureXcmEthereumTransaction;
}

type Block = frame_system::mocking::MockBlockU32<Runtime>;

construct_runtime!(
Expand All @@ -1045,7 +1034,6 @@ construct_runtime!(
Timestamp: pallet_timestamp,
EVM: pallet_evm,
Ethereum: pallet_ethereum,
EthereumXcm: pallet_ethereum_xcm,
}
);

Expand Down
2 changes: 1 addition & 1 deletion evm-template/runtime/tests/xcm_mock/relay_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use frame_support::{
weights::{Weight, WeightMeter},
};
use frame_system::pallet_prelude::BlockNumberFor;
use polkadot_parachain::primitives::Id as ParaId;
use polkadot_parachain_primitives::primitives::Id as ParaId;
use polkadot_runtime_parachains::{
configuration, dmp, hrmp,
inclusion::{AggregateMessageOrigin, UmpQueueId},
Expand Down
2 changes: 1 addition & 1 deletion evm-template/runtime/tests/xcm_mock/statemint_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use frame_support::{
};
use frame_system::{EnsureRoot, EnsureSigned};
use polkadot_core_primitives::BlockNumber as RelayBlockNumber;
use polkadot_parachain::primitives::{Id as ParaId, Sibling};
use polkadot_parachain_primitives::primitives::{Id as ParaId, Sibling};
use sp_core::H256;
use sp_runtime::{
traits::{ConstU32, Hash, IdentityLookup},
Expand Down

0 comments on commit fd11b53

Please sign in to comment.