Hashing proc macro utils (#9875)

* hashing macro

* fmt

* use in easy place, and fix blake sizes

* fix

* Fixes, docs.
Allow ident as input.

* fix doc tests

* update error in test (nmapkey and key are same type).

* hashing crates under sp_core

* Doc updates and format.

* use all existing hashing functions.

* return array of u8

* Update primitives/core/hashing/proc-macro/src/impls.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* ToTokeen for an array of u8

* fix

* re

* Improve impls

* complete doc tests

* fmt

* fix doctest format

* fix ui test (nmap key type alias)

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
cheme
2021-11-02 10:35:23 +01:00
committed by GitHub
parent 098815948a
commit 471e9cfbf1
14 changed files with 547 additions and 143 deletions
+26
View File
@@ -2051,6 +2051,7 @@ dependencies = [
"smallvec 1.7.0",
"sp-arithmetic",
"sp-core",
"sp-core-hashing-proc-macro",
"sp-inherents",
"sp-io",
"sp-runtime",
@@ -7919,6 +7920,7 @@ dependencies = [
"sc-tracing",
"sp-api",
"sp-core",
"sp-core-hashing-proc-macro",
"sp-externalities",
"sp-io",
"sp-maybe-compressed-blob",
@@ -9303,6 +9305,8 @@ dependencies = [
"serde",
"serde_json",
"sha2 0.9.8",
"sp-core-hashing",
"sp-core-hashing-proc-macro",
"sp-debug-derive",
"sp-externalities",
"sp-runtime-interface",
@@ -9319,6 +9323,28 @@ dependencies = [
"zeroize",
]
[[package]]
name = "sp-core-hashing"
version = "4.0.0-dev"
dependencies = [
"blake2-rfc",
"byteorder",
"sha2 0.9.8",
"sp-std",
"tiny-keccak",
"twox-hash",
]
[[package]]
name = "sp-core-hashing-proc-macro"
version = "4.0.0-dev"
dependencies = [
"proc-macro2",
"quote",
"sp-core-hashing",
"syn",
]
[[package]]
name = "sp-database"
version = "4.0.0-dev"