Add crypto identifier to RuntimeAppPublic (#5965)

* Add crypto identifier to RuntimeAppPublic

* Update primitives/application-crypto/src/traits.rs

Co-authored-by: Gavin Wood <github@gavwood.com>

Co-authored-by: Gavin Wood <github@gavwood.com>
This commit is contained in:
Rakan Alhneiti
2020-05-11 14:32:29 +02:00
committed by GitHub
parent ed6c5bb190
commit 3123622cbe
4 changed files with 12 additions and 7 deletions
@@ -18,7 +18,7 @@
use sp_core::crypto::Pair;
use codec::Codec;
use sp_core::crypto::{KeyTypeId, CryptoType, IsWrappedBy, Public};
use sp_core::crypto::{KeyTypeId, CryptoType, CryptoTypeId, IsWrappedBy, Public};
use sp_std::{fmt::Debug, vec::Vec};
/// An application-specific key.
@@ -115,6 +115,8 @@ pub trait RuntimePublic: Sized {
pub trait RuntimeAppPublic: Sized {
/// An identifier for this application-specific key type.
const ID: KeyTypeId;
/// The identifier of the crypto type of this application-specific key type.
const CRYPTO_ID: CryptoTypeId;
/// The signature that will be generated when signing with the corresponding private key.
type Signature: Codec + Debug + MaybeHash + Eq + PartialEq + Clone;