Refactoring Checkpoint: (WIP)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "bridge-hub-test-utils"
|
||||
name = "pezbridge-hub-test-utils"
|
||||
version = "0.7.0"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
@@ -7,7 +7,7 @@ description = "Utils for BridgeHub testing"
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
documentation = "https://docs.rs/bridge-hub-test-utils"
|
||||
documentation = "https://docs.rs/pezbridge-hub-test-utils"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -31,7 +31,7 @@ pezsp-std = { workspace = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
|
||||
# Pezcumulus
|
||||
asset-test-utils = { workspace = true, default-features = true }
|
||||
asset-test-pezutils = { workspace = true, default-features = true }
|
||||
pezcumulus-pezpallet-teyrchain-system = { workspace = true }
|
||||
pezcumulus-pezpallet-xcmp-queue = { workspace = true }
|
||||
teyrchains-common = { workspace = true }
|
||||
@@ -44,11 +44,11 @@ xcm-builder = { workspace = true }
|
||||
xcm-executor = { workspace = true }
|
||||
|
||||
# Bridges
|
||||
bp-header-chain = { workspace = true }
|
||||
bp-header-pez-chain = { workspace = true }
|
||||
bp-messages = { workspace = true }
|
||||
bp-pezkuwi-core = { workspace = true }
|
||||
bp-relayers = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
pezbp-runtime = { workspace = true }
|
||||
bp-test-utils = { workspace = true }
|
||||
bp-teyrchains = { workspace = true }
|
||||
pezpallet-bridge-grandpa = { workspace = true }
|
||||
@@ -60,12 +60,12 @@ pezpallet-xcm-bridge-hub = { workspace = true }
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"asset-test-utils/std",
|
||||
"bp-header-chain/std",
|
||||
"asset-test-pezutils/std",
|
||||
"bp-header-pez-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-pezkuwi-core/std",
|
||||
"bp-relayers/std",
|
||||
"bp-runtime/std",
|
||||
"pezbp-runtime/std",
|
||||
"bp-test-utils/std",
|
||||
"bp-teyrchains/std",
|
||||
"codec/std",
|
||||
@@ -94,12 +94,12 @@ std = [
|
||||
"xcm/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"asset-test-utils/runtime-benchmarks",
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"asset-test-pezutils/runtime-benchmarks",
|
||||
"bp-header-pez-chain/runtime-benchmarks",
|
||||
"bp-messages/runtime-benchmarks",
|
||||
"bp-pezkuwi-core/runtime-benchmarks",
|
||||
"bp-relayers/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"pezbp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"bp-teyrchains/runtime-benchmarks",
|
||||
"pezcumulus-pezpallet-teyrchain-system/runtime-benchmarks",
|
||||
|
||||
+5
-5
@@ -24,7 +24,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use alloc::{boxed::Box, vec};
|
||||
use bp_header_chain::ChainWithGrandpa;
|
||||
use bp_header_pez_chain::ChainWithGrandpa;
|
||||
use bp_messages::UnrewardedRelayersState;
|
||||
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
|
||||
use pezframe_support::traits::{OnFinalize, OnInitialize};
|
||||
@@ -44,7 +44,7 @@ use xcm::latest::prelude::*;
|
||||
pub trait WithRemoteGrandpaChainHelper {
|
||||
/// This chain runtime.
|
||||
type Runtime: BasicTeyrchainRuntime
|
||||
+ pezcumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pezpallet_xcmp_queue::Config
|
||||
+ BridgeGrandpaConfig<Self::GPI, BridgedChain = BridgedChainOf<Self::Runtime, Self::MPI>>
|
||||
+ BridgeMessagesConfig<
|
||||
Self::MPI,
|
||||
@@ -74,7 +74,7 @@ impl<Runtime, AllPalletsWithoutSystem, GPI, MPI, RPI> WithRemoteGrandpaChainHelp
|
||||
for WithRemoteGrandpaChainHelperAdapter<Runtime, AllPalletsWithoutSystem, GPI, MPI, RPI>
|
||||
where
|
||||
Runtime: BasicTeyrchainRuntime
|
||||
+ pezcumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pezpallet_xcmp_queue::Config
|
||||
+ BridgeGrandpaConfig<GPI, BridgedChain = BridgedChainOf<Runtime, MPI>>
|
||||
+ BridgeMessagesConfig<
|
||||
MPI,
|
||||
@@ -515,7 +515,7 @@ where
|
||||
RuntimeHelper::Runtime:
|
||||
pezpallet_utility::Config<RuntimeCall = RuntimeCallOf<RuntimeHelper::Runtime>>,
|
||||
ThisChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>:
|
||||
bp_runtime::Chain<AccountId = AccountIdOf<RuntimeHelper::Runtime>>,
|
||||
pezbp_runtime::Chain<AccountId = AccountIdOf<RuntimeHelper::Runtime>>,
|
||||
RuntimeCallOf<RuntimeHelper::Runtime>: From<BridgeGrandpaCall<RuntimeHelper::Runtime, RuntimeHelper::GPI>>
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: ChainWithGrandpa,
|
||||
@@ -617,7 +617,7 @@ where
|
||||
RuntimeHelper: WithRemoteGrandpaChainHelper,
|
||||
AccountIdOf<RuntimeHelper::Runtime>: From<AccountId32>,
|
||||
ThisChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>:
|
||||
bp_runtime::Chain<AccountId = AccountIdOf<RuntimeHelper::Runtime>>,
|
||||
pezbp_runtime::Chain<AccountId = AccountIdOf<RuntimeHelper::Runtime>>,
|
||||
RuntimeCallOf<RuntimeHelper::Runtime>:
|
||||
From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: ChainWithGrandpa,
|
||||
|
||||
+11
-11
@@ -24,11 +24,11 @@ use crate::{
|
||||
};
|
||||
|
||||
use alloc::{boxed::Box, vec};
|
||||
use bp_header_chain::ChainWithGrandpa;
|
||||
use bp_header_pez_chain::ChainWithGrandpa;
|
||||
use bp_messages::UnrewardedRelayersState;
|
||||
use bp_pezkuwi_core::teyrchains::ParaHash;
|
||||
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
|
||||
use bp_runtime::{Chain, Teyrchain};
|
||||
use pezbp_runtime::{Chain, Teyrchain};
|
||||
use pezframe_support::traits::{OnFinalize, OnInitialize};
|
||||
use pezframe_system::pezpallet_prelude::BlockNumberFor;
|
||||
use pezpallet_bridge_messages::{BridgedChainOf, LaneIdOf, ThisChainOf};
|
||||
@@ -46,7 +46,7 @@ use xcm::latest::prelude::*;
|
||||
pub trait WithRemoteTeyrchainHelper {
|
||||
/// This chain runtime.
|
||||
type Runtime: BasicTeyrchainRuntime
|
||||
+ pezcumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pezpallet_xcmp_queue::Config
|
||||
+ BridgeGrandpaConfig<Self::GPI>
|
||||
+ BridgeTeyrchainsConfig<Self::PPI>
|
||||
+ BridgeMessagesConfig<
|
||||
@@ -79,7 +79,7 @@ impl<Runtime, AllPalletsWithoutSystem, GPI, PPI, MPI, RPI> WithRemoteTeyrchainHe
|
||||
for WithRemoteTeyrchainHelperAdapter<Runtime, AllPalletsWithoutSystem, GPI, PPI, MPI, RPI>
|
||||
where
|
||||
Runtime: BasicTeyrchainRuntime
|
||||
+ pezcumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pezpallet_xcmp_queue::Config
|
||||
+ BridgeGrandpaConfig<GPI>
|
||||
+ BridgeTeyrchainsConfig<PPI>
|
||||
+ BridgeMessagesConfig<
|
||||
@@ -129,7 +129,7 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
{
|
||||
helpers::relayed_incoming_message_works::<
|
||||
RuntimeHelper::Runtime,
|
||||
@@ -264,7 +264,7 @@ pub fn free_relay_extrinsic_works<RuntimeHelper>(
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
{
|
||||
// ensure that the runtime allows free header submissions
|
||||
let free_headers_interval = <RuntimeHelper::Runtime as BridgeGrandpaConfig<
|
||||
@@ -433,7 +433,7 @@ pub fn complex_relay_extrinsic_works<RuntimeHelper>(
|
||||
+ From<pezpallet_utility::Call<RuntimeHelper::Runtime>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
{
|
||||
helpers::relayed_incoming_message_works::<
|
||||
RuntimeHelper::Runtime,
|
||||
@@ -560,7 +560,7 @@ where
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
@@ -630,7 +630,7 @@ where
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
@@ -694,7 +694,7 @@ where
|
||||
From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
@@ -755,7 +755,7 @@ where
|
||||
From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
use crate::test_cases::{bridges_prelude::*, run_test, RuntimeHelper};
|
||||
|
||||
use asset_test_utils::BasicTeyrchainRuntime;
|
||||
use asset_test_pezutils::BasicTeyrchainRuntime;
|
||||
use bp_messages::MessageNonce;
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaId};
|
||||
use bp_runtime::Chain;
|
||||
use pezbp_runtime::Chain;
|
||||
use codec::Decode;
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_support::{
|
||||
@@ -228,10 +228,10 @@ where
|
||||
|
||||
/// Initialize bridge GRANDPA pallet.
|
||||
pub(crate) fn initialize_bridge_grandpa_pallet<Runtime, GPI>(
|
||||
init_data: bp_header_chain::InitializationData<BridgedHeader<Runtime, GPI>>,
|
||||
init_data: bp_header_pez_chain::InitializationData<BridgedHeader<Runtime, GPI>>,
|
||||
) where
|
||||
Runtime: BridgeGrandpaConfig<GPI>
|
||||
+ pezcumulus_pallet_teyrchain_system::Config
|
||||
+ pezcumulus_pezpallet_teyrchain_system::Config
|
||||
+ pezpallet_timestamp::Config,
|
||||
{
|
||||
pezpallet_bridge_grandpa::Pallet::<Runtime, GPI>::initialize(
|
||||
@@ -245,7 +245,7 @@ pub(crate) fn initialize_bridge_grandpa_pallet<Runtime, GPI>(
|
||||
pub type CallsAndVerifiers<Runtime> =
|
||||
Vec<(RuntimeCallOf<Runtime>, Box<dyn VerifyTransactionOutcome>)>;
|
||||
|
||||
pub type InboundRelayerId<Runtime, MPI> = bp_runtime::AccountIdOf<BridgedChainOf<Runtime, MPI>>;
|
||||
pub type InboundRelayerId<Runtime, MPI> = pezbp_runtime::AccountIdOf<BridgedChainOf<Runtime, MPI>>;
|
||||
|
||||
/// Returns relayer id at the bridged chain.
|
||||
pub fn relayer_id_at_bridged_chain<Runtime: pezpallet_bridge_messages::Config<MPI>, MPI>(
|
||||
@@ -271,10 +271,10 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
InteriorLocation,
|
||||
MessageNonce,
|
||||
Xcm<()>,
|
||||
bp_runtime::ChainId,
|
||||
pezbp_runtime::ChainId,
|
||||
) -> CallsAndVerifiers<Runtime>,
|
||||
) where
|
||||
Runtime: BasicTeyrchainRuntime + pezcumulus_pallet_xcmp_queue::Config + BridgeMessagesConfig<MPI>,
|
||||
Runtime: BasicTeyrchainRuntime + pezcumulus_pezpallet_xcmp_queue::Config + BridgeMessagesConfig<MPI>,
|
||||
AllPalletsWithoutSystem:
|
||||
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
|
||||
MPI: 'static,
|
||||
@@ -307,7 +307,7 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
2,
|
||||
AccountId::from(alice).into(),
|
||||
);
|
||||
mock_open_hrmp_channel::<Runtime, pezcumulus_pallet_teyrchain_system::Pallet<Runtime>>(
|
||||
mock_open_hrmp_channel::<Runtime, pezcumulus_pezpallet_teyrchain_system::Pallet<Runtime>>(
|
||||
runtime_para_id.into(),
|
||||
sibling_teyrchain_id.into(),
|
||||
included_head,
|
||||
@@ -351,7 +351,7 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
|
||||
// verify that imported XCM contains original message
|
||||
let imported_xcm =
|
||||
RuntimeHelper::<pezcumulus_pallet_xcmp_queue::Pallet<Runtime>>::take_xcm(
|
||||
RuntimeHelper::<pezcumulus_pezpallet_xcmp_queue::Pallet<Runtime>>::take_xcm(
|
||||
sibling_teyrchain_id.into(),
|
||||
)
|
||||
.unwrap();
|
||||
@@ -401,7 +401,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
Runtime: BasicTeyrchainRuntime + BridgeXcmOverBridgeConfig<XcmOverBridgePalletInstance>,
|
||||
XcmOverBridgePalletInstance: 'static,
|
||||
<Runtime as pezframe_system::Config>::RuntimeCall: GetDispatchInfo + From<BridgeXcmOverBridgeCall<Runtime, XcmOverBridgePalletInstance>>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as bp_runtime::Chain>::Balance>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as pezbp_runtime::Chain>::Balance>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<u128>,
|
||||
LocationToAccountId: ConvertLocation<AccountIdOf<Runtime>>,
|
||||
TokenLocation: Get<Location>
|
||||
@@ -473,7 +473,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
) where
|
||||
Runtime: pezframe_system::Config
|
||||
+ pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>
|
||||
+ pezcumulus_pallet_teyrchain_system::Config
|
||||
+ pezcumulus_pezpallet_teyrchain_system::Config
|
||||
+ pezpallet_xcm::Config,
|
||||
XcmOverBridgePalletInstance: 'static,
|
||||
<Runtime as pezframe_system::Config>::RuntimeCall:
|
||||
@@ -527,7 +527,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
Runtime: BasicTeyrchainRuntime + BridgeXcmOverBridgeConfig<XcmOverBridgePalletInstance>,
|
||||
XcmOverBridgePalletInstance: 'static,
|
||||
<Runtime as pezframe_system::Config>::RuntimeCall: GetDispatchInfo + From<BridgeXcmOverBridgeCall<Runtime, XcmOverBridgePalletInstance>>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as bp_runtime::Chain>::Balance>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as pezbp_runtime::Chain>::Balance>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<u128>,
|
||||
LocationToAccountId: ConvertLocation<AccountIdOf<Runtime>>,
|
||||
TokenLocation: Get<Location>
|
||||
|
||||
@@ -26,12 +26,12 @@ pub(crate) mod helpers;
|
||||
|
||||
use crate::{test_cases::bridges_prelude::*, test_data};
|
||||
|
||||
use asset_test_utils::BasicTeyrchainRuntime;
|
||||
use asset_test_pezutils::BasicTeyrchainRuntime;
|
||||
use bp_messages::{
|
||||
target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch},
|
||||
LaneState, MessageKey, MessagesOperatingMode, OutboundLaneData,
|
||||
};
|
||||
use bp_runtime::BasicOperatingMode;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use codec::Encode;
|
||||
use pezframe_support::{
|
||||
assert_ok,
|
||||
@@ -68,7 +68,7 @@ pub(crate) mod bridges_prelude {
|
||||
pub use for_pallet_xcm_bridge_hub::open_and_close_bridge_works;
|
||||
|
||||
// Re-export test_case from assets
|
||||
pub use asset_test_utils::include_teleports_for_native_asset_works;
|
||||
pub use asset_test_pezutils::include_teleports_for_native_asset_works;
|
||||
use pezpallet_bridge_messages::LaneIdOf;
|
||||
|
||||
pub type RuntimeHelper<Runtime, AllPalletsWithoutSystem = ()> =
|
||||
@@ -432,16 +432,16 @@ pub fn message_dispatch_routing_works<
|
||||
slot_durations: SlotDurations,
|
||||
runtime_para_id: u32,
|
||||
sibling_teyrchain_id: u32,
|
||||
unwrap_pezcumulus_pallet_teyrchain_system_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<pezcumulus_pallet_teyrchain_system::Event<Runtime>>,
|
||||
unwrap_pezcumulus_pezpallet_teyrchain_system_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<pezcumulus_pezpallet_teyrchain_system::Event<Runtime>>,
|
||||
>,
|
||||
unwrap_pezcumulus_pallet_xcmp_queue_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<pezcumulus_pallet_xcmp_queue::Event<Runtime>>,
|
||||
unwrap_pezcumulus_pezpallet_xcmp_queue_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<pezcumulus_pezpallet_xcmp_queue::Event<Runtime>>,
|
||||
>,
|
||||
prepare_configuration: impl Fn(),
|
||||
) where
|
||||
Runtime: BasicTeyrchainRuntime
|
||||
+ pezcumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pezpallet_xcmp_queue::Config
|
||||
+ BridgeMessagesConfig<MessagesPalletInstance, InboundPayload = test_data::XcmAsPlainPayload>,
|
||||
AllPalletsWithoutSystem:
|
||||
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
|
||||
@@ -450,7 +450,7 @@ pub fn message_dispatch_routing_works<
|
||||
XcmConfig: xcm_executor::Config,
|
||||
MessagesPalletInstance: 'static,
|
||||
HrmpChannelOpener: pezframe_support::inherent::ProvideInherent<
|
||||
Call = pezcumulus_pallet_teyrchain_system::Call<Runtime>,
|
||||
Call = pezcumulus_pezpallet_teyrchain_system::Call<Runtime>,
|
||||
>,
|
||||
RuntimeNetwork: Get<NetworkId>,
|
||||
BridgedNetwork: Get<NetworkId>,
|
||||
@@ -501,10 +501,10 @@ pub fn message_dispatch_routing_works<
|
||||
// check events - UpwardMessageSent
|
||||
let mut events = <pezframe_system::Pallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pezcumulus_pallet_teyrchain_system_event(e.event.encode()));
|
||||
.filter_map(|e| unwrap_pezcumulus_pezpallet_teyrchain_system_event(e.event.encode()));
|
||||
assert!(events.any(|e| matches!(
|
||||
e,
|
||||
pezcumulus_pallet_teyrchain_system::Event::UpwardMessageSent { .. }
|
||||
pezcumulus_pezpallet_teyrchain_system::Event::UpwardMessageSent { .. }
|
||||
)));
|
||||
|
||||
// 2. this message is sent from other global consensus with destination of this Runtime
|
||||
@@ -536,7 +536,7 @@ pub fn message_dispatch_routing_works<
|
||||
assert_eq!(
|
||||
<pezframe_system::Pallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pezcumulus_pallet_xcmp_queue_event(e.event.encode()))
|
||||
.filter_map(|e| unwrap_pezcumulus_pezpallet_xcmp_queue_event(e.event.encode()))
|
||||
.count(),
|
||||
0
|
||||
);
|
||||
@@ -564,9 +564,9 @@ pub fn message_dispatch_routing_works<
|
||||
// check events - XcmpMessageSent
|
||||
let mut events = <pezframe_system::Pallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pezcumulus_pallet_xcmp_queue_event(e.event.encode()));
|
||||
.filter_map(|e| unwrap_pezcumulus_pezpallet_xcmp_queue_event(e.event.encode()));
|
||||
assert!(
|
||||
events.any(|e| matches!(e, pezcumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }))
|
||||
events.any(|e| matches!(e, pezcumulus_pezpallet_xcmp_queue::Event::XcmpMessageSent { .. }))
|
||||
);
|
||||
})
|
||||
}
|
||||
@@ -681,9 +681,9 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
Runtime: BasicTeyrchainRuntime + BridgeXcmOverBridgeConfig<XcmOverBridgePalletInstance>,
|
||||
XcmOverBridgePalletInstance: 'static,
|
||||
<Runtime as pezframe_system::Config>::RuntimeCall: GetDispatchInfo + From<BridgeXcmOverBridgeCall<Runtime, XcmOverBridgePalletInstance>>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as bp_runtime::Chain>::Balance>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as pezbp_runtime::Chain>::Balance>,
|
||||
<Runtime as pezpallet_balances::Config>::Balance: From<u128>,
|
||||
<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as bp_runtime::Chain>::AccountId: From<<Runtime as pezframe_system::Config>::AccountId>,
|
||||
<<Runtime as pezpallet_bridge_messages::Config<<Runtime as pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>>::BridgeMessagesPalletInstance>>::ThisChain as pezbp_runtime::Chain>::AccountId: From<<Runtime as pezframe_system::Config>::AccountId>,
|
||||
LocationToAccountId: ConvertLocation<AccountIdOf<Runtime>>,
|
||||
TokenLocation: Get<Location>,
|
||||
{
|
||||
|
||||
+4
-4
@@ -23,7 +23,7 @@ use bp_messages::{
|
||||
target_chain::FromBridgedChainMessagesProof, ChainWithMessages, LaneState, MessageNonce,
|
||||
UnrewardedRelayersState,
|
||||
};
|
||||
use bp_runtime::{AccountIdOf, BlockNumberOf, Chain, HeaderOf, UnverifiedStorageProofParams};
|
||||
use pezbp_runtime::{AccountIdOf, BlockNumberOf, Chain, HeaderOf, UnverifiedStorageProofParams};
|
||||
use bp_test_utils::make_default_justification;
|
||||
use codec::Encode;
|
||||
use pezpallet_bridge_grandpa::{BridgedChain, BridgedHeader};
|
||||
@@ -31,9 +31,9 @@ use pezsp_runtime::traits::Header as HeaderT;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
use crate::test_cases::helpers::InboundRelayerId;
|
||||
use bp_header_chain::{justification::GrandpaJustification, ChainWithGrandpa};
|
||||
use bp_header_pez_chain::{justification::GrandpaJustification, ChainWithGrandpa};
|
||||
use bp_messages::{DeliveredMessages, InboundLaneData, UnrewardedRelayer};
|
||||
use bp_runtime::HashOf;
|
||||
use pezbp_runtime::HashOf;
|
||||
use pezpallet_bridge_messages::{
|
||||
messages_generation::{
|
||||
encode_all_messages, encode_lane_data, prepare_message_delivery_storage_proof,
|
||||
@@ -289,7 +289,7 @@ where
|
||||
|
||||
/// Maximal expected `submit_finality_proof` call size.
|
||||
pub fn maximal_expected_submit_finality_proof_call_size<BridgedChain: ChainWithGrandpa>() -> usize {
|
||||
bp_header_chain::max_expected_submit_finality_proof_arguments_size::<BridgedChain>(
|
||||
bp_header_pez_chain::max_expected_submit_finality_proof_arguments_size::<BridgedChain>(
|
||||
false,
|
||||
BridgedChain::MAX_AUTHORITIES_COUNT * 2 / 3 + 1,
|
||||
) as usize
|
||||
|
||||
+11
-11
@@ -26,7 +26,7 @@ use bp_messages::{
|
||||
target_chain::FromBridgedChainMessagesProof, ChainWithMessages, LaneState,
|
||||
UnrewardedRelayersState, Weight,
|
||||
};
|
||||
use bp_runtime::{
|
||||
use pezbp_runtime::{
|
||||
AccountIdOf, BlockNumberOf, Chain, HeaderOf, Teyrchain, UnverifiedStorageProofParams,
|
||||
};
|
||||
use bp_test_utils::prepare_teyrchain_heads_proof;
|
||||
@@ -37,7 +37,7 @@ use pezsp_runtime::traits::Header as HeaderT;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
use crate::test_cases::helpers::InboundRelayerId;
|
||||
use bp_header_chain::{justification::GrandpaJustification, ChainWithGrandpa};
|
||||
use bp_header_pez_chain::{justification::GrandpaJustification, ChainWithGrandpa};
|
||||
use bp_messages::{DeliveredMessages, InboundLaneData, MessageNonce, UnrewardedRelayer};
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId};
|
||||
use pezpallet_bridge_messages::{
|
||||
@@ -67,9 +67,9 @@ where
|
||||
PPI: 'static,
|
||||
MPI: 'static,
|
||||
ParaHash: From<
|
||||
<<Runtime as pezpallet_bridge_grandpa::Config<GPI>>::BridgedChain as bp_runtime::Chain>::Hash,
|
||||
<<Runtime as pezpallet_bridge_grandpa::Config<GPI>>::BridgedChain as pezbp_runtime::Chain>::Hash,
|
||||
>,
|
||||
<<Runtime as pezpallet_bridge_grandpa::Config<GPI>>::BridgedChain as bp_runtime::Chain>::Hash:
|
||||
<<Runtime as pezpallet_bridge_grandpa::Config<GPI>>::BridgedChain as pezbp_runtime::Chain>::Hash:
|
||||
From<ParaHash>,
|
||||
BridgedChainOf<Runtime, MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<Runtime as pezpallet_utility::Config>::RuntimeCall: From<pezpallet_bridge_grandpa::Call<Runtime, GPI>>
|
||||
@@ -120,7 +120,7 @@ where
|
||||
PPI: 'static,
|
||||
MPI: 'static,
|
||||
<Runtime as pezpallet_bridge_grandpa::Config<GPI>>::BridgedChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedChainOf<Runtime, MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<Runtime as pezpallet_utility::Config>::RuntimeCall: From<pezpallet_bridge_grandpa::Call<Runtime, GPI>>
|
||||
+ From<pezpallet_bridge_teyrchains::Call<Runtime, PPI>>
|
||||
@@ -217,8 +217,8 @@ pub fn make_complex_relayer_delivery_proofs<
|
||||
)
|
||||
where
|
||||
BridgedRelayChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedTeyrchain: bp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedTeyrchain: pezbp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
ThisChainWithMessages: ChainWithMessages,
|
||||
LaneId: Copy + Encode,
|
||||
{
|
||||
@@ -288,8 +288,8 @@ pub fn make_complex_relayer_confirmation_proofs<
|
||||
)
|
||||
where
|
||||
BridgedRelayChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedTeyrchain: bp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedTeyrchain: pezbp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
ThisChainWithMessages: ChainWithMessages,
|
||||
LaneId: Copy + Encode,
|
||||
{
|
||||
@@ -353,8 +353,8 @@ pub fn make_complex_bridged_teyrchain_heads_proof<BridgedRelayChain, BridgedTeyr
|
||||
)
|
||||
where
|
||||
BridgedRelayChain:
|
||||
bp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedTeyrchain: bp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedTeyrchain: pezbp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
{
|
||||
let bridged_para_head = ParaHead(
|
||||
bp_test_utils::test_header_with_root::<HeaderOf<BridgedTeyrchain>>(
|
||||
|
||||
@@ -29,7 +29,7 @@ use pezpallet_bridge_grandpa::BridgedHeader;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
use bp_messages::MessageNonce;
|
||||
use bp_runtime::BasicOperatingMode;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use bp_test_utils::authority_list;
|
||||
use xcm::GetVersion;
|
||||
use xcm_builder::{BridgeMessage, HaulBlob, HaulBlobError, HaulBlobExporter};
|
||||
@@ -53,8 +53,8 @@ pub fn initialization_data<
|
||||
GrandpaPalletInstance: 'static,
|
||||
>(
|
||||
block_number: u32,
|
||||
) -> bp_header_chain::InitializationData<BridgedHeader<Runtime, GrandpaPalletInstance>> {
|
||||
bp_header_chain::InitializationData {
|
||||
) -> bp_header_pez_chain::InitializationData<BridgedHeader<Runtime, GrandpaPalletInstance>> {
|
||||
bp_header_pez_chain::InitializationData {
|
||||
header: Box::new(bp_test_utils::test_header(block_number.into())),
|
||||
authority_list: authority_list(),
|
||||
set_id: 1,
|
||||
|
||||
Reference in New Issue
Block a user