use super::*;
mod bytes;
mod parse;
mod serialize;
#[derive(Clone, PartialEq, Eq)]
pub struct Proof<N: Network> {
proof: marlin::Proof<N::PairingCurve>,
}
impl<N: Network> Proof<N> {
pub(super) const fn new(proof: marlin::Proof<N::PairingCurve>) -> Self {
Self { proof }
}
}
impl<N: Network> Deref for Proof<N> {
type Target = marlin::Proof<N::PairingCurve>;
fn deref(&self) -> &Self::Target {
&self.proof
}
}
#[cfg(test)]
mod tests {
use super::*;
use console::network::Testnet3;
use once_cell::sync::OnceCell;
type CurrentNetwork = Testnet3;
pub(super) fn sample_proof() -> Proof<CurrentNetwork> {
static INSTANCE: OnceCell<Proof<CurrentNetwork>> = OnceCell::new();
INSTANCE
.get_or_init(|| {
let transition = crate::process::test_helpers::sample_transition();
transition.proof().clone()
})
.clone()
}
}