Follow-up on #1518 (#1546)

* Adjustments for the xcm messages sending logic

Signed-off-by: Serban Iorga <serban@parity.io>

* Deduplicate XCM destination

Signed-off-by: Serban Iorga <serban@parity.io>

* [send_message] small changes

Signed-off-by: Serban Iorga <serban@parity.io>

* Define CustomNetworkId

Right now we use some associations between Rialto, RialtoParachain and
Millau chains and chains defined in the NetworkId enum. But if we are
not carreful we might do mistakes like:
In Millau:
pub const ThisNetwork: NetworkId = Kusama;
pub const RialtoNetwork: NetworkId = Polkadot;
In Rialto:
pub const ThisNetwork: NetworkId = Kusama;
pub const MillauNetwork: NetworkId = Polkadot;

We're introducing CustomNetworkId to have a centralized mapping between
NetworkId chains and our custom chains.

Signed-off-by: Serban Iorga <serban@parity.io>

* Revert "Deduplicate XCM destination"

This reverts commit 3a0a950e1d7484e3ecac45f5c00b152f0485cd11.

Signed-off-by: Serban Iorga <serban@parity.io>
This commit is contained in:
Serban Iorga
2022-08-12 12:05:46 +03:00
committed by Bastian Köcher
parent 050b12f3aa
commit e0b42dfae7
11 changed files with 89 additions and 72 deletions
+8 -5
View File
@@ -21,7 +21,10 @@ use super::{
Event, Origin, Runtime, WithMillauMessagesInstance, XcmPallet,
};
use bp_rialto::WeightToFee;
use bridge_runtime_common::messages::source::{XcmBridge, XcmBridgeAdapter};
use bridge_runtime_common::{
messages::source::{XcmBridge, XcmBridgeAdapter},
CustomNetworkId,
};
use frame_support::{
parameter_types,
traits::{Everything, Nothing},
@@ -39,10 +42,10 @@ parameter_types! {
/// chain, we make it synonymous with it and thus it is the `Here` location, which means "equivalent to
/// the context".
pub const TokenLocation: MultiLocation = Here.into_location();
/// The Rialto network ID, associated with Polkadot.
pub const ThisNetwork: NetworkId = Polkadot;
/// The Millau network ID, associated with Kusama.
pub const MillauNetwork: NetworkId = Kusama;
/// The Rialto network ID.
pub const ThisNetwork: NetworkId = CustomNetworkId::Rialto.as_network_id();
/// The Millau network ID.
pub const MillauNetwork: NetworkId = CustomNetworkId::Millau.as_network_id();
/// Our XCM location ancestry - i.e. our location within the Consensus Universe.
///