mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
past-session validator discovery APIs (#2009)
* guide: fix formatting for SessionInfo module * primitives: SessionInfo type * punt on approval keys * ah, revert the type alias * session info runtime module skeleton * update the guide * runtime/configuration: sync with the guide * runtime/configuration: setters for newly added fields * runtime/configuration: set codec indexes * runtime/configuration: update test * primitives: fix SessionInfo definition * runtime/session_info: initial impl * runtime/session_info: use initializer for session handling (wip) * runtime/session_info: mock authority discovery trait * guide: update the initializer's order * runtime/session_info: tests skeleton * runtime/session_info: store n_delay_tranches in Configuration * runtime/session_info: punt on approval keys * runtime/session_info: add some basic tests * Update primitives/src/v1.rs * small fixes * remove codec index annotation on structs * fix off-by-one error * validator_discovery: accept a session index * runtime: replace validator_discovery api with session_info * Update runtime/parachains/src/session_info.rs Co-authored-by: Sergei Shulepov <sergei@parity.io> * runtime/session_info: add a comment about missing entries * runtime/session_info: define the keys * util: expose connect_to_past_session_validators * util: allow session_info requests for jobs * runtime-api: add mock test for session_info * collator-protocol: add session_index to test state * util: fix error message for runtime error * fix compilation * fix tests after merge with master Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
@@ -24,7 +24,7 @@ use sp_runtime::{
|
||||
BlakeTwo256, IdentityLookup,
|
||||
},
|
||||
};
|
||||
use primitives::v1::{BlockNumber, Header};
|
||||
use primitives::v1::{AuthorityDiscoveryId, BlockNumber, Header};
|
||||
use frame_support::{
|
||||
impl_outer_origin, impl_outer_dispatch, impl_outer_event, parameter_types,
|
||||
weights::Weight, traits::Randomness as RandomnessT,
|
||||
@@ -124,6 +124,14 @@ impl crate::inclusion::Trait for Test {
|
||||
type Event = TestEvent;
|
||||
}
|
||||
|
||||
impl crate::session_info::Trait for Test { }
|
||||
|
||||
impl crate::session_info::AuthorityDiscoveryTrait for Test {
|
||||
fn authorities() -> Vec<AuthorityDiscoveryId> {
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub type System = frame_system::Module<Test>;
|
||||
|
||||
/// Mocked initializer.
|
||||
@@ -150,6 +158,9 @@ pub type Scheduler = crate::scheduler::Module<Test>;
|
||||
/// Mocked inclusion module.
|
||||
pub type Inclusion = crate::inclusion::Module<Test>;
|
||||
|
||||
/// Mocked session info module.
|
||||
pub type SessionInfo = crate::session_info::Module<Test>;
|
||||
|
||||
/// Create a new set of test externalities.
|
||||
pub fn new_test_ext(state: GenesisConfig) -> TestExternalities {
|
||||
let mut t = state.system.build_storage::<Test>().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user