mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 17:47:56 +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:
@@ -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