chain: tweak docs for JoinSplitData, ShieldedData

This commit is contained in:
Henry de Valence 2020-08-17 02:22:55 -07:00
parent 5c176d2f96
commit d49d3d2b30
2 changed files with 16 additions and 2 deletions

View File

@ -5,7 +5,14 @@ use crate::{
sprout::JoinSplit, sprout::JoinSplit,
}; };
/// A bundle of JoinSplit descriptions and signature data. /// A bundle of [`JoinSplit`] descriptions and signature data.
///
/// JoinSplit descriptions are optional, but Zcash transactions must include a
/// JoinSplit signature and verification key if and only if there is at least one
/// JoinSplit description. This wrapper type bundles at least one JoinSplit
/// description with the required signature data, so that an
/// `Option<JoinSplitData>` correctly models the presence or absence of any
/// JoinSplit data.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct JoinSplitData<P: ZkSnarkProof> { pub struct JoinSplitData<P: ZkSnarkProof> {
/// The first JoinSplit description, using proofs of type `P`. /// The first JoinSplit description, using proofs of type `P`.

View File

@ -6,7 +6,14 @@ use crate::{
serialization::serde_helpers, serialization::serde_helpers,
}; };
/// Sapling-on-Groth16 spend and output descriptions. /// A bundle of [`Spend`] and [`Output`] descriptions and signature data.
///
/// Spend and Output descriptions are optional, but Zcash transactions must
/// include a binding signature if and only if there is at least one Spend *or*
/// Output description. This wrapper type bundles at least one Spend or Output
/// description with the required signature data, so that an
/// `Option<ShieldedData>` correctly models the presence or absence of any
/// shielded data.
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ShieldedData { pub struct ShieldedData {
/// Either a spend or output description. /// Either a spend or output description.