mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
Implement Runtime APIs (#1411)
* create a README on Runtime APIs * add ParaId type * write up runtime APIs * more preamble * rename * rejig runtime APIs * add occupied_since to `BlockNumber` * skeleton crate for runtime API subsystem * improve group_for_core * improve docs on availability cores runtime API * guide: freed -> free * add primitives for runtime APIs * create a v1 ParachainHost API trait * guide: make validation code return `Option`al. * skeleton runtime API helpers * make parachain-host runtime-generic * skeleton for most runtime API implementation functions * guide: add runtime API helper methods * implement new helpers of the inclusion module * guide: remove retries check, as it is unneeded * implement helpers for scheduler module for Runtime APIs * clean up `validator_groups` implementation * implement next_rotation_at and last_rotation_at * guide: more helpers on GroupRotationInfo * almost finish implementing runtime APIs * add explicit block parameter to runtime API fns * guide: generalize number parameter * guide: add group_responsible to occupied-core * update primitives due to guide changes * finishing touches on runtime API implementation; squash warnings * break out runtime API impl to separate file * add tests for next_up logic * test group rotation info * point to filed TODO * remove unused TODO [now] * indentation * guide: para -> para_id * rename para field to para_id for core meta * remove reference to outdated AvailabilityCores type * add an event in `inclusion` for candidates being included or timing out * guide: candidate events * guide: adjust language * Candidate events type from guide and adjust inclusion event * implement `candidate_events` runtime API * fix runtime test compilation * max -> min * fix typos * guide: add `RuntimeAPIRequest::CandidateEvents`
This commit is contained in:
committed by
GitHub
parent
5624bd8bf4
commit
dddde219a2
@@ -26,9 +26,10 @@ use sp_runtime::{
|
||||
};
|
||||
use primitives::v1::{BlockNumber, Header};
|
||||
use frame_support::{
|
||||
impl_outer_origin, impl_outer_dispatch, parameter_types,
|
||||
impl_outer_origin, impl_outer_dispatch, impl_outer_event, parameter_types,
|
||||
weights::Weight, traits::Randomness as RandomnessT,
|
||||
};
|
||||
use crate::inclusion;
|
||||
|
||||
/// A test runtime struct.
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
@@ -44,6 +45,13 @@ impl_outer_dispatch! {
|
||||
}
|
||||
}
|
||||
|
||||
impl_outer_event! {
|
||||
pub enum TestEvent for Test {
|
||||
system<T>,
|
||||
inclusion<T>,
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TestRandomness;
|
||||
|
||||
impl RandomnessT<H256> for TestRandomness {
|
||||
@@ -70,7 +78,7 @@ impl system::Trait for Test {
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<u64>;
|
||||
type Header = Header;
|
||||
type Event = ();
|
||||
type Event = TestEvent;
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
type DbWeight = ();
|
||||
@@ -97,7 +105,9 @@ impl crate::paras::Trait for Test { }
|
||||
|
||||
impl crate::scheduler::Trait for Test { }
|
||||
|
||||
impl crate::inclusion::Trait for Test { }
|
||||
impl crate::inclusion::Trait for Test {
|
||||
type Event = TestEvent;
|
||||
}
|
||||
|
||||
pub type System = system::Module<Test>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user