diff --git a/Cargo.lock b/Cargo.lock index f898ed235..c09b8391b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14358,6 +14358,7 @@ dependencies = [ "pallet-balances", "pallet-xcm", "parity-scale-codec", + "pendulum-runtime", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", diff --git a/runtime/integration-tests/pendulum/Cargo.toml b/runtime/integration-tests/pendulum/Cargo.toml index 5d16aadf4..930184425 100644 --- a/runtime/integration-tests/pendulum/Cargo.toml +++ b/runtime/integration-tests/pendulum/Cargo.toml @@ -28,3 +28,5 @@ polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" } polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.37" } + +pendulum-runtime = { path = "../../pendulum"} diff --git a/runtime/integration-tests/pendulum/src/lib.rs b/runtime/integration-tests/pendulum/src/lib.rs index 5bfa146a0..7dcd384b5 100644 --- a/runtime/integration-tests/pendulum/src/lib.rs +++ b/runtime/integration-tests/pendulum/src/lib.rs @@ -8,23 +8,14 @@ use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chai pub const ALICE: sp_runtime::AccountId32 = sp_runtime::AccountId32::new([0u8; 32]); pub const INITIAL_BALANCE: u128 = 1_000_000_000; -// decl_test_parachain! { -// pub struct ParaA { -// Runtime = parachain::Runtime, -// XcmpMessageHandler = parachain::MsgQueue, -// DmpMessageHandler = parachain::MsgQueue, -// new_ext = para_ext(1), -// } -// } - -// decl_test_parachain! { -// pub struct ParaB { -// Runtime = parachain::Runtime, -// XcmpMessageHandler = parachain::MsgQueue, -// DmpMessageHandler = parachain::MsgQueue, -// new_ext = para_ext(2), -// } -// } +decl_test_parachain! { + pub struct PendulumParachain { + Runtime = pendulum_runtime::Runtime, + XcmpMessageHandler = pendulum_runtime::XcmpQueue, + DmpMessageHandler = pendulum_runtime::DmpQueue, + new_ext = para_ext(1), + } +} decl_test_relay_chain! { pub struct Relay { @@ -38,8 +29,8 @@ decl_test_network! { pub struct MockNet { relay_chain = Relay, parachains = vec![ - // (1, ParaA), - // (2, ParaB), + (1, PendulumParachain), + // (2, Statemint), ], } } @@ -48,22 +39,22 @@ decl_test_network! { // ParaId::from(id).into_account_truncating() // } -// pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { -// use parachain::{MsgQueue, Runtime, System}; +pub fn para_ext(para_id: u32) -> sp_io::TestExternalities { + use pendulum_runtime::{Runtime, System}; -// let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); -// pallet_balances::GenesisConfig:: { balances: vec![(ALICE, INITIAL_BALANCE)] } -// .assimilate_storage(&mut t) -// .unwrap(); + pallet_balances::GenesisConfig:: { balances: vec![(ALICE, INITIAL_BALANCE)] } + .assimilate_storage(&mut t) + .unwrap(); -// let mut ext = sp_io::TestExternalities::new(t); -// ext.execute_with(|| { -// System::set_block_number(1); -// MsgQueue::set_para_id(para_id.into()); -// }); -// ext -// } + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| { + System::set_block_number(1); + // MsgQueue::set_para_id(para_id.into()); + }); + ext +} pub fn relay_ext() -> sp_io::TestExternalities { // use relay_chain::{Runtime, System};