chore: regenerate umbrella crate, fix feature propagation
This commit is contained in:
@@ -24,13 +24,13 @@
|
||||
use crate::{Config, Pezpallet, LOG_TARGET};
|
||||
|
||||
use bp_messages::target_chain::{DispatchMessage, MessageDispatch};
|
||||
use pezbp_runtime::messages::MessageDispatchResult;
|
||||
use bp_xcm_bridge_hub::{LocalXcmChannelManager, XcmAsPlainPayload};
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use pezbp_runtime::messages::MessageDispatchResult;
|
||||
use pezframe_support::{weights::Weight, CloneNoBound, EqNoBound, PartialEqNoBound};
|
||||
use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, WeightInfoExt};
|
||||
use scale_info::TypeInfo;
|
||||
use pezsp_runtime::SaturatedConversion;
|
||||
use scale_info::TypeInfo;
|
||||
use xcm::prelude::*;
|
||||
use xcm_builder::{DispatchBlob, DispatchBlobError};
|
||||
|
||||
|
||||
@@ -355,9 +355,9 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
///
|
||||
/// We are using `HaulBlobExporter`, which requires `HaulBlob` implementation. It assumes that
|
||||
/// there's a single channel between two bridge hubs - `HaulBlob` only accepts the blob and nothing
|
||||
/// else. But bridge messages pezpallet may have a dedicated channel (lane) for every pair of bridged
|
||||
/// chains. So we are using our own `ExportXcm` implementation, but to utilize `HaulBlobExporter` we
|
||||
/// still need this `DummyHaulBlob`.
|
||||
/// else. But bridge messages pezpallet may have a dedicated channel (lane) for every pair of
|
||||
/// bridged chains. So we are using our own `ExportXcm` implementation, but to utilize
|
||||
/// `HaulBlobExporter` we still need this `DummyHaulBlob`.
|
||||
pub struct DummyHaulBlob;
|
||||
|
||||
impl HaulBlob for DummyHaulBlob {
|
||||
@@ -371,8 +371,8 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::{mock::*, Bridges, LaneToBridge, LanesManagerOf};
|
||||
|
||||
use pezbp_runtime::RangeInclusiveExt;
|
||||
use bp_xcm_bridge_hub::{Bridge, BridgeLocations, BridgeState};
|
||||
use pezbp_runtime::RangeInclusiveExt;
|
||||
use pezframe_support::{assert_ok, traits::EnsureOrigin};
|
||||
use pezpallet_bridge_messages::InboundLaneStorage;
|
||||
use xcm_builder::{NetworkExportTable, UnpaidRemoteExporter};
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
//! open and close bridges between local (to this pezpallet location) and remote XCM
|
||||
//! destinations.
|
||||
//!
|
||||
//! The `pezpallet_xcm_bridge_hub` pezpallet is used to manage (open, close) bridges between chains from
|
||||
//! different consensuses. The new extrinsics `fn open_bridge` and `fn close_bridge` are introduced.
|
||||
//! Other chains can manage channels with different bridged global consensuses.
|
||||
//! The `pezpallet_xcm_bridge_hub` pezpallet is used to manage (open, close) bridges between chains
|
||||
//! from different consensuses. The new extrinsics `fn open_bridge` and `fn close_bridge` are
|
||||
//! introduced. Other chains can manage channels with different bridged global consensuses.
|
||||
//!
|
||||
//! # Concept of `lane` and `LaneId`
|
||||
//!
|
||||
@@ -48,8 +48,8 @@
|
||||
//!
|
||||
//! # Concept of `bridge` and `BridgeId`
|
||||
//!
|
||||
//! The `pezpallet_xcm_bridge_hub` pezpallet needs to store some metadata about opened bridges. The bridge
|
||||
//! (or bridge metadata) is stored under the `BridgeId` key.
|
||||
//! The `pezpallet_xcm_bridge_hub` pezpallet needs to store some metadata about opened bridges. The
|
||||
//! bridge (or bridge metadata) is stored under the `BridgeId` key.
|
||||
//!
|
||||
//! `BridgeId` is generated from `bridge_origin_relative_location` and
|
||||
//! `bridge_origin_universal_location` using the `latest` XCM structs. `BridgeId` is not transferred
|
||||
@@ -62,8 +62,8 @@
|
||||
//!
|
||||
//! # Migrations and State
|
||||
//!
|
||||
//! This pezpallet implements `try_state`, ensuring compatibility and checking everything so we know if
|
||||
//! any migration is needed. `do_try_state` checks for `BridgeId` compatibility, which is
|
||||
//! This pezpallet implements `try_state`, ensuring compatibility and checking everything so we know
|
||||
//! if any migration is needed. `do_try_state` checks for `BridgeId` compatibility, which is
|
||||
//! recalculated on runtime upgrade. Upgrading to a new XCM version should not break anything,
|
||||
//! except removing older XCM versions. In such cases, we need to add migration for `BridgeId` and
|
||||
//! stored `Versioned*` structs and update `LaneToBridge` mapping, but this won't affect `LaneId`
|
||||
@@ -144,11 +144,11 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use bp_messages::{LaneState, MessageNonce};
|
||||
use pezbp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt};
|
||||
use bp_xcm_bridge_hub::BridgeLocationsError;
|
||||
pub use bp_xcm_bridge_hub::{
|
||||
Bridge, BridgeId, BridgeLocations, BridgeState, LocalXcmChannelManager,
|
||||
};
|
||||
use pezbp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt};
|
||||
use pezframe_support::{traits::fungible::MutateHold, DefaultNoBound};
|
||||
use pezframe_system::Config as SystemConfig;
|
||||
use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, LanesManagerError};
|
||||
@@ -215,8 +215,8 @@ pub mod pezpallet {
|
||||
/// Checks the XCM version for the destination.
|
||||
type DestinationVersion: GetVersion;
|
||||
|
||||
/// The origin that is allowed to call privileged operations on the pezpallet, e.g. open/close
|
||||
/// bridge for locations.
|
||||
/// The origin that is allowed to call privileged operations on the pezpallet, e.g.
|
||||
/// open/close bridge for locations.
|
||||
type ForceOrigin: EnsureOrigin<<Self as SystemConfig>::RuntimeOrigin>;
|
||||
/// A set of XCM locations within local consensus system that are allowed to open
|
||||
/// bridges with remote destinations.
|
||||
@@ -691,10 +691,15 @@ pub mod pezpallet {
|
||||
Ok(bridge.lane_id)
|
||||
}
|
||||
|
||||
/// Ensure the correctness of the state of the connected `pezpallet_bridge_messages` instance.
|
||||
/// Ensure the correctness of the state of the connected `pezpallet_bridge_messages`
|
||||
/// instance.
|
||||
pub fn do_try_state_for_messages() -> Result<(), pezsp_runtime::TryRuntimeError> {
|
||||
// check that all `InboundLanes` laneIds have mapping to some bridge.
|
||||
for lane_id in pezpallet_bridge_messages::InboundLanes::<T, T::BridgeMessagesPalletInstance>::iter_keys() {
|
||||
for lane_id in pezpallet_bridge_messages::InboundLanes::<
|
||||
T,
|
||||
T::BridgeMessagesPalletInstance,
|
||||
>::iter_keys()
|
||||
{
|
||||
tracing::info!(target: LOG_TARGET, ?lane_id, "Checking `do_try_state_for_messages` for `InboundLanes`...");
|
||||
ensure!(
|
||||
LaneToBridge::<T, I>::get(lane_id).is_some(),
|
||||
@@ -703,7 +708,11 @@ pub mod pezpallet {
|
||||
}
|
||||
|
||||
// check that all `OutboundLanes` laneIds have mapping to some bridge.
|
||||
for lane_id in pezpallet_bridge_messages::OutboundLanes::<T, T::BridgeMessagesPalletInstance>::iter_keys() {
|
||||
for lane_id in pezpallet_bridge_messages::OutboundLanes::<
|
||||
T,
|
||||
T::BridgeMessagesPalletInstance,
|
||||
>::iter_keys()
|
||||
{
|
||||
tracing::info!(target: LOG_TARGET, ?lane_id, "Checking `do_try_state_for_messages` for `OutboundLanes`");
|
||||
ensure!(
|
||||
LaneToBridge::<T, I>::get(lane_id).is_some(),
|
||||
@@ -839,7 +848,9 @@ mod tests {
|
||||
use bp_messages::LaneIdType;
|
||||
use mock::*;
|
||||
|
||||
use pezframe_support::{assert_err, assert_noop, assert_ok, traits::fungible::Mutate, BoundedVec};
|
||||
use pezframe_support::{
|
||||
assert_err, assert_noop, assert_ok, traits::fungible::Mutate, BoundedVec,
|
||||
};
|
||||
use pezframe_system::{EventRecord, Phase};
|
||||
use pezsp_runtime::TryRuntimeError;
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ use bp_messages::{
|
||||
target_chain::{DispatchMessage, MessageDispatch},
|
||||
ChainWithMessages, HashedLaneId, MessageNonce,
|
||||
};
|
||||
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf};
|
||||
use bp_xcm_bridge_hub::{BridgeId, LocalXcmChannelManager};
|
||||
use codec::{Decode, Encode};
|
||||
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf};
|
||||
use pezframe_support::{
|
||||
assert_ok, derive_impl, parameter_types,
|
||||
traits::{EnsureOrigin, Equals, Everything, Get, OriginTrait},
|
||||
@@ -276,8 +276,8 @@ thread_local! {
|
||||
|
||||
/// The `SendXcm` implementation directly executes XCM using `XcmExecutor`.
|
||||
///
|
||||
/// We ensure that the `ExportMessage` produced by `pezpallet_xcm_bridge_hub_router` is compatible with
|
||||
/// the `ExportXcm` implementation of `pezpallet_xcm_bridge_hub`.
|
||||
/// We ensure that the `ExportMessage` produced by `pezpallet_xcm_bridge_hub_router` is compatible
|
||||
/// with the `ExportXcm` implementation of `pezpallet_xcm_bridge_hub`.
|
||||
///
|
||||
/// Note: The crucial part is that `ExportMessage` is processed by `XcmExecutor`, which calls the
|
||||
/// `ExportXcm` implementation of `pezpallet_xcm_bridge_hub` as `MessageExporter`.
|
||||
@@ -663,7 +663,9 @@ impl MessageDispatch for TestMessageDispatch {
|
||||
/// Run pezpallet test.
|
||||
pub fn run_test<T>(test: impl FnOnce() -> T) -> T {
|
||||
pezsp_io::TestExternalities::new(
|
||||
pezframe_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap(),
|
||||
pezframe_system::GenesisConfig::<TestRuntime>::default()
|
||||
.build_storage()
|
||||
.unwrap(),
|
||||
)
|
||||
.execute_with(test)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user