Introduce module structure over comments.

This commit is contained in:
Gav
2018-01-28 14:36:40 +01:00
parent bc6eb7d70a
commit 59469995b2
10 changed files with 460 additions and 426 deletions
@@ -31,14 +31,18 @@ pub fn authorities() -> Vec<SessionKey> {
AuthorityStorageVec::items()
}
/// Set the current set of authorities' session keys.
///
/// Called by `next_session` only.
pub fn set_authorities(authorities: &[SessionKey]) {
AuthorityStorageVec::set_items(authorities);
}
pub mod internal {
use super::*;
/// Set a single authority by index.
pub fn set_authority(index: u32, key: &SessionKey) {
AuthorityStorageVec::set_item(index, key);
/// Set the current set of authorities' session keys.
///
/// Called by `next_session` only.
pub fn set_authorities(authorities: &[SessionKey]) {
AuthorityStorageVec::set_items(authorities);
}
/// Set a single authority by index.
pub fn set_authority(index: u32, key: &SessionKey) {
AuthorityStorageVec::set_item(index, key);
}
}