Compare commits
2 Commits
87c050d829
...
e15551b618
Author | SHA1 | Date |
---|---|---|
Kris Nuttycombe | e15551b618 | |
Kris Nuttycombe | fa225d479a |
|
@ -857,7 +857,7 @@ impl UnifiedFullViewingKey {
|
|||
zcash_address::unified::Ufvk::try_from_items(
|
||||
if self.expiry_height().is_some()
|
||||
|| self.expiry_time().is_some()
|
||||
|| !(self.sapling.is_some() || self.orchard.is_some())
|
||||
|| !(self.has_sapling() || self.has_orchard())
|
||||
{
|
||||
Revision::R1
|
||||
} else {
|
||||
|
@ -904,12 +904,28 @@ impl UnifiedFullViewingKey {
|
|||
self.sapling.as_ref()
|
||||
}
|
||||
|
||||
/// Returns whether this UFVK contains a Sapling item.
|
||||
pub fn has_sapling(&self) -> bool {
|
||||
#[cfg(feature = "sapling")]
|
||||
return self.sapling.is_some();
|
||||
#[cfg(not(feature = "sapling"))]
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Returns the Orchard full viewing key component of this unified key.
|
||||
#[cfg(feature = "orchard")]
|
||||
pub fn orchard(&self) -> Option<&orchard::keys::FullViewingKey> {
|
||||
self.orchard.as_ref()
|
||||
}
|
||||
|
||||
/// Returns whether this UFVK contains an Orchard item.
|
||||
pub fn has_orchard(&self) -> bool {
|
||||
#[cfg(feature = "orchard")]
|
||||
return self.orchard.is_some();
|
||||
#[cfg(not(feature = "orchard"))]
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Returns any unknown data items parsed from the encoded form of the key.
|
||||
pub fn unknown_data(&self) -> &[(u32, Vec<u8>)] {
|
||||
self.unknown_data.as_ref()
|
||||
|
|
Loading…
Reference in New Issue