Skip to main content

pczt/roles/verifier/
mod.rs

1//! The Verifier role (anyone can inspect).
2//!
3//! This isn't a real role per se; it's instead a way for accessing the parsed
4//! protocol-specific bundles for individual access and verification.
5
6use crate::Pczt;
7
8#[cfg(feature = "orchard")]
9mod orchard;
10#[cfg(feature = "orchard")]
11pub use orchard::OrchardError;
12
13#[cfg(feature = "sapling")]
14mod sapling;
15#[cfg(feature = "sapling")]
16pub use sapling::SaplingError;
17
18#[cfg(feature = "transparent")]
19mod transparent;
20#[cfg(feature = "transparent")]
21pub use transparent::TransparentError;
22
23pub struct Verifier {
24    pczt: Pczt,
25}
26
27impl Verifier {
28    /// Instantiates the Verifier role with the given PCZT.
29    pub fn new(pczt: Pczt) -> Self {
30        Self { pczt }
31    }
32
33    /// Finishes the Verifier role, returning the updated PCZT.
34    pub fn finish(self) -> Pczt {
35        self.pczt
36    }
37}