Clarify Transaction docs to point to iterator methods.

Closes #191.
This commit is contained in:
Henry de Valence 2020-01-23 13:06:30 -08:00
parent 842a29b90c
commit 4d5c8c7940
2 changed files with 18 additions and 0 deletions

View File

@ -56,8 +56,15 @@ pub struct JoinSplitData<P: ZkSnarkProof> {
///
/// Storing this separately from `rest` ensures that it is impossible
/// to construct an invalid `JoinSplitData` with no `JoinSplit`s.
///
/// However, it's not necessary to access or process `first` and `rest`
/// separately, as the [`JoinSplitData::joinsplits`] method provides an
/// iterator over all of the `JoinSplit`s.
pub first: JoinSplit<P>,
/// The rest of the JoinSplit descriptions, using proofs of type `P`.
///
/// The [`JoinSplitData::joinsplits`] method provides an iterator over
/// all `JoinSplit`s.
pub rest: Vec<JoinSplit<P>>,
/// The public key for the JoinSplit signature.
// XXX refine to a Zcash-flavored Ed25519 pubkey.

View File

@ -66,10 +66,21 @@ pub struct ShieldedData {
///
/// Storing this separately ensures that it is impossible to construct
/// an invalid `ShieldedData` with no spends or outputs.
///
/// However, it's not necessary to access or process `first` and `rest`
/// separately, as the [`ShieldedData::spends`] and [`ShieldedData::outputs`]
/// methods provide iterators over all of the [`SpendDescription`]s and
/// [`OutputDescription`]s.
pub first: Either<SpendDescription, OutputDescription>,
/// The rest of the [`SpendDescription`]s for this transaction.
///
/// Note that the [`ShieldedData::spends`] method provides an iterator
/// over all spend descriptions.
pub rest_spends: Vec<SpendDescription>,
/// The rest of the [`OutputDescription`]s for this transaction.
///
/// Note that the [`ShieldedData::outputs`] method provides an iterator
/// over all output descriptions.
pub rest_outputs: Vec<OutputDescription>,
/// A signature on the transaction hash.
pub binding_sig: redjubjub::Signature<Binding>,