mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
Adds support for inspecting a hex encoded public key (#7344)
* Adds support for inspecting a hex encoded public key This adds support for inspecting hex encoded public keys to subkey. The command looks like: `subkey inspect --public 0xPUBLICHEX` * Update client/cli/src/commands/utils.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -583,7 +583,17 @@ impl<T: Sized + AsMut<[u8]> + AsRef<[u8]> + Default + Derive> Ss58Codec for T {
|
||||
|
||||
/// Trait suitable for typical cryptographic PKI key public type.
|
||||
pub trait Public:
|
||||
AsRef<[u8]> + AsMut<[u8]> + Default + Derive + CryptoType + PartialEq + Eq + Clone + Send + Sync
|
||||
AsRef<[u8]>
|
||||
+ AsMut<[u8]>
|
||||
+ Default
|
||||
+ Derive
|
||||
+ CryptoType
|
||||
+ PartialEq
|
||||
+ Eq
|
||||
+ Clone
|
||||
+ Send
|
||||
+ Sync
|
||||
+ for<'a> TryFrom<&'a [u8]>
|
||||
{
|
||||
/// A new instance from the given slice.
|
||||
///
|
||||
@@ -751,6 +761,14 @@ mod dummy {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a [u8]> for Dummy {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(_: &'a [u8]) -> Result<Self, ()> {
|
||||
Ok(Self)
|
||||
}
|
||||
}
|
||||
|
||||
impl CryptoType for Dummy {
|
||||
type Pair = Dummy;
|
||||
}
|
||||
@@ -1108,6 +1126,13 @@ mod tests {
|
||||
&mut []
|
||||
}
|
||||
}
|
||||
impl<'a> TryFrom<&'a [u8]> for TestPublic {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(_: &'a [u8]) -> Result<Self, ()> {
|
||||
Ok(Self)
|
||||
}
|
||||
}
|
||||
impl CryptoType for TestPublic {
|
||||
type Pair = TestPair;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user