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:
Bastian Köcher
2020-10-17 09:43:46 +02:00
committed by GitHub
parent da8ce4f258
commit 158fdecc0b
7 changed files with 139 additions and 26 deletions
@@ -323,6 +323,14 @@ macro_rules! app_crypto_public_common {
)
}
}
impl<'a> $crate::TryFrom<&'a [u8]> for Public {
type Error = ();
fn try_from(data: &'a [u8]) -> Result<Self, Self::Error> {
<$public>::try_from(data).map(Into::into)
}
}
}
}