-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adds remove_approval feature to treasury pallet #11243
Adds remove_approval feature to treasury pallet #11243
Conversation
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
…val call and trailing new line in tests file
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.
nice, looks good
/tip small |
Please fix the following problems before calling the tip bot again:
Make sure the pull request description has: "{network} address: {address}". |
/benchmark runtime pallet pallet_treasury |
Benchmark Runtime Pallet for branch "remove-approval-treasury-pallet" with command cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs Toolchain: stable-x86_64-unknown-linux-gnu (default) Results
|
… remove-approval-treasury-pallet
…--manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
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.
Have some minor complains before approving.
…st and extra documentation
frame/treasury/src/lib.rs
Outdated
/// # </weight> | ||
/// | ||
/// Errors: | ||
/// - `ProposalNotApproved`: Proposal has not been approved. |
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.
Sorry, but this isn't quite informative. You need to think about what this means when someone reads this. Which proposal wasn't approved? What are the causes for this error? These are questions that someone who encountered the ProposalNotApproved
error would really want to know about, and attempt to fix it themselves.
There are two reasons why this can happen -- either the proposal exists but was not approved, or that a proposal with the specified proposal_id
doesn't exist altogether. These two bits of information are very helpful for users who encounter this error and are trying to look for the next steps in resolving it.
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.
Does this work:
The `proposal_id` supplied was not found in the approval queue, i.e., the proposal has not been approved.
This could also mean the proposal with the supplied `proposal_id` does not exist altogether,
thus there is no way it would have been approved in the first place.
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.
Hi @KiChjang, I've modified the description.
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
bot merge |
Error: "Check reviews" status is not passing for paritytech/polkadot#5352 |
bot merge |
Error: "Check reviews" status is not passing for paritytech/polkadot#5352 |
bot merge |
* added remove_approval feature to treasury pallet * Update frame/treasury/src/lib.rs Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> * treasury pallet refactoring: removed proposalId check in remove_approval call and trailing new line in tests file * fmt * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Update frame/treasury/src/lib.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * remove_approval extrinsic in treasury pallet:added extra checks in test and extra documentation * refactored error logging on remove_approval extrinsic in treasury pallet Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* added remove_approval feature to treasury pallet * Update frame/treasury/src/lib.rs Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> * treasury pallet refactoring: removed proposalId check in remove_approval call and trailing new line in tests file * fmt * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Update frame/treasury/src/lib.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * remove_approval extrinsic in treasury pallet:added extra checks in test and extra documentation * refactored error logging on remove_approval extrinsic in treasury pallet Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* added remove_approval feature to treasury pallet * Update frame/treasury/src/lib.rs Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> * treasury pallet refactoring: removed proposalId check in remove_approval call and trailing new line in tests file * fmt * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Update frame/treasury/src/lib.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * remove_approval extrinsic in treasury pallet:added extra checks in test and extra documentation * refactored error logging on remove_approval extrinsic in treasury pallet Co-authored-by: Xiliang Chen <xlchen1291@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This PR adds a feature to remove previously approved proposals from the approval queue.
Resolves Force Remove Approved Extrinsic in Treasury #10952
polkadot companion: paritytech/polkadot#5352
supercedes: #10989
polkadot address: 13dUB1KQNcbCGAxbEpzFBsnbvkwVAjmHtBj41E6oPfmfpaAX