mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 16:21:02 +00:00
BridgeHub[Rococo/Wococo] test batched relaying of messages and their dispatch (#2578)
Added some tests that aim to cover the runtime configuration that is exercised when BH receives relayed complex message. * checks correct importing of proofs for: bridged chain finality, bridged para heads, bridged messages, * checks relayer extension correctly configured to reward submitting relayer, * checks relayed message is successfully dispatched. Also moved generic test-utils from `asset-test-utils: parachains/runtimes/assets/test-utils` one level up to new crate `parachains-runtimes-test-utils: parachains/runtimes/test-utils` to be reused by BridgeHubs. Signed-off-by: acatangiu <adrian@parity.io> Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use asset_test_utils::{ExtBuilder, RuntimeHelper};
|
||||
use asset_test_utils::{CollatorSessionKeys, ExtBuilder, RuntimeHelper};
|
||||
use codec::{Decode, Encode};
|
||||
use cumulus_primitives_utility::ChargeWeightInFungibles;
|
||||
use frame_support::{
|
||||
@@ -26,6 +26,14 @@ const SOME_ASSET_ADMIN: [u8; 32] = [5u8; 32];
|
||||
type AssetIdForTrustBackedAssetsConvert =
|
||||
assets_common::AssetIdForTrustBackedAssetsConvert<TrustBackedAssetsPalletLocation>;
|
||||
|
||||
fn collator_session_keys() -> CollatorSessionKeys<Runtime> {
|
||||
CollatorSessionKeys::new(
|
||||
AccountId::from(ALICE),
|
||||
AccountId::from(ALICE),
|
||||
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_asset_xcm_trader() {
|
||||
ExtBuilder::<Runtime>::default()
|
||||
@@ -472,11 +480,7 @@ asset_test_utils::include_teleports_for_native_asset_works!(
|
||||
CheckingAccount,
|
||||
WeightToFee,
|
||||
ParachainSystem,
|
||||
asset_test_utils::CollatorSessionKeys::new(
|
||||
AccountId::from(ALICE),
|
||||
AccountId::from(ALICE),
|
||||
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }
|
||||
),
|
||||
collator_session_keys(),
|
||||
ExistentialDeposit::get(),
|
||||
Box::new(|runtime_event_encoded: Vec<u8>| {
|
||||
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
|
||||
@@ -501,11 +505,7 @@ asset_test_utils::include_teleports_for_foreign_assets_works!(
|
||||
ParachainSystem,
|
||||
ForeignCreatorsSovereignAccountOf,
|
||||
ForeignAssetsInstance,
|
||||
asset_test_utils::CollatorSessionKeys::new(
|
||||
AccountId::from(ALICE),
|
||||
AccountId::from(ALICE),
|
||||
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }
|
||||
),
|
||||
collator_session_keys(),
|
||||
ExistentialDeposit::get(),
|
||||
Box::new(|runtime_event_encoded: Vec<u8>| {
|
||||
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
|
||||
@@ -524,11 +524,7 @@ asset_test_utils::include_teleports_for_foreign_assets_works!(
|
||||
asset_test_utils::include_asset_transactor_transfer_with_local_consensus_currency_works!(
|
||||
Runtime,
|
||||
XcmConfig,
|
||||
asset_test_utils::CollatorSessionKeys::new(
|
||||
AccountId::from(ALICE),
|
||||
AccountId::from(ALICE),
|
||||
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }
|
||||
),
|
||||
collator_session_keys(),
|
||||
ExistentialDeposit::get(),
|
||||
Box::new(|| {
|
||||
assert!(Assets::asset_ids().collect::<Vec<_>>().is_empty());
|
||||
@@ -547,11 +543,7 @@ asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_
|
||||
TrustBackedAssetsInstance,
|
||||
AssetIdForTrustBackedAssets,
|
||||
AssetIdForTrustBackedAssetsConvert,
|
||||
asset_test_utils::CollatorSessionKeys::new(
|
||||
AccountId::from(ALICE),
|
||||
AccountId::from(ALICE),
|
||||
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }
|
||||
),
|
||||
collator_session_keys(),
|
||||
ExistentialDeposit::get(),
|
||||
12345,
|
||||
Box::new(|| {
|
||||
@@ -569,11 +561,7 @@ asset_test_utils::include_asset_transactor_transfer_with_pallet_assets_instance_
|
||||
ForeignAssetsInstance,
|
||||
MultiLocation,
|
||||
JustTry,
|
||||
asset_test_utils::CollatorSessionKeys::new(
|
||||
AccountId::from(ALICE),
|
||||
AccountId::from(ALICE),
|
||||
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }
|
||||
),
|
||||
collator_session_keys(),
|
||||
ExistentialDeposit::get(),
|
||||
MultiLocation { parents: 1, interior: X2(Parachain(1313), GeneralIndex(12345)) },
|
||||
Box::new(|| {
|
||||
@@ -592,11 +580,7 @@ asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_p
|
||||
ForeignAssetsInstance,
|
||||
MultiLocation,
|
||||
JustTry,
|
||||
asset_test_utils::CollatorSessionKeys::new(
|
||||
AccountId::from(ALICE),
|
||||
AccountId::from(ALICE),
|
||||
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }
|
||||
),
|
||||
collator_session_keys(),
|
||||
ExistentialDeposit::get(),
|
||||
AssetDeposit::get(),
|
||||
MetadataDepositBase::get(),
|
||||
|
||||
Reference in New Issue
Block a user