zcash_primitives 0.9.0

Rust implementations of the Zcash primitives
Documentation
//! Types related to computation of fees and change related to the Sapling components
//! of a transaction.

use crate::transaction::components::amount::Amount;

/// A trait that provides a minimized view of a Sapling input suitable for use in
/// fee and change calculation.
pub trait InputView<NoteRef> {
    /// An identifier for the input being spent.
    fn note_id(&self) -> &NoteRef;
    /// The value of the input being spent.
    fn value(&self) -> Amount;
}

/// A trait that provides a minimized view of a Sapling output suitable for use in
/// fee and change calculation.
pub trait OutputView {
    /// The value of the output being produced.
    fn value(&self) -> Amount;
}