messages bridge between RialtoParachain and Millau (#1218)

This commit is contained in:
Svyatoslav Nikolsky
2022-05-20 12:03:45 +03:00
committed by Bastian Köcher
parent 03c2f06a27
commit 5f2f61ced5
33 changed files with 1658 additions and 75 deletions
@@ -26,6 +26,8 @@ pub enum FullBridge {
WococoToRococo,
KusamaToPolkadot,
PolkadotToKusama,
MillauToRialtoParachain,
RialtoParachainToMillau,
}
impl FullBridge {
@@ -38,6 +40,8 @@ impl FullBridge {
Self::WococoToRococo => WOCOCO_TO_ROCOCO_INDEX,
Self::KusamaToPolkadot => KUSAMA_TO_POLKADOT_INDEX,
Self::PolkadotToKusama => POLKADOT_TO_KUSAMA_INDEX,
Self::MillauToRialtoParachain => MILLAU_TO_RIALTO_PARACHAIN_INDEX,
Self::RialtoParachainToMillau => RIALTO_PARACHAIN_TO_MILLAU_INDEX,
}
}
}
@@ -48,6 +52,8 @@ pub const ROCOCO_TO_WOCOCO_INDEX: u8 = 0;
pub const WOCOCO_TO_ROCOCO_INDEX: u8 = 0;
pub const KUSAMA_TO_POLKADOT_INDEX: u8 = 0;
pub const POLKADOT_TO_KUSAMA_INDEX: u8 = 0;
pub const MILLAU_TO_RIALTO_PARACHAIN_INDEX: u8 = 1;
pub const RIALTO_PARACHAIN_TO_MILLAU_INDEX: u8 = 0;
/// The macro allows executing bridge-specific code without going fully generic.
///
@@ -171,6 +177,44 @@ macro_rules! select_full_bridge {
$generic
},
FullBridge::MillauToRialtoParachain => {
type Source = relay_millau_client::Millau;
#[allow(dead_code)]
type Target = relay_rialto_parachain_client::RialtoParachain;
// Derive-account
#[allow(unused_imports)]
use bp_rialto_parachain::derive_account_from_millau_id as derive_account;
// Relay-messages
#[allow(unused_imports)]
use crate::chains::millau_messages_to_rialto_parachain::MillauMessagesToRialtoParachain as MessagesLane;
// Send-message / Estimate-fee
#[allow(unused_imports)]
use bp_rialto_parachain::TO_RIALTO_PARACHAIN_ESTIMATE_MESSAGE_FEE_METHOD as ESTIMATE_MESSAGE_FEE_METHOD;
$generic
}
FullBridge::RialtoParachainToMillau => {
type Source = relay_rialto_parachain_client::RialtoParachain;
#[allow(dead_code)]
type Target = relay_millau_client::Millau;
// Derive-account
#[allow(unused_imports)]
use bp_millau::derive_account_from_rialto_parachain_id as derive_account;
// Relay-messages
#[allow(unused_imports)]
use crate::chains::rialto_parachain_messages_to_millau::RialtoParachainMessagesToMillau as MessagesLane;
// Send-message / Estimate-fee
#[allow(unused_imports)]
use bp_millau::TO_MILLAU_ESTIMATE_MESSAGE_FEE_METHOD as ESTIMATE_MESSAGE_FEE_METHOD;
$generic
}
}
};
}