Skip to content

Commit

Permalink
2 more errors some incorrect usage of runtime origin not yet debugged
Browse files Browse the repository at this point in the history
  • Loading branch information
4meta5 committed Jan 3, 2025
1 parent 4b1dba7 commit 133d428
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 13 additions & 3 deletions evm-template/runtime/tests/xcm_mock/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub mod parachain;
pub mod relay_chain;

use openzeppelin_pallet_abstractions::XcmConfig;
use sp_runtime::BuildStorage;
use sp_tracing;
use xcm::prelude::*;
Expand Down Expand Up @@ -53,7 +54,10 @@ decl_test_network! {

pub fn parent_account_id() -> parachain::AccountId {
let location = (Parent,);
parachain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
<parachain::OpenZeppelinRuntime as XcmConfig>::AccountIdToLocation::convert_location(
&location.into(),
)
.unwrap()
}

pub fn child_account_id(para: u32) -> relay_chain::AccountId {
Expand All @@ -68,12 +72,18 @@ pub fn child_account_account_id(para: u32, who: sp_runtime::AccountId32) -> rela

pub fn sibling_account_account_id(para: u32, who: sp_runtime::AccountId32) -> parachain::AccountId {
let location = (Parent, Parachain(para), AccountId32 { network: None, id: who.into() });
parachain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
<parachain::OpenZeppelinRuntime as XcmConfig>::AccountIdToLocation::convert_location(
&location.into(),
)
.unwrap()
}

pub fn parent_account_account_id(who: sp_runtime::AccountId32) -> parachain::AccountId {
let location = (Parent, AccountId32 { network: None, id: who.into() });
parachain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
<parachain::OpenZeppelinRuntime as XcmConfig>::AccountIdToLocation::convert_location(
&location.into(),
)
.unwrap()
}

pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
Expand Down
3 changes: 3 additions & 0 deletions evm-template/runtime/tests/xcm_mock/parachain/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use core::marker::PhantomData;

use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use evm_runtime_template::{
configs::{
Expand Down Expand Up @@ -54,6 +55,8 @@ impl frame_system::Config for Runtime {
type AccountId = AccountId;
type Block = Block;
type Lookup = IdentityLookup<Self::AccountId>;
// The action to take on a Runtime Upgrade
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
}

#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
Expand Down

0 comments on commit 133d428

Please sign in to comment.