mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +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:
@@ -36,7 +36,7 @@ use crate::{hashing::blake2_256, crypto::{Pair as TraitPair, DeriveJunction, Sec
|
||||
use crate::crypto::Ss58Codec;
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{de, Serializer, Serialize, Deserializer, Deserialize};
|
||||
use crate::crypto::{Public as TraitPublic, UncheckedFrom, CryptoType, Derive, CryptoTypeId};
|
||||
use crate::crypto::{Public as TraitPublic, CryptoTypePublicPair, UncheckedFrom, CryptoType, Derive, CryptoTypeId};
|
||||
#[cfg(feature = "full_crypto")]
|
||||
use secp256k1::{PublicKey, SecretKey};
|
||||
|
||||
@@ -118,6 +118,10 @@ impl TraitPublic for Public {
|
||||
r.copy_from_slice(data);
|
||||
Self(r)
|
||||
}
|
||||
|
||||
fn to_public_crypto_pair(&self) -> CryptoTypePublicPair {
|
||||
CryptoTypePublicPair(CRYPTO_ID, self.to_raw_vec())
|
||||
}
|
||||
}
|
||||
|
||||
impl Derive for Public {}
|
||||
|
||||
Reference in New Issue
Block a user