mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 16:21:06 +00:00
Convert Public to CryptoTypePublicPair (#6014)
* Tabify code * Implement CryptoTypePublicPair in app_crypto * Cleanup redundancy * Introduce to_public_crypto_pair to Public trait * Implement method for test
This commit is contained in:
@@ -22,24 +22,11 @@ use sp_std::vec::Vec;
|
||||
|
||||
mod app {
|
||||
use sp_application_crypto::{
|
||||
CryptoTypePublicPair,
|
||||
key_types::AUTHORITY_DISCOVERY,
|
||||
Public as _,
|
||||
app_crypto,
|
||||
sr25519};
|
||||
sr25519,
|
||||
};
|
||||
app_crypto!(sr25519, AUTHORITY_DISCOVERY);
|
||||
|
||||
impl From<Public> for CryptoTypePublicPair {
|
||||
fn from(key: Public) -> Self {
|
||||
(&key).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&Public> for CryptoTypePublicPair {
|
||||
fn from(key: &Public) -> Self {
|
||||
CryptoTypePublicPair(sr25519::CRYPTO_ID, key.to_raw_vec())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sp_application_crypto::with_pair! {
|
||||
|
||||
Reference in New Issue
Block a user