Adds `unified::SealedContainer::network_hrp`

This commit is contained in:
Kris Nuttycombe 2021-12-01 12:45:24 -07:00
parent 7d801cf71b
commit 3b70731cc4
1 changed files with 9 additions and 0 deletions

View File

@ -134,6 +134,7 @@ pub(crate) mod private {
io::Write,
};
use zcash_encoding::CompactSize;
use crate::Network;
/// A raw address or viewing key.
pub trait SealedItem:
@ -154,6 +155,14 @@ pub(crate) mod private {
/// general invariants that apply to all unified containers.
fn from_inner(items: Vec<Self::Item>) -> Self;
fn network_hrp(network: &Network) -> &'static str {
match network {
Network::Main => Self::MAINNET,
Network::Test => Self::TESTNET,
Network::Regtest => Self::REGTEST,
}
}
fn write_raw_encoding<W: Write>(&self, mut writer: W) {
for item in &self.items() {
let addr = item.data();