Remove default hasher (#4739)

* remove default hasher from decl_storage!

* fix decl_storage declarations
This commit is contained in:
thiolliere
2020-01-27 18:23:10 +01:00
committed by Gavin Wood
parent 38a01f3c65
commit 76acc96f3a
35 changed files with 193 additions and 141 deletions
@@ -35,8 +35,8 @@ use proc_macro::TokenStream;
/// decl_storage! {
/// trait Store for Module<T: Trait> as Example {
/// Foo get(fn foo) config(): u32=12;
/// Bar: map u32 => u32;
/// pub Zed build(|config| vec![(0, 0)]): linked_map u32 => u32;
/// Bar: map hasher(blake2_256) u32 => u32;
/// pub Zed build(|config| vec![(0, 0)]): linked_map hasher(blake2_256) u32 => u32;
/// }
/// }
/// ```
@@ -74,7 +74,7 @@ use proc_macro::TokenStream;
/// `$hash` representing a choice of hashing algorithms available in the
/// [`Hashable`](../frame_support/trait.Hashable.html) trait.
///
/// `hasher($hash)` is optional and its default is `blake2_256`. One should use another hasher
/// `blake2_256` and `blake2_128_concat` are strong hasher. One should use another hasher
/// with care, see generator documentation.
///
/// The generator is implemented with:
@@ -95,7 +95,7 @@ use proc_macro::TokenStream;
/// `$hash` representing a choice of hashing algorithms available in the
/// [`Hashable`](../frame_support/trait.Hashable.html) trait.
///
/// `hasher($hash)` is optional and its default is `blake2_256`. One should use another hasher
/// `blake2_256` and `blake2_128_concat` are strong hasher. One should use another hasher
/// with care, see generator documentation.
///
/// All key formatting logic can be accessed in a type-agnostic format via the
@@ -126,13 +126,12 @@ use proc_macro::TokenStream;
/// [`Hashable`](../frame_support/trait.Hashable.html) trait. They must be choosen with care, see
/// generator documentation.
///
/// `hasher($hash1)` and `hasher($hash2) are optional and default to `blake2_256`.
/// One should use another hasher with care, see generator documentation.
///
/// If the first key is untrusted, a cryptographic `hasher` such as `blake2_256` must be used.
/// If the first key is untrusted, a cryptographic `hasher` such as `blake2_256` or
/// `blake2_128_concat` must be used.
/// Otherwise, other values of all storage items can be compromised.
///
/// If the second key is untrusted, a cryptographic `hasher` such as `blake2_256` must be used.
/// If the second key is untrusted, a cryptographic `hasher` such as `blake2_256` or
/// `blake2_128_concat` must be used.
/// Otherwise, other items in storage with the same first key can be compromised.
///
/// The generator is implemented with: