diff --git a/smoketest/.gitignore b/smoketest/.gitignore index 5a6a269397..e40652197b 100644 --- a/smoketest/.gitignore +++ b/smoketest/.gitignore @@ -15,5 +15,4 @@ src/parachains/assethub.rs src/parachains/bridgehub.rs src/parachains/penpal.rs src/parachains/relaychain.rs -src/parachains/template.rs src/contracts diff --git a/smoketest/src/constants.rs b/smoketest/src/constants.rs index 7b4ee0e105..0c2ed43cb9 100644 --- a/smoketest/src/constants.rs +++ b/smoketest/src/constants.rs @@ -29,9 +29,9 @@ pub const BRIDGE_HUB_AGENT_ID: [u8; 32] = // Agent for asset hub parachain 1000 pub const ASSET_HUB_AGENT_ID: [u8; 32] = hex!("72456f48efed08af20e5b317abf8648ac66e86bb90a411d9b0b713f7364b75b4"); -// Agent for template parachain 1001 +// Agent for penpal parachain 2000 pub const SIBLING_AGENT_ID: [u8; 32] = - hex!("e01018a3378502770faff44fbef3910d120a0353d18be653625b8daa88a86453"); + hex!("5097ee1101e90c3aadb882858c59a22108668021ec81bce9f4930155e5c21e59"); pub const ASSET_HUB_SOVEREIGN: [u8; 32] = hex!("7369626ce8030000000000000000000000000000000000000000000000000000"); diff --git a/smoketest/src/helper.rs b/smoketest/src/helper.rs index 9c4af585f3..15abb1fa37 100644 --- a/smoketest/src/helper.rs +++ b/smoketest/src/helper.rs @@ -31,8 +31,8 @@ use crate::{ VersionedXcm as RelaychainVersionedXcm, }, }, - template::{ - api::runtime_types as templateTypes, + penpal::{ + api::runtime_types as penpalTypes, {self}, }, }, @@ -53,28 +53,16 @@ use subxt::{ tx::{PairSigner, TxPayload}, Config, OnlineClient, PolkadotConfig, SubstrateConfig, }; -use templateTypes::{ +use penpalTypes::{ staging_xcm::v3::multilocation::MultiLocation, xcm::{ v3::{junction::Junction, junctions::Junctions}, VersionedMultiLocation, VersionedXcm, }, + pallet_xcm::pallet::Call, + penpal_runtime::RuntimeCall }; -/// Custom config that works with TemplateParachain -pub enum TemplateConfig {} - -impl Config for TemplateConfig { - type Index = ::Index; - type Hash = ::Hash; - type AccountId = ::AccountId; - type Address = ::Address; - type Signature = ::Signature; - type Hasher = ::Hasher; - type Header = ::Header; - type ExtrinsicParams = ::ExtrinsicParams; -} - /// Custom config that works with Penpal pub enum PenpalConfig {} @@ -106,7 +94,6 @@ impl Config for AssetHubConfig { pub struct TestClients { pub asset_hub_client: Box>, pub bridge_hub_client: Box>, - pub template_client: Box>, pub penpal_client: Box>, pub relaychain_client: Box>, pub ethereum_client: Box>>, @@ -122,11 +109,6 @@ pub async fn initial_clients() -> Result .await .expect("can not connect to bridgehub"); - let template_client: OnlineClient = - OnlineClient::from_url(TEMPLATE_NODE_WS_URL) - .await - .expect("can not connect to template parachain"); - let penpal_client: OnlineClient = OnlineClient::from_url(PENPAL_WS_URL) .await .expect("can not connect to penpal parachain"); @@ -148,7 +130,6 @@ pub async fn initial_clients() -> Result Ok(TestClients { asset_hub_client: Box::new(asset_hub_client), bridge_hub_client: Box::new(bridge_hub_client), - template_client: Box::new(template_client), penpal_client: Box::new(penpal_client), relaychain_client: Box::new(relaychain_client), ethereum_client: Box::new(ethereum_client), @@ -207,24 +188,24 @@ pub async fn wait_for_ethereum_event(ethereum_client: &Box>, +pub async fn send_sudo_xcm_transact( + penpal_client: &Box>, message: Box, -) -> Result, Box> { +) -> Result, Box> { let dest = Box::new(VersionedMultiLocation::V3(MultiLocation { parents: 1, interior: Junctions::X1(Junction::Parachain(BRIDGE_HUB_PARA_ID)), })); - let xcm_call = template::api::template_pallet::calls::TransactionApi.send_xcm(*dest, *message); + let sudo_call = penpal::api::sudo::calls::TransactionApi::sudo(&penpal::api::sudo::calls::TransactionApi,RuntimeCall::PolkadotXcm(Call::send { dest, message })); let owner: Pair = Pair::from_string("//Alice", None).expect("cannot create keypair"); - let signer: PairSigner = PairSigner::new(owner); + let signer: PairSigner = PairSigner::new(owner); - let result = template_client + let result = penpal_client .tx() - .sign_and_submit_then_watch_default(&xcm_call, &signer) + .sign_and_submit_then_watch_default(&sudo_call, &signer) .await .expect("send through xcm call.") .wait_for_finalized_success() diff --git a/smoketest/src/parachains/mod.rs b/smoketest/src/parachains/mod.rs index b1195f1820..acadad41d9 100644 --- a/smoketest/src/parachains/mod.rs +++ b/smoketest/src/parachains/mod.rs @@ -2,4 +2,3 @@ pub mod assethub; pub mod bridgehub; pub mod penpal; pub mod relaychain; -pub mod template; diff --git a/smoketest/src/xcm.rs b/smoketest/src/xcm.rs index 1efea9d698..70785456a4 100644 --- a/smoketest/src/xcm.rs +++ b/smoketest/src/xcm.rs @@ -1,10 +1,10 @@ -use crate::parachains::template::api::{ - runtime_types as templateTypes, runtime_types::staging_xcm as templateXcm, +use crate::parachains::penpal::api::{ + runtime_types as penpalTypes, runtime_types::staging_xcm as penpalXcm, }; -use templateTypes::sp_weights::weight_v2::Weight; -use templateXcm::v3::multilocation::MultiLocation; +use penpalTypes::sp_weights::weight_v2::Weight; +use penpalXcm::v3::multilocation::MultiLocation; -use templateTypes::xcm::{ +use penpalTypes::xcm::{ double_encoded::DoubleEncoded, v2::OriginKind, v3::{ diff --git a/smoketest/tests/create_agent.rs b/smoketest/tests/create_agent.rs index e68ecd2784..ffefd28fff 100644 --- a/smoketest/tests/create_agent.rs +++ b/smoketest/tests/create_agent.rs @@ -14,7 +14,7 @@ async fn create_agent() { let message = construct_xcm_message_with_fee(encoded_call).await; - let result = send_xcm_transact(&test_clients.template_client, message) + let result = send_sudo_xcm_transact(&test_clients.penpal_client, message) .await .expect("failed to send xcm transact."); diff --git a/smoketest/tests/create_channel.rs b/smoketest/tests/create_channel.rs index e4f2f4f449..6689950969 100644 --- a/smoketest/tests/create_channel.rs +++ b/smoketest/tests/create_channel.rs @@ -10,11 +10,11 @@ async fn create_channel() { let encoded_call = construct_create_channel_call(&test_clients.bridge_hub_client) .await - .expect("construct innner call."); + .expect("construct inner call."); let message = construct_xcm_message_with_fee(encoded_call).await; - let result = send_xcm_transact(&test_clients.template_client, message) + let result = send_sudo_xcm_transact(&test_clients.penpal_client, message) .await .expect("failed to send xcm transact."); diff --git a/smoketest/tests/transfer_native_from_agent.rs b/smoketest/tests/transfer_native_from_agent.rs index 99e082ce97..8c78cc4c32 100644 --- a/smoketest/tests/transfer_native_from_agent.rs +++ b/smoketest/tests/transfer_native_from_agent.rs @@ -41,7 +41,7 @@ async fn transfer_native_from_agent() { ) .await; - let result = send_xcm_transact(&test_clients.template_client, message) + let result = send_sudo_xcm_transact(&test_clients.penpal_client, message) .await .expect("failed to send xcm transact.");