Skip to main content

TxMeta

Trait TxMeta 

Source
pub trait TxMeta {
    // Required methods
    fn transparent_spends(&self) -> impl Iterator<Item = &OutPoint>;
    fn sapling_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>;
    fn orchard_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>;
    fn ironwood_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>;
    fn fee_paid<E, F>(&self, get_prevout: F) -> Result<Option<Zatoshis>, E>
       where E: From<BalanceError>,
             F: FnMut(&OutPoint) -> Result<Option<Zatoshis>, E>;
}
Expand description

A trait for types that can provide information about outputs spent by and fees that were paid for a given transaction.

Required Methods§

Source

fn transparent_spends(&self) -> impl Iterator<Item = &OutPoint>

Available on crate feature transparent-inputs only.

Returns an iterator over the references to transparent outputs spent in this transaction.

Source

fn sapling_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>

Returns an iterator over the nullifiers of Sapling notes spent in this transaction.

Source

fn orchard_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>

Available on crate feature orchard only.

Returns an iterator over the nullifiers of Orchard notes spent in this transaction.

Source

fn ironwood_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>

Available on crate feature orchard only.

Returns an iterator over the nullifiers of Ironwood notes spent in this transaction.

Ironwood nullifiers share the Orchard nullifier type, but identify notes in the Ironwood pool (the transaction’s Ironwood bundle, distinct from its Orchard bundle).

Source

fn fee_paid<E, F>(&self, get_prevout: F) -> Result<Option<Zatoshis>, E>
where E: From<BalanceError>, F: FnMut(&OutPoint) -> Result<Option<Zatoshis>, E>,

Returns the fee paid by this transaction, given a function that can retrieve the value of prior transparent outputs spent in the transaction.

Returns Ok(None) if insufficient information is available for computing the fee. This can occur when:

  • The transaction has transparent inputs whose values are not known to the wallet (e.g., the wallet has not yet retrieved the transactions that created those outputs).
  • The wallet scanned the chain using compact blocks, which do not include transparent input information. In this case, the wallet cannot determine whether the transaction has any transparent inputs, and thus cannot know if the fee is computable from shielded data alone.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TxMeta for Transaction

Source§

fn transparent_spends(&self) -> impl Iterator<Item = &OutPoint>

Available on crate feature transparent-inputs only.
Source§

fn sapling_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>

Source§

fn orchard_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>

Available on crate feature orchard only.
Source§

fn ironwood_spent_note_nullifiers(&self) -> impl Iterator<Item = &Nullifier>

Available on crate feature orchard only.
Source§

fn fee_paid<E, F>(&self, get_prevout: F) -> Result<Option<Zatoshis>, E>
where E: From<BalanceError>, F: FnMut(&OutPoint) -> Result<Option<Zatoshis>, E>,

Implementors§