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
+6 -6
View File
@@ -180,17 +180,17 @@ type MaybeVrf = Option<[u8; 32 /* VRF_OUTPUT_LENGTH */]>;
decl_storage! {
trait Store for Module<T: Trait> as Babe {
/// Current epoch index.
pub EpochIndex get(epoch_index): u64;
pub EpochIndex get(fn epoch_index): u64;
/// Current epoch authorities.
pub Authorities get(authorities): Vec<(AuthorityId, BabeAuthorityWeight)>;
pub Authorities get(fn authorities): Vec<(AuthorityId, BabeAuthorityWeight)>;
/// The slot at which the first epoch actually started. This is 0
/// until the first block of the chain.
pub GenesisSlot get(genesis_slot): u64;
pub GenesisSlot get(fn genesis_slot): u64;
/// Current slot number.
pub CurrentSlot get(current_slot): u64;
pub CurrentSlot get(fn current_slot): u64;
/// The epoch randomness for the *current* epoch.
///
@@ -205,7 +205,7 @@ decl_storage! {
// NOTE: the following fields don't use the constants to define the
// array size because the metadata API currently doesn't resolve the
// variable to its underlying value.
pub Randomness get(randomness): [u8; 32 /* RANDOMNESS_LENGTH */];
pub Randomness get(fn randomness): [u8; 32 /* RANDOMNESS_LENGTH */];
/// Next epoch randomness.
NextRandomness: [u8; 32 /* RANDOMNESS_LENGTH */];
@@ -224,7 +224,7 @@ decl_storage! {
/// Temporary value (cleared at block finalization) which is `Some`
/// if per-block initialization has already been called for current block.
Initialized get(initialized): Option<MaybeVrf>;
Initialized get(fn initialized): Option<MaybeVrf>;
}
add_extra_genesis {
config(authorities): Vec<(AuthorityId, BabeAuthorityWeight)>;