snapshot before rebranding
This commit is contained in:
@@ -7,6 +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"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -59,67 +60,67 @@ pezpallet-xcm-bridge-hub = { workspace = true }
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"asset-test-utils/std",
|
||||
"bp-header-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-pezkuwi-core/std",
|
||||
"bp-relayers/std",
|
||||
"bp-runtime/std",
|
||||
"bp-test-utils/std",
|
||||
"bp-teyrchains/std",
|
||||
"codec/std",
|
||||
"pezcumulus-pezpallet-teyrchain-system/std",
|
||||
"pezcumulus-pezpallet-xcmp-queue/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"pezpallet-balances/std",
|
||||
"pezpallet-bridge-grandpa/std",
|
||||
"pezpallet-bridge-messages/std",
|
||||
"pezpallet-bridge-relayers/std",
|
||||
"pezpallet-bridge-teyrchains/std",
|
||||
"pezpallet-timestamp/std",
|
||||
"pezpallet-utility/std",
|
||||
"pezpallet-xcm-bridge-hub/std",
|
||||
"pezpallet-xcm/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
"pezsp-std/std",
|
||||
"teyrchains-common/std",
|
||||
"teyrchains-runtimes-test-utils/std",
|
||||
"tracing/std",
|
||||
"xcm-builder/std",
|
||||
"xcm-executor/std",
|
||||
"xcm/std",
|
||||
"asset-test-utils/std",
|
||||
"bp-header-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-pezkuwi-core/std",
|
||||
"bp-relayers/std",
|
||||
"bp-runtime/std",
|
||||
"bp-test-utils/std",
|
||||
"bp-teyrchains/std",
|
||||
"codec/std",
|
||||
"pezcumulus-pezpallet-teyrchain-system/std",
|
||||
"pezcumulus-pezpallet-xcmp-queue/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"pezpallet-balances/std",
|
||||
"pezpallet-bridge-grandpa/std",
|
||||
"pezpallet-bridge-messages/std",
|
||||
"pezpallet-bridge-relayers/std",
|
||||
"pezpallet-bridge-teyrchains/std",
|
||||
"pezpallet-timestamp/std",
|
||||
"pezpallet-utility/std",
|
||||
"pezpallet-xcm-bridge-hub/std",
|
||||
"pezpallet-xcm/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
"pezsp-std/std",
|
||||
"teyrchains-common/std",
|
||||
"teyrchains-runtimes-test-utils/std",
|
||||
"tracing/std",
|
||||
"xcm-builder/std",
|
||||
"xcm-executor/std",
|
||||
"xcm/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"asset-test-utils/runtime-benchmarks",
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"bp-messages/runtime-benchmarks",
|
||||
"bp-pezkuwi-core/runtime-benchmarks",
|
||||
"bp-relayers/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"bp-teyrchains/runtime-benchmarks",
|
||||
"pezcumulus-pezpallet-teyrchain-system/runtime-benchmarks",
|
||||
"pezcumulus-pezpallet-xcmp-queue/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezpallet-bridge-grandpa/runtime-benchmarks",
|
||||
"pezpallet-bridge-messages/runtime-benchmarks",
|
||||
"pezpallet-bridge-relayers/runtime-benchmarks",
|
||||
"pezpallet-bridge-teyrchains/runtime-benchmarks",
|
||||
"pezpallet-timestamp/runtime-benchmarks",
|
||||
"pezpallet-utility/runtime-benchmarks",
|
||||
"pezpallet-xcm-bridge-hub/runtime-benchmarks",
|
||||
"pezpallet-xcm/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
"teyrchains-common/runtime-benchmarks",
|
||||
"teyrchains-runtimes-test-utils/runtime-benchmarks",
|
||||
"xcm-builder/runtime-benchmarks",
|
||||
"xcm-executor/runtime-benchmarks",
|
||||
"xcm/runtime-benchmarks",
|
||||
"asset-test-utils/runtime-benchmarks",
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"bp-messages/runtime-benchmarks",
|
||||
"bp-pezkuwi-core/runtime-benchmarks",
|
||||
"bp-relayers/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"bp-teyrchains/runtime-benchmarks",
|
||||
"pezcumulus-pezpallet-teyrchain-system/runtime-benchmarks",
|
||||
"pezcumulus-pezpallet-xcmp-queue/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezpallet-bridge-grandpa/runtime-benchmarks",
|
||||
"pezpallet-bridge-messages/runtime-benchmarks",
|
||||
"pezpallet-bridge-relayers/runtime-benchmarks",
|
||||
"pezpallet-bridge-teyrchains/runtime-benchmarks",
|
||||
"pezpallet-timestamp/runtime-benchmarks",
|
||||
"pezpallet-utility/runtime-benchmarks",
|
||||
"pezpallet-xcm-bridge-hub/runtime-benchmarks",
|
||||
"pezpallet-xcm/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-keyring/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
"teyrchains-common/runtime-benchmarks",
|
||||
"teyrchains-runtimes-test-utils/runtime-benchmarks",
|
||||
"xcm-builder/runtime-benchmarks",
|
||||
"xcm-executor/runtime-benchmarks",
|
||||
"xcm/runtime-benchmarks",
|
||||
]
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ use xcm::latest::prelude::*;
|
||||
pub trait WithRemoteGrandpaChainHelper {
|
||||
/// This chain runtime.
|
||||
type Runtime: BasicTeyrchainRuntime
|
||||
+ cumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pallet_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
|
||||
+ cumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pallet_xcmp_queue::Config
|
||||
+ BridgeGrandpaConfig<GPI, BridgedChain = BridgedChainOf<Runtime, MPI>>
|
||||
+ BridgeMessagesConfig<
|
||||
MPI,
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ use xcm::latest::prelude::*;
|
||||
pub trait WithRemoteTeyrchainHelper {
|
||||
/// This chain runtime.
|
||||
type Runtime: BasicTeyrchainRuntime
|
||||
+ cumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pallet_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
|
||||
+ cumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pallet_xcmp_queue::Config
|
||||
+ BridgeGrandpaConfig<GPI>
|
||||
+ BridgeTeyrchainsConfig<PPI>
|
||||
+ BridgeMessagesConfig<
|
||||
|
||||
@@ -231,7 +231,7 @@ pub(crate) fn initialize_bridge_grandpa_pallet<Runtime, GPI>(
|
||||
init_data: bp_header_chain::InitializationData<BridgedHeader<Runtime, GPI>>,
|
||||
) where
|
||||
Runtime: BridgeGrandpaConfig<GPI>
|
||||
+ cumulus_pallet_teyrchain_system::Config
|
||||
+ pezcumulus_pallet_teyrchain_system::Config
|
||||
+ pezpallet_timestamp::Config,
|
||||
{
|
||||
pezpallet_bridge_grandpa::Pallet::<Runtime, GPI>::initialize(
|
||||
@@ -274,7 +274,7 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
bp_runtime::ChainId,
|
||||
) -> CallsAndVerifiers<Runtime>,
|
||||
) where
|
||||
Runtime: BasicTeyrchainRuntime + cumulus_pallet_xcmp_queue::Config + BridgeMessagesConfig<MPI>,
|
||||
Runtime: BasicTeyrchainRuntime + pezcumulus_pallet_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, cumulus_pallet_teyrchain_system::Pallet<Runtime>>(
|
||||
mock_open_hrmp_channel::<Runtime, pezcumulus_pallet_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::<cumulus_pallet_xcmp_queue::Pallet<Runtime>>::take_xcm(
|
||||
RuntimeHelper::<pezcumulus_pallet_xcmp_queue::Pallet<Runtime>>::take_xcm(
|
||||
sibling_teyrchain_id.into(),
|
||||
)
|
||||
.unwrap();
|
||||
@@ -473,7 +473,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
) where
|
||||
Runtime: pezframe_system::Config
|
||||
+ pezpallet_xcm_bridge_hub::Config<XcmOverBridgePalletInstance>
|
||||
+ cumulus_pallet_teyrchain_system::Config
|
||||
+ pezcumulus_pallet_teyrchain_system::Config
|
||||
+ pezpallet_xcm::Config,
|
||||
XcmOverBridgePalletInstance: 'static,
|
||||
<Runtime as pezframe_system::Config>::RuntimeCall:
|
||||
|
||||
@@ -432,16 +432,16 @@ pub fn message_dispatch_routing_works<
|
||||
slot_durations: SlotDurations,
|
||||
runtime_para_id: u32,
|
||||
sibling_teyrchain_id: u32,
|
||||
unwrap_cumulus_pallet_teyrchain_system_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<cumulus_pallet_teyrchain_system::Event<Runtime>>,
|
||||
unwrap_pezcumulus_pallet_teyrchain_system_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<pezcumulus_pallet_teyrchain_system::Event<Runtime>>,
|
||||
>,
|
||||
unwrap_cumulus_pallet_xcmp_queue_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<cumulus_pallet_xcmp_queue::Event<Runtime>>,
|
||||
unwrap_pezcumulus_pallet_xcmp_queue_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<pezcumulus_pallet_xcmp_queue::Event<Runtime>>,
|
||||
>,
|
||||
prepare_configuration: impl Fn(),
|
||||
) where
|
||||
Runtime: BasicTeyrchainRuntime
|
||||
+ cumulus_pallet_xcmp_queue::Config
|
||||
+ pezcumulus_pallet_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 = cumulus_pallet_teyrchain_system::Call<Runtime>,
|
||||
Call = pezcumulus_pallet_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_cumulus_pallet_teyrchain_system_event(e.event.encode()));
|
||||
.filter_map(|e| unwrap_pezcumulus_pallet_teyrchain_system_event(e.event.encode()));
|
||||
assert!(events.any(|e| matches!(
|
||||
e,
|
||||
cumulus_pallet_teyrchain_system::Event::UpwardMessageSent { .. }
|
||||
pezcumulus_pallet_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_cumulus_pallet_xcmp_queue_event(e.event.encode()))
|
||||
.filter_map(|e| unwrap_pezcumulus_pallet_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_cumulus_pallet_xcmp_queue_event(e.event.encode()));
|
||||
.filter_map(|e| unwrap_pezcumulus_pallet_xcmp_queue_event(e.event.encode()));
|
||||
assert!(
|
||||
events.any(|e| matches!(e, cumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }))
|
||||
events.any(|e| matches!(e, pezcumulus_pallet_xcmp_queue::Event::XcmpMessageSent { .. }))
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user