mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41: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:
@@ -110,6 +110,12 @@ decl_module! {
|
||||
/// Put forward a suggestion for spending. A deposit proportional to the value
|
||||
/// is reserved and slashed if the proposal is rejected. It is returned once the
|
||||
/// proposal is awarded.
|
||||
///
|
||||
/// # <weight>
|
||||
/// - O(1).
|
||||
/// - Limited storage reads.
|
||||
/// - One DB change, one extra DB entry.
|
||||
/// # </weight>
|
||||
fn propose_spend(
|
||||
origin,
|
||||
#[compact] value: BalanceOf<T>,
|
||||
@@ -149,6 +155,12 @@ decl_module! {
|
||||
}
|
||||
|
||||
/// Reject a proposed spend. The original deposit will be slashed.
|
||||
///
|
||||
/// # <weight>
|
||||
/// - O(1).
|
||||
/// - Limited storage reads.
|
||||
/// - One DB clear.
|
||||
/// # </weight>
|
||||
fn reject_proposal(origin, #[compact] proposal_id: ProposalIndex) {
|
||||
T::RejectOrigin::ensure_origin(origin)?;
|
||||
let proposal = <Proposals<T>>::take(proposal_id).ok_or("No proposal at that index")?;
|
||||
@@ -160,6 +172,12 @@ decl_module! {
|
||||
|
||||
/// Approve a proposal. At a later time, the proposal will be allocated to the beneficiary
|
||||
/// and the original deposit will be returned.
|
||||
///
|
||||
/// # <weight>
|
||||
/// - O(1).
|
||||
/// - Limited storage reads.
|
||||
/// - One DB change.
|
||||
/// # </weight>
|
||||
fn approve_proposal(origin, #[compact] proposal_id: ProposalIndex) {
|
||||
T::ApproveOrigin::ensure_origin(origin)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user