im-online: use generic crypto (#3500)

* im-online: support using ed25519 and sr25519 crypto

* app-crypto: add trait bounds to RuntimePublic::Signature

* im-online: add missing type annotations

* authority-discovery: depend on im-online module and use its crypto

* node: set i'm online crypto to sr25519

* node: bump spec_version

* rpc: don't generate i'm online pubkey in insert_key method

* im-online: fix docs

* im-online: move app crypto packages

* aura: move app crypto packages
This commit is contained in:
André Silva
2019-08-28 13:46:52 +01:00
committed by Bastian Köcher
parent b5c6cc3996
commit 574f68fd7e
9 changed files with 157 additions and 103 deletions
@@ -17,6 +17,7 @@
use primitives::crypto::{KeyTypeId, CryptoType, IsWrappedBy, Public};
#[cfg(feature = "std")]
use primitives::crypto::Pair;
use codec::Codec;
/// An application-specific key.
pub trait AppKey: 'static + Send + Sync + Sized + CryptoType + Clone {
@@ -72,7 +73,7 @@ pub trait AppSignature: AppKey + Eq + PartialEq + MaybeDebugHash {
/// A runtime interface for a public key.
pub trait RuntimePublic: Sized {
/// The signature that will be generated when signing with the corresponding private key.
type Signature;
type Signature: Codec + MaybeDebugHash + Eq + PartialEq + Clone;
/// Returns all public keys for the given key type in the keystore.
fn all(key_type: KeyTypeId) -> crate::Vec<Self>;
@@ -97,7 +98,7 @@ pub trait RuntimePublic: Sized {
/// A runtime interface for an application's public key.
pub trait RuntimeAppPublic: Sized {
/// The signature that will be generated when signing with the corresponding private key.
type Signature;
type Signature: Codec + MaybeDebugHash + Eq + PartialEq + Clone;
/// Returns all public keys for this application in the keystore.
fn all() -> crate::Vec<Self>;