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
@@ -25,9 +25,10 @@ mod app {
app_crypto!(sr25519, AUTHORITY_DISCOVERY);
}
/// An authority discovery authority keypair.
#[cfg(feature = "std")]
pub type AuthorityPair = app::Pair;
sp_application_crypto::with_pair! {
/// An authority discovery authority keypair.
pub type AuthorityPair = app::Pair;
}
/// An authority discovery authority identifier.
pub type AuthorityId = app::Public;