Sync Westmint to Millau (#1482)

* sync Westmint to Millau

* "Westend parachains at Millau" dashboard
This commit is contained in:
Svyatoslav Nikolsky
2022-06-29 15:59:50 +03:00
committed by Bastian Köcher
parent d11d9fd0b7
commit 852f629d78
7 changed files with 160 additions and 2 deletions
@@ -144,6 +144,8 @@ fn endowed_accounts() -> Vec<AccountId> {
get_account_id_from_seed::<sr25519::Public>("Harry"),
get_account_id_from_seed::<sr25519::Public>("Iden"),
get_account_id_from_seed::<sr25519::Public>("Ken"),
get_account_id_from_seed::<sr25519::Public>("Leon"),
get_account_id_from_seed::<sr25519::Public>("Mary"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
@@ -154,6 +156,8 @@ fn endowed_accounts() -> Vec<AccountId> {
get_account_id_from_seed::<sr25519::Public>("Harry//stash"),
get_account_id_from_seed::<sr25519::Public>("Iden//stash"),
get_account_id_from_seed::<sr25519::Public>("Ken//stash"),
get_account_id_from_seed::<sr25519::Public>("Leon//stash"),
get_account_id_from_seed::<sr25519::Public>("Mary//stash"),
get_account_id_from_seed::<sr25519::Public>("RialtoMessagesOwner"),
get_account_id_from_seed::<sr25519::Public>("RialtoParachainMessagesOwner"),
pallet_bridge_messages::relayer_fund_account_id::<
+28 -1
View File
@@ -506,9 +506,10 @@ impl pallet_bridge_messages::Config<WithRialtoParachainMessagesInstance> for Run
parameter_types! {
pub const RialtoParasPalletName: &'static str = bp_rialto::PARAS_PALLET_NAME;
pub const WestendParasPalletName: &'static str = bp_westend::PARAS_PALLET_NAME;
}
/// Instance of the with-Rialto parachains token swap pallet.
/// Instance of the with-Rialto parachains pallet.
pub type WithRialtoParachainsInstance = ();
impl pallet_bridge_parachains::Config<WithRialtoParachainsInstance> for Runtime {
@@ -519,6 +520,17 @@ impl pallet_bridge_parachains::Config<WithRialtoParachainsInstance> for Runtime
type HeadsToKeep = HeadersToKeep;
}
/// Instance of the with-Westend parachains pallet.
pub type WithWestendParachainsInstance = pallet_bridge_parachains::Instance1;
impl pallet_bridge_parachains::Config<WithWestendParachainsInstance> for Runtime {
type WeightInfo = pallet_bridge_parachains::weights::MillauWeight<Runtime>;
type BridgesGrandpaPalletInstance = WestendGrandpaInstance;
type ParasPalletName = WestendParasPalletName;
type TrackedParachains = frame_support::traits::Everything;
type HeadsToKeep = HeadersToKeep;
}
construct_runtime!(
pub enum Runtime where
Block = Block,
@@ -552,6 +564,7 @@ construct_runtime!(
// Westend bridge modules.
BridgeWestendGrandpa: pallet_bridge_grandpa::<Instance1>::{Pallet, Call, Config<T>, Storage},
BridgeWestendParachains: pallet_bridge_parachains::<Instance1>::{Pallet, Call, Storage},
// RialtoParachain bridge modules.
BridgeRialtoParachains: pallet_bridge_parachains::{Pallet, Call, Storage},
@@ -806,6 +819,20 @@ impl_runtime_apis! {
}
}
impl bp_westend::WestmintFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<(bp_westend::BlockNumber, bp_westend::Hash)> {
// the parachains finality pallet is never decoding parachain heads, so it is
// only done in the integration code
use bp_westend::WESTMINT_PARACHAIN_ID;
let encoded_head = pallet_bridge_parachains::Pallet::<
Runtime,
WithWestendParachainsInstance,
>::best_parachain_head(WESTMINT_PARACHAIN_ID.into())?;
let head = bp_westend::Header::decode(&mut &encoded_head.0[..]).ok()?;
Some((*head.number(), head.hash()))
}
}
impl bp_rialto_parachain::RialtoParachainFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<(bp_rialto::BlockNumber, bp_rialto::Hash)> {
// the parachains finality pallet is never decoding parachain heads, so it is