Explicitly declare decl_storage! getters as functions (#3870)

* parse decl_storage getters with fn keyword

* test for get in decl_storage

* update all decl_storage! getters

* bump version

* adjust missed doc line
This commit is contained in:
Robert Habermeier
2019-10-22 03:53:58 -04:00
committed by Bastian Köcher
parent 1111d79ac1
commit 5d5e71028e
36 changed files with 190 additions and 175 deletions
+2 -2
View File
@@ -56,9 +56,9 @@ pub trait Trait: super::Trait {
decl_storage! {
trait Store for Module<T: Trait> as Session {
/// Mapping from historical session indices to session-data root hash and validator count.
HistoricalSessions get(historical_root): map SessionIndex => Option<(T::Hash, ValidatorCount)>;
HistoricalSessions get(fn historical_root): map SessionIndex => Option<(T::Hash, ValidatorCount)>;
/// Queued full identifications for queued sessions whose validators have become obsolete.
CachedObsolete get(cached_obsolete): map SessionIndex
CachedObsolete get(fn cached_obsolete): map SessionIndex
=> Option<Vec<(T::ValidatorId, T::FullIdentification)>>;
/// The range of historical sessions we store. [first, last)
StoredRange: Option<(SessionIndex, SessionIndex)>;
+4 -4
View File
@@ -349,10 +349,10 @@ const DEDUP_KEY_PREFIX: &[u8] = b":session:keys";
decl_storage! {
trait Store for Module<T: Trait> as Session {
/// The current set of validators.
Validators get(validators): Vec<T::ValidatorId>;
Validators get(fn validators): Vec<T::ValidatorId>;
/// Current index of the session.
CurrentIndex get(current_index): SessionIndex;
CurrentIndex get(fn current_index): SessionIndex;
/// True if the underlying economic identities or weighting behind the validators
/// has changed in the queued validator set.
@@ -360,12 +360,12 @@ decl_storage! {
/// The queued keys for the next session. When the next session begins, these keys
/// will be used to determine the validator's session keys.
QueuedKeys get(queued_keys): Vec<(T::ValidatorId, T::Keys)>;
QueuedKeys get(fn queued_keys): Vec<(T::ValidatorId, T::Keys)>;
/// Indices of disabled validators.
///
/// The set is cleared when `on_session_ending` returns a new set of identities.
DisabledValidators get(disabled_validators): Vec<u32>;
DisabledValidators get(fn disabled_validators): Vec<u32>;
/// The next session keys for a validator.
///