Adds with_pair! macro to application-crypto (#4885)

* Adds `with_pair!` macro to application-crypto

This macro will "generate" the given code only when the crypto pair is
available. So, when either the `std` or the `full_crypto` feature is
enabled.

* Fix example
This commit is contained in:
Bastian Köcher
2020-02-14 15:46:41 +01:00
committed by GitHub
parent d3a3e288b6
commit 91989cab46
6 changed files with 54 additions and 24 deletions
@@ -6,7 +6,7 @@ edition = "2018"
license = "GPL-3.0"
[dependencies]
app-crypto = { version = "2.0.0", default-features = false, package = "sp-application-crypto", path = "../application-crypto" }
sp-application-crypto = { version = "2.0.0", default-features = false, path = "../application-crypto" }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
@@ -16,13 +16,10 @@ sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime"
[features]
default = ["std"]
std = [
"app-crypto/std",
"sp-application-crypto/std",
"codec/std",
"sp-std/std",
"serde",
"sp-api/std",
"sp-runtime/std",
]
full_crypto = [
"app-crypto/full_crypto"
]