pub fn new(prefix: &str, bytes: [u8; tendermint::account::LENGTH]) -> Result<Self> {
        let id = bech32::encode(prefix, &bytes);

        // TODO(tarcieri): ensure this is the proper validation for an account prefix
        if prefix.chars().all(|c| matches!(c, 'a'..='z')) {
            Ok(Self {
                bech32: id,
                hrp_length: prefix.len(),
            })
        } else {
            Err(Error::AccountId { id })
                .wrap_err("expected prefix to be lowercase alphabetical characters only")
        }
    }
/// Create an [`AccountId`] with the given human-readable prefix and
/// public key hash.
Create an [`AccountId`] with the given human-readable prefix and
public key hash.
Create an [ ` AccountId ` ] with the given human - readable prefix and public key hash .
pub fn new(prefix: &str, bytes: [u8; tendermint::account::LENGTH]) -> Result<Self> {
        let id = bech32::encode(prefix, &bytes);
        // TODO(tarcieri): ensure this is the proper validation for an account prefix
        if prefix.chars().all(|c| matches!(c, 'a'..='z')) {
            Ok(Self {
                bech32: id,
                hrp_length: prefix.len(),
            })
        } else {
            Err(Error::AccountId { id })
                .wrap_err("expected prefix to be lowercase alphabetical characters only")
        }
    }
pub fn new ( prefix : & str , bytes : [ u8 ; tendermint :: account :: LENGTH ] ) -> Result < Self > { let id = bech32 :: encode ( prefix , & bytes ) ; // TODO(tarcieri): ensure this is the proper validation for an account prefix if prefix . chars ( ) . all ( | c | matches ! ( c 'a' 'z' ) ) { Ok ( Self { bech32 : id , hrp_length : prefix . len ( ) , } ) } else { Err ( Error :: AccountId { id } ) . wrap_err ( " " ) } }
Create an [`AccountId`] with the given human-readable prefix and
public key hash.
Create an [ ` AccountId ` ] with the given human - readable prefix and public key hash .
prefix
&str
bytes
[u8; tendermint::account::LENGTH]
prefix
&str
bytes
[u8; tendermint::account::LENGTH]