Expose some of session module's storage as public, as well as the set_keys transaction (#4175)

* Expose some of session's storage as public, as well as set_keys

Seemingly there's no reason not to do this, as anyone can always do
it the "hard way" by constructing storage keys or extrinsics.

* Use trait to expose `is_registered` function

* Missed removing a pub keyword

* Move trait to support, add docstrings
This commit is contained in:
Spencer Judge
2019-12-05 01:42:42 -08:00
committed by Bastian Köcher
parent 03a3993541
commit 0a3f326e56
2 changed files with 16 additions and 1 deletions
+9
View File
@@ -769,3 +769,12 @@ pub trait Randomness<Output> {
Self::random(&[][..])
}
}
/// Implementors of this trait provide information about whether or not some validator has
/// been registered with them. The [Session module](../../pallet_session/index.html) is an implementor.
pub trait ValidatorRegistration<ValidatorId> {
/// Returns true if the provided validator ID has been registered with the implementing runtime
/// module
fn is_registered(id: &ValidatorId) -> bool;
}