masp_primitives/
lib.rs

1//! *General MASP primitives.*
2//!
3//! `masp_primitives` is a library that provides the core structs and functions necessary
4//! for working with MASP based on Zcash Sapling.
5
6#![cfg_attr(docsrs, feature(doc_cfg))]
7// Catch documentation errors caused by code changes.
8#![deny(rustdoc::broken_intra_doc_links)]
9// Temporary until we have addressed all Result<T, ()> cases.
10#![allow(clippy::result_unit_err)]
11// Allow absurd MAX_MONEY comparisons in case MAX_MONEY is ever changed
12#![allow(clippy::absurd_extreme_comparisons)]
13// Allow manual RangeIncludes for now
14#![allow(clippy::manual_range_contains)]
15// TODO
16#![allow(clippy::derived_hash_with_manual_eq)]
17
18pub mod asset_type;
19pub mod consensus;
20pub mod constants;
21pub mod convert;
22pub mod keys;
23pub mod memo;
24pub mod merkle_tree;
25pub mod sapling;
26pub mod transaction;
27pub mod zip32;
28
29pub use bls12_381;
30pub use ff;
31pub use group;
32pub use jubjub;
33pub use num_traits;
34
35#[cfg(test)]
36mod test_vectors;
37
38#[cfg(not(feature = "arbitrary"))]
39pub trait MaybeArbitrary<'a> {}
40
41#[cfg(not(feature = "arbitrary"))]
42impl<'a, T> MaybeArbitrary<'a> for T {}
43
44#[cfg(feature = "arbitrary")]
45pub trait MaybeArbitrary<'a>: arbitrary::Arbitrary<'a> {}
46
47#[cfg(feature = "arbitrary")]
48impl<'a, T: for<'b> arbitrary::Arbitrary<'b>> MaybeArbitrary<'a> for T {}