Make constants exposable in metadata (#2975)

* Some cleanup

* Add module constant metadata declaration

* Begin to integrate the constants in `decl_module`

* Fixes tests

* Fix compilation and add tests

* Remove duplicate code

* Expose constants in democracy and staking + further fixes

* Update srml/metadata/src/lib.rs

Co-Authored-By: YJ <yjkimjunior@gmail.com>

* Hide `RawEvent` metadata function

* Prevent whitespaces in types

* Fix `offchain_worker` and `constants` with instances

* Up the `impl_version`

* Fix macro

* Incrase impl_version
This commit is contained in:
Bastian Köcher
2019-07-01 10:05:28 +02:00
committed by GitHub
parent 5f1538b834
commit 7202403bfc
12 changed files with 858 additions and 580 deletions
+6
View File
@@ -607,6 +607,12 @@ decl_event!(
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
/// Number of sessions per era.
const SessionsPerEra: SessionIndex = T::SessionsPerEra::get();
/// Number of eras that staked funds must remain bonded for.
const BondingDuration: EraIndex = T::BondingDuration::get();
fn deposit_event<T>() = default;
/// Take the origin account as a stash and lock up `value` of its balance. `controller` will