@@ -48,14 +48,15 @@ mod traits;
4848
4949pub use traits:: * ;
5050
51- /// Declares Public, Pair, Signature types which are functionally equivalent to `$pair`, but are new
52- /// Application-specific types whose identifier is `$key_type`.
51+ /// Declares `Public`, `Pair` and `Signature` types which are functionally equivalent
52+ /// to the corresponding types defined by `$module` but are new application-specific
53+ /// types whose identifier is `$key_type`.
5354///
5455/// ```rust
55- /// # use sp_application_crypto::{app_crypto, wrap, ed25519, KeyTypeId};
56- /// // Declare a new set of crypto types using Ed25519 logic that identifies as `KeyTypeId`
56+ /// # use sp_application_crypto::{app_crypto, ed25519, KeyTypeId};
57+ /// // Declare a new set of crypto types using ed25519 logic that identifies as `KeyTypeId`
5758/// // of value `b"fuba"`.
58- /// app_crypto!(ed25519, KeyTypeId(*b"_uba "));
59+ /// app_crypto!(ed25519, KeyTypeId(*b"fuba "));
5960/// ```
6061#[ cfg( feature = "full_crypto" ) ]
6162#[ macro_export]
@@ -78,14 +79,15 @@ macro_rules! app_crypto {
7879 } ;
7980}
8081
81- /// Declares Public, Pair, Signature types which are functionally equivalent to `$pair`, but are new
82- /// Application-specific types whose identifier is `$key_type`.
82+ /// Declares `Public`, `Pair` and `Signature` types which are functionally equivalent
83+ /// to the corresponding types defined by `$module` but that are new application-specific
84+ /// types whose identifier is `$key_type`.
8385///
8486/// ```rust
85- /// # use sp_application_crypto::{app_crypto, wrap, ed25519, KeyTypeId};
86- /// // Declare a new set of crypto types using Ed25519 logic that identifies as `KeyTypeId`
87+ /// # use sp_application_crypto::{app_crypto, ed25519, KeyTypeId};
88+ /// // Declare a new set of crypto types using ed25519 logic that identifies as `KeyTypeId`
8789/// // of value `b"fuba"`.
88- /// app_crypto!(ed25519, KeyTypeId(*b"_uba "));
90+ /// app_crypto!(ed25519, KeyTypeId(*b"fuba "));
8991/// ```
9092#[ cfg( not( feature = "full_crypto" ) ) ]
9193#[ macro_export]
@@ -107,8 +109,8 @@ macro_rules! app_crypto {
107109 } ;
108110}
109111
110- /// Declares Pair type which is functionally equivalent to `$pair`, but is new
111- /// Application -specific type whose identifier is `$key_type`.
112+ /// Declares ` Pair` type which is functionally equivalent to `$pair`, but is
113+ /// new application -specific type whose identifier is `$key_type`.
112114#[ macro_export]
113115macro_rules! app_crypto_pair {
114116 ( $pair: ty, $key_type: expr, $crypto_type: expr) => {
@@ -208,10 +210,10 @@ macro_rules! app_crypto_pair_functions_if_std {
208210 ( $pair: ty) => { } ;
209211}
210212
211- /// Declares Public type which is functionally equivalent to `$public`, but is new
212- /// Application -specific type whose identifier is `$key_type`.
213- /// can only be used together with `full_crypto` feature
214- /// For full functionality, app_crypto_public_common! must be called too .
213+ /// Declares ` Public` type which is functionally equivalent to `$public` but is
214+ /// new application -specific type whose identifier is `$key_type`.
215+ /// For full functionality, `app_crypto_public_common!` must be called too.
216+ /// Can only be used with `full_crypto` feature .
215217#[ doc( hidden) ]
216218#[ macro_export]
217219macro_rules! app_crypto_public_full_crypto {
@@ -244,10 +246,10 @@ macro_rules! app_crypto_public_full_crypto {
244246 } ;
245247}
246248
247- /// Declares Public type which is functionally equivalent to `$public`, but is new
248- /// Application -specific type whose identifier is `$key_type`.
249- /// can only be used without `full_crypto` feature
250- /// For full functionality, app_crypto_public_common! must be called too .
249+ /// Declares ` Public` type which is functionally equivalent to `$public` but is
250+ /// new application -specific type whose identifier is `$key_type`.
251+ /// For full functionality, `app_crypto_public_common!` must be called too.
252+ /// Can only be used without `full_crypto` feature .
251253#[ doc( hidden) ]
252254#[ macro_export]
253255macro_rules! app_crypto_public_not_full_crypto {
@@ -276,9 +278,9 @@ macro_rules! app_crypto_public_not_full_crypto {
276278 } ;
277279}
278280
279- /// Declares Public type which is functionally equivalent to `$public`, but is new
280- /// Application -specific type whose identifier is `$key_type`.
281- /// For full functionality, app_crypto_public_(not)_full_crypto! must be called too.
281+ /// Declares ` Public` type which is functionally equivalent to `$public` but is
282+ /// new application -specific type whose identifier is `$key_type`.
283+ /// For full functionality, ` app_crypto_public_(not)_full_crypto!` must be called too.
282284#[ doc( hidden) ]
283285#[ macro_export]
284286macro_rules! app_crypto_public_common {
@@ -307,40 +309,6 @@ macro_rules! app_crypto_public_common {
307309 type Generic = $public;
308310 }
309311
310- impl $crate:: RuntimeAppPublic for Public
311- where
312- $public: $crate:: RuntimePublic <Signature = $sig>,
313- {
314- const ID : $crate:: KeyTypeId = $key_type;
315- const CRYPTO_ID : $crate:: CryptoTypeId = $crypto_type;
316-
317- type Signature = Signature ;
318-
319- fn all( ) -> $crate:: Vec <Self > {
320- <$public as $crate:: RuntimePublic >:: all( $key_type)
321- . into_iter( )
322- . map( Self )
323- . collect( )
324- }
325-
326- fn generate_pair( seed: Option <$crate:: Vec <u8 >>) -> Self {
327- Self ( <$public as $crate:: RuntimePublic >:: generate_pair( $key_type, seed) )
328- }
329-
330- fn sign<M : AsRef <[ u8 ] >>( & self , msg: & M ) -> Option <Self :: Signature > {
331- <$public as $crate:: RuntimePublic >:: sign( self . as_ref( ) , $key_type, msg)
332- . map( Signature )
333- }
334-
335- fn verify<M : AsRef <[ u8 ] >>( & self , msg: & M , signature: & Self :: Signature ) -> bool {
336- <$public as $crate:: RuntimePublic >:: verify( self . as_ref( ) , msg, & signature. as_ref( ) )
337- }
338-
339- fn to_raw_vec( & self ) -> $crate:: Vec <u8 > {
340- <$public as $crate:: RuntimePublic >:: to_raw_vec( & self . 0 )
341- }
342- }
343-
344312 impl <' a> TryFrom <& ' a [ u8 ] > for Public {
345313 type Error = ( ) ;
346314
@@ -407,8 +375,8 @@ macro_rules! app_crypto_public_common_if_std {
407375
408376/// Declares Signature type which is functionally equivalent to `$sig`, but is new
409377/// Application-specific type whose identifier is `$key_type`.
410- /// can only be used together with `full_crypto` feature
411378/// For full functionality, app_crypto_public_common! must be called too.
379+ /// Can only be used with `full_crypto` feature
412380#[ doc( hidden) ]
413381#[ macro_export]
414382macro_rules! app_crypto_signature_full_crypto {
@@ -439,10 +407,10 @@ macro_rules! app_crypto_signature_full_crypto {
439407 } ;
440408}
441409
442- /// Declares Signature type which is functionally equivalent to `$sig`, but is new
443- /// Application -specific type whose identifier is `$key_type`.
444- /// can only be used without `full_crypto` feature
445- /// For full functionality, app_crypto_public_common! must be called too .
410+ /// Declares ` Signature` type which is functionally equivalent to `$sig`, but is new
411+ /// application -specific type whose identifier is `$key_type`.
412+ /// For full functionality, `app_crypto_signature_common` must be called too.
413+ /// Can only be used without `full_crypto` feature .
446414#[ doc( hidden) ]
447415#[ macro_export]
448416macro_rules! app_crypto_signature_not_full_crypto {
@@ -452,8 +420,8 @@ macro_rules! app_crypto_signature_not_full_crypto {
452420 #[ derive( Clone , Eq , PartialEq ,
453421 $crate:: codec:: Encode ,
454422 $crate:: codec:: Decode ,
455- $crate:: scale_info:: TypeInfo ,
456423 $crate:: RuntimeDebug ,
424+ $crate:: scale_info:: TypeInfo ,
457425 ) ]
458426 pub struct Signature ( $sig) ;
459427 }
@@ -469,9 +437,9 @@ macro_rules! app_crypto_signature_not_full_crypto {
469437 } ;
470438}
471439
472- /// Declares Signature type which is functionally equivalent to `$sig`, but is new
473- /// Application -specific type whose identifier is `$key_type`.
474- /// For full functionality, app_crypto_public_ (not)_full_crypto! must be called too.
440+ /// Declares ` Signature` type which is functionally equivalent to `$sig`, but is new
441+ /// application -specific type whose identifier is `$key_type`.
442+ /// For full functionality, app_crypto_signature_ (not)_full_crypto! must be called too.
475443#[ doc( hidden) ]
476444#[ macro_export]
477445macro_rules! app_crypto_signature_common {
0 commit comments