Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FRAME] Remove deprecated calls from treasury pallet #3800

Closed
muharem opened this issue Mar 22, 2024 · 4 comments
Closed

[FRAME] Remove deprecated calls from treasury pallet #3800

muharem opened this issue Mar 22, 2024 · 4 comments
Assignees
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I4-refactor Code needs refactoring.

Comments

@muharem
Copy link
Contributor

muharem commented Mar 22, 2024

As part of the deprecation process #138 the next call needs to be removed:

  • pallet_treasury.propose_spend
  • pallet_treasury.reject_proposal
  • pallet_treasury.approve_proposal

Scope:

  • remove deprecated calls;
  • set explicit coded indexes for Error and Event enums, remove unused variants and keep the same indexes for the rest;
  • remove unused Config's type parameters;
  • remove irrelevant tests and adopt relevant using old api;
  • remove banchmarks for removed calls;

mentor: @muharem

@muharem muharem added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. I4-refactor Code needs refactoring. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Mar 22, 2024
@chungquantin
Copy link
Contributor

Hi, I am keen on working on this issue

@chungquantin
Copy link
Contributor

chungquantin commented Mar 25, 2024

@muharem I have created a PR for this issue. Could you please help me to review? There is only only task I am not sure.

set explicit coded indexes for Error and Event enums, remove unused variants and keep the same indexes for the rest;

I am trying to find an example of other people works for explicit coded indexes used in this codebase but could not find one. Could you suggest me an approach for this?

@muharem
Copy link
Contributor Author

muharem commented Mar 25, 2024

@chungquantin just commented, let me know if something not clear yet

@shawntabrizi
Copy link
Member

I would like to also include these changes into any new release of the treasury pallet: https://github.com/paritytech/polkadot-sdk/pull/3970/files

So that we have only one set of breaking changes to the treasury pallet.

github-merge-queue bot pushed a commit that referenced this issue Jun 18, 2024
# ISSUE
- Link to the issue:
#3800
# Deliverables
- [x] remove deprecated calls;
(d579b67)
- [x] set explicit coded indexes for Error and Event enums, remove
unused variants and keep the same indexes for the rest;
(d579b67)
- [x] remove unused Config's type parameters;
(d579b67)
- [x] remove irrelevant tests and adopt relevant using old api;
(d579b67)
- [x] remove benchmarks for removed calls;
(1a3d5f1)
- [x] prdoc
(d579b67)
- [x] remove deprecated methods from the `treasury/README.md` and add
up-to-date dispatchable functions documentation
(d579b67)
- [x] remove deprecated weight functions
(8f74134)
> ### Separated to other issues
> - [ ] remove storage items like Proposals and ProposalCount, that are
not used anymore

Adjust all treasury pallet instances within polkadot-sdk
- [x] `pallet_bounty`, `tip`, `child_bounties`:
openguild-labs#3
- [x] Remove deprecated treasury weight functions used in Westend and
Rococo runtime `collective-westend`, `collective-rococo`

Add migration for westend and rococo to clean the data from removed
storage items
- [ ] #3828
# Test Outcomes
Successful tests by running `cargo test --features runtime-benchmarks`
```
running 38 tests
test tests::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
test benchmarking::benchmarks::bench_check_status ... ok
test benchmarking::benchmarks::bench_payout ... ok
test benchmarking::benchmarks::bench_spend_local ... ok
test tests::accepted_spend_proposal_enacted_on_spend_period ... ok
test benchmarking::benchmarks::bench_spend ... ok
test tests::accepted_spend_proposal_ignored_outside_spend_period ... ok
test benchmarking::benchmarks::bench_void_spend ... ok
test benchmarking::benchmarks::bench_remove_approval ... ok
test tests::genesis_funding_works ... ok
test tests::genesis_config_works ... ok
test tests::inexistent_account_works ... ok
test tests::minting_works ... ok
test tests::check_status_works ... ok
test tests::payout_retry_works ... ok
test tests::pot_underflow_should_not_diminish ... ok
test tests::remove_already_removed_approval_fails ... ok
test tests::spend_local_origin_permissioning_works ... ok
test tests::spend_valid_from_works ... ok
test tests::spend_expires ... ok
test tests::spend_works ... ok
test tests::test_genesis_config_builds ... ok
test tests::spend_payout_works ... ok
test tests::spend_local_origin_works ... ok
test tests::spend_origin_works ... ok
test tests::spending_local_in_batch_respects_max_total ... ok
test tests::spending_in_batch_respects_max_total ... ok
test tests::try_state_proposals_invariant_2_works ... ok
test tests::try_state_proposals_invariant_1_works ... ok
test tests::try_state_spends_invariant_2_works ... ok
test tests::try_state_spends_invariant_1_works ... ok
test tests::treasury_account_doesnt_get_deleted ... ok
test tests::try_state_spends_invariant_3_works ... ok
test tests::unused_pot_should_diminish ... ok
test tests::void_spend_works ... ok
test tests::try_state_proposals_invariant_3_works ... ok
test tests::max_approvals_limited ... ok
test benchmarking::benchmarks::bench_on_initialize_proposals ... ok

test result: ok. 38 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s

   Doc-tests pallet_treasury

running 2 tests
test substrate/frame/treasury/src/lib.rs - (line 52) ... ignored
test substrate/frame/treasury/src/lib.rs - (line 79) ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s
```

polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J
@muharem muharem closed this as completed Jun 24, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 24, 2024
Remove unused config parameters `ApproveOrigin` and `OnSlash` from the
treasury pallet. Add `OnSlash` config parameter to the bounties and tips
pallets.

part of #3800
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this issue Aug 2, 2024
# ISSUE
- Link to the issue:
paritytech#3800
# Deliverables
- [x] remove deprecated calls;
(paritytech@d579b67)
- [x] set explicit coded indexes for Error and Event enums, remove
unused variants and keep the same indexes for the rest;
(paritytech@d579b67)
- [x] remove unused Config's type parameters;
(paritytech@d579b67)
- [x] remove irrelevant tests and adopt relevant using old api;
(paritytech@d579b67)
- [x] remove benchmarks for removed calls;
(paritytech@1a3d5f1)
- [x] prdoc
(paritytech@d579b67)
- [x] remove deprecated methods from the `treasury/README.md` and add
up-to-date dispatchable functions documentation
(paritytech@d579b67)
- [x] remove deprecated weight functions
(paritytech@8f74134)
> ### Separated to other issues
> - [ ] remove storage items like Proposals and ProposalCount, that are
not used anymore

Adjust all treasury pallet instances within polkadot-sdk
- [x] `pallet_bounty`, `tip`, `child_bounties`:
openguild-labs#3
- [x] Remove deprecated treasury weight functions used in Westend and
Rococo runtime `collective-westend`, `collective-rococo`

Add migration for westend and rococo to clean the data from removed
storage items
- [ ] paritytech#3828
# Test Outcomes
Successful tests by running `cargo test --features runtime-benchmarks`
```
running 38 tests
test tests::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
test benchmarking::benchmarks::bench_check_status ... ok
test benchmarking::benchmarks::bench_payout ... ok
test benchmarking::benchmarks::bench_spend_local ... ok
test tests::accepted_spend_proposal_enacted_on_spend_period ... ok
test benchmarking::benchmarks::bench_spend ... ok
test tests::accepted_spend_proposal_ignored_outside_spend_period ... ok
test benchmarking::benchmarks::bench_void_spend ... ok
test benchmarking::benchmarks::bench_remove_approval ... ok
test tests::genesis_funding_works ... ok
test tests::genesis_config_works ... ok
test tests::inexistent_account_works ... ok
test tests::minting_works ... ok
test tests::check_status_works ... ok
test tests::payout_retry_works ... ok
test tests::pot_underflow_should_not_diminish ... ok
test tests::remove_already_removed_approval_fails ... ok
test tests::spend_local_origin_permissioning_works ... ok
test tests::spend_valid_from_works ... ok
test tests::spend_expires ... ok
test tests::spend_works ... ok
test tests::test_genesis_config_builds ... ok
test tests::spend_payout_works ... ok
test tests::spend_local_origin_works ... ok
test tests::spend_origin_works ... ok
test tests::spending_local_in_batch_respects_max_total ... ok
test tests::spending_in_batch_respects_max_total ... ok
test tests::try_state_proposals_invariant_2_works ... ok
test tests::try_state_proposals_invariant_1_works ... ok
test tests::try_state_spends_invariant_2_works ... ok
test tests::try_state_spends_invariant_1_works ... ok
test tests::treasury_account_doesnt_get_deleted ... ok
test tests::try_state_spends_invariant_3_works ... ok
test tests::unused_pot_should_diminish ... ok
test tests::void_spend_works ... ok
test tests::try_state_proposals_invariant_3_works ... ok
test tests::max_approvals_limited ... ok
test benchmarking::benchmarks::bench_on_initialize_proposals ... ok

test result: ok. 38 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s

   Doc-tests pallet_treasury

running 2 tests
test substrate/frame/treasury/src/lib.rs - (line 52) ... ignored
test substrate/frame/treasury/src/lib.rs - (line 79) ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s
```

polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this issue Aug 2, 2024
Remove unused config parameters `ApproveOrigin` and `OnSlash` from the
treasury pallet. Add `OnSlash` config parameter to the bounties and tips
pallets.

part of paritytech#3800
sfffaaa pushed a commit to peaqnetwork/polkadot-sdk that referenced this issue Dec 27, 2024
# ISSUE
- Link to the issue:
paritytech#3800
# Deliverables
- [x] remove deprecated calls;
(paritytech@d579b67)
- [x] set explicit coded indexes for Error and Event enums, remove
unused variants and keep the same indexes for the rest;
(paritytech@d579b67)
- [x] remove unused Config's type parameters;
(paritytech@d579b67)
- [x] remove irrelevant tests and adopt relevant using old api;
(paritytech@d579b67)
- [x] remove benchmarks for removed calls;
(paritytech@1a3d5f1)
- [x] prdoc
(paritytech@d579b67)
- [x] remove deprecated methods from the `treasury/README.md` and add
up-to-date dispatchable functions documentation
(paritytech@d579b67)
- [x] remove deprecated weight functions
(paritytech@8f74134)
> ### Separated to other issues
> - [ ] remove storage items like Proposals and ProposalCount, that are
not used anymore

Adjust all treasury pallet instances within polkadot-sdk
- [x] `pallet_bounty`, `tip`, `child_bounties`:
openguild-labs#3
- [x] Remove deprecated treasury weight functions used in Westend and
Rococo runtime `collective-westend`, `collective-rococo`

Add migration for westend and rococo to clean the data from removed
storage items
- [ ] paritytech#3828
# Test Outcomes
Successful tests by running `cargo test --features runtime-benchmarks`
```
running 38 tests
test tests::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
test benchmarking::benchmarks::bench_check_status ... ok
test benchmarking::benchmarks::bench_payout ... ok
test benchmarking::benchmarks::bench_spend_local ... ok
test tests::accepted_spend_proposal_enacted_on_spend_period ... ok
test benchmarking::benchmarks::bench_spend ... ok
test tests::accepted_spend_proposal_ignored_outside_spend_period ... ok
test benchmarking::benchmarks::bench_void_spend ... ok
test benchmarking::benchmarks::bench_remove_approval ... ok
test tests::genesis_funding_works ... ok
test tests::genesis_config_works ... ok
test tests::inexistent_account_works ... ok
test tests::minting_works ... ok
test tests::check_status_works ... ok
test tests::payout_retry_works ... ok
test tests::pot_underflow_should_not_diminish ... ok
test tests::remove_already_removed_approval_fails ... ok
test tests::spend_local_origin_permissioning_works ... ok
test tests::spend_valid_from_works ... ok
test tests::spend_expires ... ok
test tests::spend_works ... ok
test tests::test_genesis_config_builds ... ok
test tests::spend_payout_works ... ok
test tests::spend_local_origin_works ... ok
test tests::spend_origin_works ... ok
test tests::spending_local_in_batch_respects_max_total ... ok
test tests::spending_in_batch_respects_max_total ... ok
test tests::try_state_proposals_invariant_2_works ... ok
test tests::try_state_proposals_invariant_1_works ... ok
test tests::try_state_spends_invariant_2_works ... ok
test tests::try_state_spends_invariant_1_works ... ok
test tests::treasury_account_doesnt_get_deleted ... ok
test tests::try_state_spends_invariant_3_works ... ok
test tests::unused_pot_should_diminish ... ok
test tests::void_spend_works ... ok
test tests::try_state_proposals_invariant_3_works ... ok
test tests::max_approvals_limited ... ok
test benchmarking::benchmarks::bench_on_initialize_proposals ... ok

test result: ok. 38 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s

   Doc-tests pallet_treasury

running 2 tests
test substrate/frame/treasury/src/lib.rs - (line 52) ... ignored
test substrate/frame/treasury/src/lib.rs - (line 79) ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s
```

polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J
sfffaaa pushed a commit to peaqnetwork/polkadot-sdk that referenced this issue Dec 27, 2024
Remove unused config parameters `ApproveOrigin` and `OnSlash` from the
treasury pallet. Add `OnSlash` config parameter to the bounties and tips
pallets.

part of paritytech#3800
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I4-refactor Code needs refactoring.
Projects
None yet
Development

No branches or pull requests

3 participants