use orchard::circuit::ProvingKey;
use rand_core::OsRng;
use crate::Pczt;
impl super::Prover {
pub fn create_orchard_proof(self, pk: &ProvingKey) -> Result<Self, OrchardError> {
let Pczt {
global,
transparent,
sapling,
orchard,
} = self.pczt;
let mut bundle = orchard.into_parsed().map_err(OrchardError::Parser)?;
bundle
.create_proof(pk, OsRng)
.map_err(OrchardError::Prover)?;
Ok(Self {
pczt: Pczt {
global,
transparent,
sapling,
orchard: crate::orchard::Bundle::serialize_from(bundle),
},
})
}
}
#[derive(Debug)]
pub enum OrchardError {
Parser(orchard::pczt::ParseError),
Prover(orchard::pczt::ProverError),
}