This repository has been 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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makes storage hashers optional in dev mode (#13815)
* Initial changes * Adds UI test for error when _ is used without dev_mode * Minor * ".git/.scripts/commands/fmt/fmt.sh" * Adds test to verify hasher --------- Co-authored-by: command-bot <>
- Loading branch information
gupnik
committed
Apr 11, 2023
1 parent
ca6af5d
commit da9f88d
Showing
5 changed files
with
182 additions
and
12 deletions.
There are no files selected for viewing
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
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
33 changes: 33 additions & 0 deletions
33
frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
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<_, _, u32, u64>; | ||
|
||
#[pallet::storage] | ||
type MyStorageDoubleMap<T: Config> = StorageDoubleMap<_, _, u32, _, u64, u64>; | ||
|
||
#[pallet::storage] | ||
type MyCountedStorageMap<T: Config> = CountedStorageMap<_, _, u32, u64>; | ||
|
||
// Your Pallet's internal functions. | ||
impl<T: Config> Pallet<T> {} | ||
} | ||
|
||
fn main() {} |
19 changes: 19 additions & 0 deletions
19
frame/support/test/tests/pallet_ui/dev_mode_without_arg_default_hasher.stderr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases | ||
--> tests/pallet_ui/dev_mode_without_arg_default_hasher.rs:21:47 | ||
| | ||
21 | type MyStorageMap<T: Config> = StorageMap<_, _, u32, u64>; | ||
| ^ not allowed in type signatures | ||
|
||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases | ||
--> tests/pallet_ui/dev_mode_without_arg_default_hasher.rs:24:59 | ||
| | ||
24 | type MyStorageDoubleMap<T: Config> = StorageDoubleMap<_, _, u32, _, u64, u64>; | ||
| ^ ^ not allowed in type signatures | ||
| | | ||
| not allowed in type signatures | ||
|
||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for type aliases | ||
--> tests/pallet_ui/dev_mode_without_arg_default_hasher.rs:27:61 | ||
| | ||
27 | type MyCountedStorageMap<T: Config> = CountedStorageMap<_, _, u32, u64>; | ||
| ^ not allowed in type signatures |
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