pub fn decode_transparent_address(
pubkey_version: &[u8],
script_version: &[u8],
s: &str,
) -> Result<Option<TransparentAddress>, Error>Expand description
Decodes a [TransparentAddress] from a Base58Check-encoded string.
ยงExamples
use zcash_address::constants::testnet;
use transparent::address::TransparentAddress;
use zcash_keys::{
encoding::decode_transparent_address,
};
assert_eq!(
decode_transparent_address(
&testnet::B58_PUBKEY_ADDRESS_PREFIX,
&testnet::B58_SCRIPT_ADDRESS_PREFIX,
"tm9iMLAuYMzJ6jtFLcA7rzUmfreGuKvr7Ma",
),
Ok(Some(TransparentAddress::PublicKeyHash([0; 20]))),
);
assert_eq!(
decode_transparent_address(
&testnet::B58_PUBKEY_ADDRESS_PREFIX,
&testnet::B58_SCRIPT_ADDRESS_PREFIX,
"t26YoyZ1iPgiMEWL4zGUm74eVWfhyDMXzY2",
),
Ok(Some(TransparentAddress::ScriptHash([0; 20]))),
);