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
Adds ability to use default hasher in dev_mode for explicit key binding
#14164
Merged
paritytech-processbot
merged 11 commits into
master
from
gupnik/dev-mode-explict-binding
May 19, 2023
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
83ca67d
Initial setup
gupnik 0d9f897
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik 9894ee6
Minor update
gupnik 6c2ed0b
Minor update
gupnik 3ea501e
Addresses review comments
gupnik 54a95c6
Addresses review comments
gupnik a18aa2d
Merge branch 'master' of github.com:paritytech/substrate into gupnik/…
gupnik 6dd6fc8
Updates doc
gupnik 85eedda
".git/.scripts/commands/fmt/fmt.sh"
4ce0e38
Renames file
gupnik 2e60975
Updates path in test
gupnik 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
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
33 changes: 33 additions & 0 deletions
33
frame/support/test/tests/pallet_ui/dev_mode_explicit_key_without_arg_default_hasher.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 |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #![cfg_attr(not(feature = "std"), no_std)] | ||
gupnik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| pub use pallet::*; | ||
|
|
||
| #[frame_support::pallet] | ||
| pub mod pallet { | ||
| use frame_support::pallet_prelude::*; | ||
|
|
||
| // The struct on which we build all of our Pallet logic. | ||
| #[pallet::pallet] | ||
| pub struct Pallet<T>(_); | ||
|
|
||
| // Your Pallet's configuration trait, representing custom external types and interfaces. | ||
| #[pallet::config] | ||
| pub trait Config: frame_system::Config {} | ||
|
|
||
| #[pallet::storage] | ||
| type MyStorage<T: Config> = StorageValue<_, Vec<u8>>; | ||
|
|
||
| #[pallet::storage] | ||
| type MyStorageMap<T: Config> = StorageMap<Key = u32, Value = u64>; | ||
|
|
||
| #[pallet::storage] | ||
| type MyStorageDoubleMap<T: Config> = StorageDoubleMap<Key1 = u32, Key2 = u64, Value = u64>; | ||
|
|
||
| #[pallet::storage] | ||
| type MyCountedStorageMap<T: Config> = CountedStorageMap<Key = u32, Value = u64>; | ||
|
|
||
| // Your Pallet's internal functions. | ||
| impl<T: Config> Pallet<T> {} | ||
| } | ||
|
|
||
| fn main() {} | ||
11 changes: 11 additions & 0 deletions
11
frame/support/test/tests/pallet_ui/dev_mode_explicit_key_without_arg_default_hasher.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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| error: Invalid pallet::storage, cannot find `Hasher` generic, required for `StorageMap`. | ||
| --> tests/pallet_ui/dev_mode_explicit_key_without_arg_default_hasher.rs:21:43 | ||
| | | ||
| 21 | type MyStorageMap<T: Config> = StorageMap<Key = u32, Value = u64>; | ||
| | ^ | ||
|
|
||
| error[E0432]: unresolved import `pallet` | ||
| --> tests/pallet_ui/dev_mode_explicit_key_without_arg_default_hasher.rs:3:9 | ||
| | | ||
| 3 | pub use pallet::*; | ||
| | ^^^^^^ help: a similar path exists: `test_pallet::pallet` |
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
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.
Uh oh!
There was an error while loading. Please reload this page.