mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Parachains-runtime (#1505)
* Initial commit * v0 to v1 primitives and remove attestations * Review fixes * implement candidate_events * remove dead code
This commit is contained in:
@@ -20,13 +20,16 @@
|
||||
//! particular the `Initializer` module, as it is responsible for initializing the state
|
||||
//! of the other modules.
|
||||
|
||||
mod configuration;
|
||||
mod inclusion;
|
||||
mod inclusion_inherent;
|
||||
mod initializer;
|
||||
mod paras;
|
||||
mod scheduler;
|
||||
mod validity;
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
pub mod configuration;
|
||||
pub mod inclusion;
|
||||
pub mod inclusion_inherent;
|
||||
pub mod initializer;
|
||||
pub mod paras;
|
||||
pub mod scheduler;
|
||||
pub mod validity;
|
||||
|
||||
pub mod runtime_api_impl;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
//! Runtimes implementing the v1 runtime API are recommended to forward directly to these
|
||||
//! functions.
|
||||
|
||||
use sp_std::prelude::*;
|
||||
use primitives::v1::{
|
||||
ValidatorId, ValidatorIndex, GroupRotationInfo, CoreState, GlobalValidationData,
|
||||
Id as ParaId, OccupiedCoreAssumption, LocalValidationData, SessionIndex, ValidationCode,
|
||||
@@ -239,9 +240,11 @@ pub fn candidate_pending_availability<T: initializer::Trait>(para_id: ParaId)
|
||||
/// Implementation for the `candidate_events` function of the runtime API.
|
||||
// NOTE: this runs without block initialization, as it accesses events.
|
||||
// this means it can run in a different session than other runtime APIs at the same block.
|
||||
pub fn candidate_events<T: initializer::Trait>(
|
||||
extract_event: impl Fn(<T as system::Trait>::Event) -> Option<inclusion::Event<T>>,
|
||||
) -> Vec<CandidateEvent<T::Hash>> {
|
||||
pub fn candidate_events<T, F>(extract_event: F) -> Vec<CandidateEvent<T::Hash>>
|
||||
where
|
||||
T: initializer::Trait,
|
||||
F: Fn(<T as system::Trait>::Event) -> Option<inclusion::Event<T>>,
|
||||
{
|
||||
use inclusion::Event as RawEvent;
|
||||
|
||||
<system::Module<T>>::events().into_iter()
|
||||
|
||||
Reference in New Issue
Block a user