mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Add weight annotations to Timestamp, Sudo, Democracy, Treasury, et al. (#2694)
* Add some initial weighting notes * Add Democracy and Sudo * Add flags, fix formatting * Add comments on finality-tracker * Add a few mode modules. * Update srml/democracy/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update srml/democracy/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update srml/system/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update srml/system/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update srml/system/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update srml/system/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update srml/treasury/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update and merge changes * Update srml/system/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Remove unneeded comment * Remove comment line * Fix comment * Fix formatting overall * Apply suggestions from code review Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Apply suggestions from code review Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Clean up and polish * Update srml/indices/src/lib.rs * Update srml/staking/src/lib.rs Co-Authored-By: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Final nits.
This commit is contained in:
@@ -161,8 +161,16 @@ decl_module! {
|
||||
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
fn deposit_event<T>() = default;
|
||||
|
||||
/// Sets the session key of a validator (function caller) to `key`.
|
||||
/// Sets the session key of the function caller to `key`.
|
||||
/// Allows an account to set its session key prior to becoming a validator.
|
||||
/// This doesn't take effect until the next session.
|
||||
///
|
||||
/// The dispatch origin of this function must be signed.
|
||||
///
|
||||
/// # <weight>
|
||||
/// - O(1).
|
||||
/// - One extra DB entry.
|
||||
/// # </weight>
|
||||
fn set_key(origin, key: T::SessionKey) {
|
||||
let who = ensure_signed(origin)?;
|
||||
// set new value for next session
|
||||
@@ -170,11 +178,15 @@ decl_module! {
|
||||
}
|
||||
|
||||
/// Set a new session length. Won't kick in until the next session change (at current length).
|
||||
///
|
||||
/// Dispatch origin of this call must be _root_.
|
||||
fn set_length(#[compact] new: T::BlockNumber) {
|
||||
<NextSessionLength<T>>::put(new);
|
||||
}
|
||||
|
||||
/// Forces a new session.
|
||||
///
|
||||
/// Dispatch origin of this call must be _root_.
|
||||
fn force_new_session(apply_rewards: bool) -> Result {
|
||||
Self::apply_force_new_session(apply_rewards)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user