Adds `unified::SealedContainer::network_hrp`
This commit is contained in:
parent
7d801cf71b
commit
3b70731cc4
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue