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.7k
Remove use of trait Store from all pallets and deprecate it. #13535
Merged
paritytech-processbot
merged 70 commits into
paritytech:master
from
vivekvpandya:vivek-issue-13260
Mar 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
bdc5cdb
Remove use of trait Store from staking pallet
vivekvpandya 1337059
Remove use of trait Store from bounties pallet
vivekvpandya b46648a
Remove use of trait Store from collective pallet
vivekvpandya d9086f9
Remove use of trait Store from babe pallet
vivekvpandya 4017a4b
Remove use of trait Store from assets pallet
vivekvpandya d2df7ae
Remove use of trait Store from grandpa pallet
vivekvpandya 16cd888
Remove use of trait Store from balances pallet
vivekvpandya bd9473f
Remove use of trait Store from authorship pallet
vivekvpandya 21660ad
Remove use of trait Store from authority-discovery pallet
vivekvpandya 9c2673b
Remove use of trait Store from atomic-swap pallet
vivekvpandya 91c2014
Remove use of trait Store from sudo pallet
vivekvpandya 0ce416a
Remove use of trait Store from scheduler pallet
vivekvpandya 3a91cfe
Remove use of trait Store from scored-pool pallet
vivekvpandya 26f65e5
Remove use of trait Store from society pallet
vivekvpandya e32ec20
Remove use of trait Store from lottery pallet
vivekvpandya 9288d53
Remove use of trait Store from executive pallet
vivekvpandya 236d62e
Remove use of trait Store from democracy pallet
vivekvpandya 3fa3fc2
Remove use of trait Store from elections-phragmen pallet
vivekvpandya 19a092c
Remove use of trait Store from indices pallet
vivekvpandya a52c4bc
Remove use of trait Store from identity pallet
vivekvpandya cfe170a
Remove use of trait Store from multisig pallet
vivekvpandya 159a492
Remove use of trait Store from merkle-mountain-range pallet
vivekvpandya 546af25
Remove use of trait Store from im-online pallet
vivekvpandya 39fbf2b
Remove use of trait Store from membership pallet
vivekvpandya 5830e23
Remove use of trait Store from nicks pallet
vivekvpandya 5798277
Remove use of trait Store from session pallet
vivekvpandya f14a4bd
Remove use of trait Store from transaction-payment pallet
vivekvpandya aa1a692
Remove use of trait Store from utility pallet
vivekvpandya 48c31de
Remove use of trait Store from child-bounties pallet
vivekvpandya 99599e9
Remove use of trait Store from nis pallet
vivekvpandya 81eda70
Remove use of trait Store from nfts pallet
vivekvpandya 7f4e38f
Remove use of trait Store from conviction-voting pallet
vivekvpandya 622725b
Remove use of trait Store from treasury pallet
vivekvpandya bb503a0
Remove use of trait Store from vesting pallet
vivekvpandya db046e4
Remove use of trait Store from preimage pallet
vivekvpandya ee461d8
Remove use of trait Store from uniques pallet
vivekvpandya a583a20
Remove use of trait Store from ranked-collective pallet
vivekvpandya 95312e9
Remove use of trait Store from beefy-mmr pallet
vivekvpandya 056c344
Remove use of trait Store from referenda pallet
vivekvpandya 2e754a9
Remove use of trait Store from whitelist pallet
vivekvpandya 5b14f52
Remove use of trait Store from alliance pallet
vivekvpandya cdd33e8
Remove use of trait Store from nomination-pools pallet
vivekvpandya c047b40
Remove use of trait Store from state-trie-migration pallet
vivekvpandya 18bdc65
Remove use of trait Store from message-queue pallet
vivekvpandya fd88b09
Remove use of trait Store from root-offences pallet
vivekvpandya f29edf5
Remove use of trait Store from root-testing pallet
vivekvpandya 0e55d98
Remove use of trait Store from timestamps pallet
vivekvpandya 86524c2
Remove use of trait Store from system pallet
vivekvpandya 2796879
Remove use of trait Store from offences pallet
vivekvpandya 6751fe1
Remove use of trait Store from recovery pallet
vivekvpandya e2a0d94
Remove use of trait Store from node-authorization pallet
vivekvpandya a7986e6
Remove use of trait Store from proxy pallet
vivekvpandya 03bbbd7
Remove use of trait Store from benchmarking pallet
vivekvpandya 45ea583
Remove use of trait Store from bags-list pallet
vivekvpandya 4cdb71f
Add deprecated warning in store_trait
vivekvpandya abc4a04
Change warning message
vivekvpandya 73c1a0d
Run cargo fmt
vivekvpandya 38c26c0
Merge branch 'master' into vivek-issue-13260
vivekvpandya 24f386e
Fix warning and update tests
vivekvpandya 4867664
Remove unnecessary allow deprecated
vivekvpandya be55375
Remove use of trait Store
vivekvpandya 7b2710a
Fix mismatch in expected output
vivekvpandya 1c646fe
Merge branch 'master' into vivek-issue-13260
vivekvpandya 27775d8
Minor update to warning message for deprecation of generate_store wit…
vivekvpandya 4a97fec
Fixes as per review comments
vivekvpandya ed2a170
Fixes as per review suggestions
vivekvpandya 5b37e47
Merge branch 'master' into vivek-issue-13260
vivekvpandya 7d0f130
Remove use of Store trait from core-fellowship pallet
vivekvpandya 637d0ea
Fix type in store_trait.rs
vivekvpandya 7bbedf1
Fixes as pre review comment
vivekvpandya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixes as per review comments
- Loading branch information
commit 4a97fec631bb6edb412c83bbd581a3bbaee9cad1
There are no files selected for viewing
This file contains hidden or 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
13 changes: 0 additions & 13 deletions
13
frame/support/test/tests/pallet_ui/deprecated_store_attr.rs
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,11 @@ | ||
| #[frame_support::pallet] | ||
| mod pallet { | ||
| use frame_support::pallet_prelude::Hooks; | ||
| use frame_system::pallet_prelude::BlockNumberFor; | ||
| use frame_support::pallet_prelude::StorageValue; | ||
|
|
||
| #[pallet::config] | ||
| pub trait Config: frame_system::Config {} | ||
|
|
||
| #[pallet::pallet] | ||
| #[pallet::generate_store(trait Store)] | ||
| pub struct Pallet<T>(core::marker::PhantomData<T>); | ||
|
|
||
| #[pallet::hooks] | ||
| impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {} | ||
|
|
||
| #[pallet::call] | ||
| impl<T: Config> Pallet<T> {} | ||
|
|
||
| #[pallet::storage] | ||
| type Foo<T> = StorageValue<_, u8>; | ||
| } | ||
|
|
||
| fn main() {} |
14 changes: 7 additions & 7 deletions
14
frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| error: use of deprecated trait `pallet::Store`: Use of #[pallet::generate_store(pub(super) trait Store)] will be removed soon. | ||
| error: use of deprecated trait `pallet::Store`: Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed soon. | ||
| Check https://github.com/paritytech/substrate/pull/13535 for more details. | ||
| --> $DIR/deprecated_store_attr.rs:11:33 | ||
| | | ||
| 11 | #[pallet::generate_store(trait Store)] | ||
| | ^^^^^ | ||
| | | ||
| = note: `-D deprecated` implied by `-D warnings` | ||
| --> tests/pallet_ui/deprecated_store_attr.rs:7:3 | ||
| | | ||
| 7 | #[pallet::generate_store(trait Store)] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! Ty! |
||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| = note: `-D deprecated` implied by `-D warnings` | ||
10 changes: 5 additions & 5 deletions
10
frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| error: use of deprecated trait `pallet::Store`: Use of #[pallet::generate_store(pub(super) trait Store)] will be removed soon. | ||
| error: use of deprecated trait `pallet::Store`: Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed soon. | ||
| Check https://github.com/paritytech/substrate/pull/13535 for more details. | ||
| --> $DIR/store_trait_leak_private.rs:11:37 | ||
| --> tests/pallet_ui/store_trait_leak_private.rs:11:3 | ||
| | | ||
| 11 | #[pallet::generate_store(pub trait Store)] | ||
| | ^^^^^ | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | | ||
| = note: `-D deprecated` implied by `-D warnings` | ||
|
|
||
| error[E0446]: private type `_GeneratedPrefixForStorageFoo<T>` in public interface | ||
| --> $DIR/store_trait_leak_private.rs:11:37 | ||
| --> tests/pallet_ui/store_trait_leak_private.rs:11:3 | ||
| | | ||
| 11 | #[pallet::generate_store(pub trait Store)] | ||
| | ^^^^^ can't leak private type | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type | ||
| ... | ||
| 20 | #[pallet::storage] | ||
| | ------- `_GeneratedPrefixForStorageFoo<T>` declared as private |
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.
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.
If anything, this
spanvariable should be updated to the span of the entire attribute, and not by mutating the span of theStorekeyword`.In general, it's best not to modify the meaning of what the fields represent. A span in the keyword means a span for the keyword; modifying it to represent anything else to solve a problem is considered a hack.
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.
ed2a170