Expose `Anchor::empty_tree`.

This commit is contained in:
Kris Nuttycombe 2023-12-20 20:08:51 -07:00
parent 3845686a6e
commit 189257391a
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,7 @@ and this project adheres to Rust's notion of
- `orchard::builder::BundleType`
- `orchard::builder::OutputInfo`
- `orchard::bundle::Flags::{ENABLED, SPENDS_DISABLED, OUTPUTS_DISABLED}`
- `orchard::tree::Anchor::empty_tree`
### Changed
- `orchard::builder::Builder::new` now takes the bundle type to be used

View File

@ -58,7 +58,12 @@ impl From<MerkleHashOrchard> for Anchor {
}
impl Anchor {
pub(crate) fn empty_tree() -> Anchor {
/// The anchor of the empty Orchard note commitment tree.
///
/// This anchor does not correspond to any valid anchor for a spend, so it
/// may only be used for coinbase bundles or in circumstances where Orchard
/// functionality is not active.
pub fn empty_tree() -> Anchor {
Anchor(MerkleHashOrchard::empty_root(Level::from(MERKLE_DEPTH_ORCHARD as u8)).0)
}