mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +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:
@@ -15,10 +15,6 @@
|
||||
|
||||
//! Module contains predefined test-case scenarios for `Runtime` with various assets.
|
||||
|
||||
use crate::{
|
||||
assert_metadata, assert_total, AccountIdOf, BalanceOf, ExtBuilder, RuntimeHelper,
|
||||
SessionKeysOf, ValidatorIdOf, XcmReceivedFrom,
|
||||
};
|
||||
use codec::Encode;
|
||||
use frame_support::{
|
||||
assert_noop, assert_ok,
|
||||
@@ -26,6 +22,10 @@ use frame_support::{
|
||||
weights::Weight,
|
||||
};
|
||||
use parachains_common::Balance;
|
||||
use parachains_runtimes_test_utils::{
|
||||
assert_metadata, assert_total, AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder,
|
||||
RuntimeHelper, ValidatorIdOf, XcmReceivedFrom,
|
||||
};
|
||||
use sp_runtime::{
|
||||
traits::{StaticLookup, Zero},
|
||||
DispatchError, Saturating,
|
||||
@@ -33,35 +33,6 @@ use sp_runtime::{
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_executor::{traits::Convert, XcmExecutor};
|
||||
|
||||
pub struct CollatorSessionKeys<
|
||||
Runtime: frame_system::Config + pallet_balances::Config + pallet_session::Config,
|
||||
> {
|
||||
collator: AccountIdOf<Runtime>,
|
||||
validator: ValidatorIdOf<Runtime>,
|
||||
key: SessionKeysOf<Runtime>,
|
||||
}
|
||||
|
||||
impl<Runtime: frame_system::Config + pallet_balances::Config + pallet_session::Config>
|
||||
CollatorSessionKeys<Runtime>
|
||||
{
|
||||
pub fn new(
|
||||
collator: AccountIdOf<Runtime>,
|
||||
validator: ValidatorIdOf<Runtime>,
|
||||
key: SessionKeysOf<Runtime>,
|
||||
) -> Self {
|
||||
Self { collator, validator, key }
|
||||
}
|
||||
pub fn collators(&self) -> Vec<AccountIdOf<Runtime>> {
|
||||
vec![self.collator.clone()]
|
||||
}
|
||||
|
||||
pub fn session_keys(
|
||||
&self,
|
||||
) -> Vec<(AccountIdOf<Runtime>, ValidatorIdOf<Runtime>, SessionKeysOf<Runtime>)> {
|
||||
vec![(self.collator.clone(), self.validator.clone(), self.key.clone())]
|
||||
}
|
||||
}
|
||||
|
||||
/// Test-case makes sure that `Runtime` can receive native asset from relay chain
|
||||
/// and can teleport it back and to the other parachains
|
||||
pub fn teleports_for_native_asset_works<
|
||||
|
||||
Reference in New Issue
Block a user