mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 17:17:56 +00:00
Refactor crypto-related traits implementations in term of Public/Signature Bytes (#3806)
Another simple refactory to prune some duplicate code Follow up of: https://github.com/paritytech/polkadot-sdk/pull/3684
This commit is contained in:
@@ -26,7 +26,7 @@ pub use sp_core::crypto::{DeriveError, Pair, SecretStringError};
|
||||
#[doc(hidden)]
|
||||
pub use sp_core::{
|
||||
self,
|
||||
crypto::{ByteArray, CryptoType, Derive, IsWrappedBy, Public, UncheckedFrom, Wraps},
|
||||
crypto::{ByteArray, CryptoType, Derive, IsWrappedBy, Public, Signature, UncheckedFrom, Wraps},
|
||||
RuntimeDebug,
|
||||
};
|
||||
|
||||
@@ -505,6 +505,12 @@ macro_rules! app_crypto_signature_common {
|
||||
}
|
||||
}
|
||||
|
||||
impl AsMut<[u8]> for Signature {
|
||||
fn as_mut(&mut self) -> &mut [u8] {
|
||||
self.0.as_mut()
|
||||
}
|
||||
}
|
||||
|
||||
impl $crate::AppSignature for Signature {
|
||||
type Generic = $sig;
|
||||
}
|
||||
@@ -525,6 +531,12 @@ macro_rules! app_crypto_signature_common {
|
||||
}
|
||||
}
|
||||
|
||||
impl $crate::Signature for Signature {}
|
||||
|
||||
impl $crate::ByteArray for Signature {
|
||||
const LEN: usize = <$sig>::LEN;
|
||||
}
|
||||
|
||||
impl Signature {
|
||||
/// Convert into wrapped generic signature type.
|
||||
pub fn into_inner(self) -> $sig {
|
||||
|
||||
Reference in New Issue
Block a user