mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 16:37:57 +00:00
Downward Message Processing implementation (#1859)
* DMP: data structures and plumbing * DMP: Implement DMP logic in the router module DMP: Integrate DMP parts into the inclusion module * DMP: Introduce the max size limit for the size of a downward message * DMP: Runtime API for accessing inbound messages * OCD Small clean ups * DMP: fix the naming of the error * DMP: add caution about a non-existent recipient
This commit is contained in:
@@ -23,10 +23,11 @@ use primitives::v1::{
|
||||
Id as ParaId, OccupiedCoreAssumption, SessionIndex, ValidationCode,
|
||||
CommittedCandidateReceipt, ScheduledCore, OccupiedCore, CoreOccupied, CoreIndex,
|
||||
GroupIndex, CandidateEvent, PersistedValidationData, AuthorityDiscoveryId,
|
||||
InboundDownwardMessage,
|
||||
};
|
||||
use sp_runtime::traits::Zero;
|
||||
use frame_support::debug;
|
||||
use crate::{initializer, inclusion, scheduler, configuration, paras};
|
||||
use crate::{initializer, inclusion, scheduler, configuration, paras, router};
|
||||
|
||||
/// Implementation for the `validators` function of the runtime API.
|
||||
pub fn validators<T: initializer::Trait>() -> Vec<ValidatorId> {
|
||||
@@ -299,3 +300,10 @@ where
|
||||
validator_index.and_then(|i| authorities.get(i).cloned())
|
||||
}).collect()
|
||||
}
|
||||
|
||||
/// Implementation for the `dmq_contents` function of the runtime API.
|
||||
pub fn dmq_contents<T: router::Trait>(
|
||||
recipient: ParaId,
|
||||
) -> Vec<InboundDownwardMessage<T::BlockNumber>> {
|
||||
<router::Module<T>>::dmq_contents(recipient)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user