mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Breakdown the Router module on Dmp, Ump, Hrmp modules (#1939)
* Guide: Split router module in guide. Now we have: DMP, UMP and Router module. * Add a glossary entry for what used to be called Router * Extract DMP * Extract UMP * Extract HRMP * Switch over to new modules * Router: goodbye sweet prince * Link to messaging overview for details. * Update missed rococo and test runtimes. * Commit destroyed by rebase changes * Don't deprecate Router but rather make it a meta-project Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> * Fix typos suggestion Co-authored-by: Bernhard Schuster <bernhard@ahoi.io> * Fix repetition in the impl guide * Clarify that processed_downward_messages has the u32 type * Remove the router subdir. * Deabbreviate DMP,UMP,HRMP Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
This commit is contained in:
@@ -20,12 +20,12 @@
|
||||
use sp_runtime::traits::{One, Saturating};
|
||||
use primitives::v1::{Id as ParaId, PersistedValidationData, TransientValidationData};
|
||||
|
||||
use crate::{configuration, paras, router};
|
||||
use crate::{configuration, paras, dmp, hrmp};
|
||||
|
||||
/// Make the persisted validation data for a particular parachain.
|
||||
///
|
||||
/// This ties together the storage of several modules.
|
||||
pub fn make_persisted_validation_data<T: paras::Trait + router::Trait>(
|
||||
pub fn make_persisted_validation_data<T: paras::Trait + hrmp::Trait>(
|
||||
para_id: ParaId,
|
||||
) -> Option<PersistedValidationData<T::BlockNumber>> {
|
||||
let relay_parent_number = <frame_system::Module<T>>::block_number() - One::one();
|
||||
@@ -33,15 +33,15 @@ pub fn make_persisted_validation_data<T: paras::Trait + router::Trait>(
|
||||
Some(PersistedValidationData {
|
||||
parent_head: <paras::Module<T>>::para_head(¶_id)?,
|
||||
block_number: relay_parent_number,
|
||||
hrmp_mqc_heads: <router::Module<T>>::hrmp_mqc_heads(para_id),
|
||||
dmq_mqc_head: <router::Module<T>>::dmq_mqc_head(para_id),
|
||||
hrmp_mqc_heads: <hrmp::Module<T>>::hrmp_mqc_heads(para_id),
|
||||
dmq_mqc_head: <dmp::Module<T>>::dmq_mqc_head(para_id),
|
||||
})
|
||||
}
|
||||
|
||||
/// Make the transient validation data for a particular parachain.
|
||||
///
|
||||
/// This ties together the storage of several modules.
|
||||
pub fn make_transient_validation_data<T: paras::Trait + router::Trait>(
|
||||
pub fn make_transient_validation_data<T: paras::Trait + dmp::Trait>(
|
||||
para_id: ParaId,
|
||||
) -> Option<TransientValidationData<T::BlockNumber>> {
|
||||
let config = <configuration::Module<T>>::config();
|
||||
@@ -67,6 +67,6 @@ pub fn make_transient_validation_data<T: paras::Trait + router::Trait>(
|
||||
max_head_data_size: config.max_head_data_size,
|
||||
balance: 0,
|
||||
code_upgrade_allowed,
|
||||
dmq_length: <router::Module<T>>::dmq_length(para_id),
|
||||
dmq_length: <dmp::Module<T>>::dmq_length(para_id),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user