This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kianenigma
commented
Apr 17, 2020
fn some_root_operation(origin) { | ||
let _ = frame_system::ensure_root(origin); | ||
} | ||
#[weight = SimpleDispatchInfo::InsecureFreeNormal] | ||
#[weight = 0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting case not automatically migrated.
kianenigma
commented
Apr 17, 2020
fn proxy_remove_vote(origin, index: ReferendumIndex) -> DispatchResult { | ||
let who = ensure_signed(origin)?; | ||
let target = Self::proxy(who).and_then(|a| a.as_active()).ok_or(Error::<T>::NotProxy)?; | ||
Self::try_remove_vote(&target, index, UnvoteScope::Any) | ||
} | ||
|
||
/// Enact a proposal from a referendum. For now we just make the weight be the maximum. | ||
#[weight = SimpleDispatchInfo::MaxNormal] | ||
#[weight = Weight::max_value()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting case not handled by the regex.
shawntabrizi
approved these changes
Apr 17, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM when you create polkadot pr
tests failing. |
should be good now. @gnunicorn |
Updated the polkadot PR as well and both should be mergeable now. |
bkchr
approved these changes
Apr 22, 2020
Merged
sorpaas
pushed a commit
that referenced
this pull request
Nov 20, 2020
* Migrate away from SimpleDispatchInfo * Fix imports * Better doc * Update lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Weight
,(Weight, Class)
and(Weight, Class, PaysFee)
I brought this up (intention to deprecate
SimpleDispatchInfo
) and there were no objections, so I assume it is okay.SimpleDispatchInfo
was verbose, not flexible (i.e. for each permutation of(weight, class, fee)
you need a new enum variant) and does not have any added value. I always saw it as hasty mistake which was added in the first version of weights.So all in all, If this is going to happen, better for it to happen now before 2.0.
This PR should change no logic except for in
weight.rs
. substitution regex: