transparent::ExternalPubKey: impl TryFrom for &[u8; 65].

This commit is contained in:
therealyingtong 2022-01-24 14:41:40 +08:00
parent 4068075ffd
commit 8b0c1c4ab2
1 changed files with 2 additions and 2 deletions

View File

@ -31,10 +31,10 @@ pub fn pubkey_to_address(pubkey: &secp256k1::key::PublicKey) -> TransparentAddre
#[derive(Clone, Debug)]
pub struct ExternalPubKey(pub ExtendedPubKey);
impl std::convert::TryFrom<&[u8]> for ExternalPubKey {
impl std::convert::TryFrom<&[u8; 65]> for ExternalPubKey {
type Error = hdwallet::error::Error;
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
fn try_from(data: &[u8; 65]) -> Result<Self, Self::Error> {
let ext_pub_key = ExtendedPubKey::deserialize(data)?;
Ok(Self(ext_pub_key))
}