mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 12:11:09 +00:00
optimize double map first key hash (#2451)
* fix double map encoding it is now encoded as specified in the doc
This commit is contained in:
@@ -54,7 +54,7 @@ use proc_macro::TokenStream;
|
||||
///
|
||||
/// `hasher($hash)` is optional and its default is `blake2_256`.
|
||||
///
|
||||
/// /!\ Be careful with each key in the map that is inserted in the trie `$hash(module_name ++ storage_name ++ key)`.
|
||||
/// /!\ Be careful with each key in the map that is inserted in the trie `$hash(module_name ++ " " ++ storage_name ++ encoding(key))`.
|
||||
/// If the keys are not trusted (e.g. can be set by a user), a cryptographic `hasher` such as
|
||||
/// `blake2_256` must be used. Otherwise, other values in storage can be compromised.
|
||||
///
|
||||
@@ -71,7 +71,7 @@ use proc_macro::TokenStream;
|
||||
/// The final key is calculated as follows:
|
||||
///
|
||||
/// ```nocompile
|
||||
/// $hash(module_name ++ storage_name ++ first_key) ++ $hash2(second_key)
|
||||
/// $hash(module_name ++ " " ++ storage_name ++ encoding(first_key)) ++ $hash2(encoding(second_key))
|
||||
/// ```
|
||||
///
|
||||
/// If the first key is untrusted, a cryptographic `hasher` such as `blake2_256` must be used.
|
||||
|
||||
Reference in New Issue
Block a user