pub fn to_bech32(self, hrp: &str) -> String {
        let backward_compatible_amino_prefixed_pubkey = match self {
            PublicKey::Ed25519(ref pk) => {
                let mut key_bytes = vec![0x16, 0x24, 0xDE, 0x64, 0x20];
                key_bytes.extend(pk.as_bytes());
                key_bytes
            }
            #[cfg(feature = "secp256k1")]
            PublicKey::Secp256k1(ref pk) => {
                let mut key_bytes = vec![0xEB, 0x5A, 0xE9, 0x87, 0x21];
                key_bytes.extend(pk.to_bytes());
                key_bytes
            }
        };
        bech32::encode(hrp, backward_compatible_amino_prefixed_pubkey)
    }
/// Serialize this key as Bech32 with the given human readable prefix
Serialize this key as Bech32 with the given human readable prefix
Serialize this key as Bech32 with the given human readable prefix
pub fn to_bech32(self, hrp: &str) -> String {
        let backward_compatible_amino_prefixed_pubkey = match self {
            PublicKey::Ed25519(ref pk) => {
                let mut key_bytes = vec![0x16, 0x24, 0xDE, 0x64, 0x20];
                key_bytes.extend(pk.as_bytes());
                key_bytes
            }
            #[cfg(feature = "secp256k1")]
            PublicKey::Secp256k1(ref pk) => {
                let mut key_bytes = vec![0xEB, 0x5A, 0xE9, 0x87, 0x21];
                key_bytes.extend(pk.to_bytes());
                key_bytes
            }
        };
        bech32::encode(hrp, backward_compatible_amino_prefixed_pubkey)
    }
pub fn to_bech32 ( self , hrp : & str ) -> String { let backward_compatible_amino_prefixed_pubkey = match self { PublicKey :: Ed25519 ( ref pk ) => { let mut key_bytes = vec ! [ 0x16 0x24 0xDE 0x64 0x20 ] ; key_bytes . extend ( pk . as_bytes ( ) ) ; key_bytes } # [ cfg ( feature " " ) ] PublicKey :: Secp256k1 ( ref pk ) => { let mut key_bytes = vec ! [ 0xEB 0x5A 0xE9 0x87 0x21 ] ; key_bytes . extend ( pk . to_bytes ( ) ) ; key_bytes } } ; bech32 :: encode ( hrp , backward_compatible_amino_prefixed_pubkey ) }
Serialize this key as Bech32 with the given human readable prefix
Serialize this key as Bech32 with the given human readable prefix
self
hrp
&str