mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
Move constants to top of files (even though they're private)
This commit is contained in:
@@ -23,6 +23,18 @@ use support::{storage, StorageVec};
|
||||
use primitives::{AccountID, SessionKey, BlockNumber};
|
||||
use runtime::{system, staking, consensus};
|
||||
|
||||
const SESSION_LENGTH: &[u8] = b"ses:len";
|
||||
const CURRENT_INDEX: &[u8] = b"ses:ind";
|
||||
const LAST_LENGTH_CHANGE: &[u8] = b"ses:llc";
|
||||
const NEXT_KEY_FOR: &[u8] = b"ses:nxt:";
|
||||
const NEXT_SESSION_LENGTH: &[u8] = b"ses:nln";
|
||||
|
||||
struct ValidatorStorageVec {}
|
||||
impl StorageVec for ValidatorStorageVec {
|
||||
type Item = AccountID;
|
||||
const PREFIX: &'static[u8] = b"ses:val:";
|
||||
}
|
||||
|
||||
/// Get the current set of authorities. These are the session keys.
|
||||
pub fn validators() -> Vec<AccountID> {
|
||||
ValidatorStorageVec::items()
|
||||
@@ -93,18 +105,6 @@ pub mod internal {
|
||||
}
|
||||
}
|
||||
|
||||
const SESSION_LENGTH: &[u8] = b"ses:len";
|
||||
const CURRENT_INDEX: &[u8] = b"ses:ind";
|
||||
const LAST_LENGTH_CHANGE: &[u8] = b"ses:llc";
|
||||
const NEXT_KEY_FOR: &[u8] = b"ses:nxt:";
|
||||
const NEXT_SESSION_LENGTH: &[u8] = b"ses:nln";
|
||||
|
||||
struct ValidatorStorageVec {}
|
||||
impl StorageVec for ValidatorStorageVec {
|
||||
type Item = AccountID;
|
||||
const PREFIX: &'static[u8] = b"ses:val:";
|
||||
}
|
||||
|
||||
/// Move onto next session: register the new authority set.
|
||||
fn rotate_session() {
|
||||
// Increment current session index.
|
||||
|
||||
Reference in New Issue
Block a user