[][src]Enum zebra_chain::transaction::Transaction

pub enum Transaction {
    V1 {
        inputs: Vec<TransparentInput>,
        outputs: Vec<TransparentOutput>,
        lock_time: LockTime,
    },
    V2 {
        inputs: Vec<TransparentInput>,
        outputs: Vec<TransparentOutput>,
        lock_time: LockTime,
        joinsplit_data: Option<JoinSplitData<Bctv14Proof>>,
    },
    V3 {
        inputs: Vec<TransparentInput>,
        outputs: Vec<TransparentOutput>,
        lock_time: LockTime,
        expiry_height: BlockHeight,
        joinsplit_data: Option<JoinSplitData<Bctv14Proof>>,
    },
    V4 {
        inputs: Vec<TransparentInput>,
        outputs: Vec<TransparentOutput>,
        lock_time: LockTime,
        expiry_height: BlockHeight,
        value_balance: i64,
        shielded_data: Option<ShieldedData>,
        joinsplit_data: Option<JoinSplitData<Groth16Proof>>,
    },
}

A Zcash transaction.

A transaction is an encoded data structure that facilitates the transfer of value between two public key addresses on the Zcash ecosystem. Everything is designed to ensure that transactions can created, propagated on the network, validated, and finally added to the global ledger of transactions (the blockchain).

Zcash has a number of different transaction formats. They are represented internally by different enum variants. Because we checkpoint on Sapling activation, we do not parse any pre-Sapling transaction types.

Variants

V1

A fully transparent transaction (version = 1).

Fields of V1

inputs: Vec<TransparentInput>

The transparent inputs to the transaction.

outputs: Vec<TransparentOutput>

The transparent outputs from the transaction.

lock_time: LockTime

The earliest time or block height that this transaction can be added to the chain.

V2

A Sprout transaction (version = 2).

Fields of V2

inputs: Vec<TransparentInput>

The transparent inputs to the transaction.

outputs: Vec<TransparentOutput>

The transparent outputs from the transaction.

lock_time: LockTime

The earliest time or block height that this transaction can be added to the chain.

joinsplit_data: Option<JoinSplitData<Bctv14Proof>>

The JoinSplit data for this transaction, if any.

V3

An Overwinter transaction (version = 3).

Fields of V3

inputs: Vec<TransparentInput>

The transparent inputs to the transaction.

outputs: Vec<TransparentOutput>

The transparent outputs from the transaction.

lock_time: LockTime

The earliest time or block height that this transaction can be added to the chain.

expiry_height: BlockHeight

The latest block height that this transaction can be added to the chain.

joinsplit_data: Option<JoinSplitData<Bctv14Proof>>

The JoinSplit data for this transaction, if any.

V4

A Sapling transaction (version = 4).

Fields of V4

inputs: Vec<TransparentInput>

The transparent inputs to the transaction.

outputs: Vec<TransparentOutput>

The transparent outputs from the transaction.

lock_time: LockTime

The earliest time or block height that this transaction can be added to the chain.

expiry_height: BlockHeight

The latest block height that this transaction can be added to the chain.

value_balance: i64

The net value of Sapling spend transfers minus output transfers.

shielded_data: Option<ShieldedData>

The shielded data for this transaction, if any.

joinsplit_data: Option<JoinSplitData<Groth16Proof>>

The JoinSplit data for this transaction, if any.

Methods

impl Transaction[src]

pub fn inputs(&self) -> impl Iterator<Item = &TransparentInput>[src]

Iterate over the transparent inputs of this transaction, if any.

pub fn outputs(&self) -> impl Iterator<Item = &TransparentOutput>[src]

Iterate over the transparent outputs of this transaction, if any.

pub fn lock_time(&self) -> LockTime[src]

Get this transaction's lock time.

pub fn expiry_height(&self) -> Option<BlockHeight>[src]

Get this transaction's expiry height, if any.

Trait Implementations

impl Clone for Transaction[src]

impl Debug for Transaction[src]

impl Eq for Transaction[src]

impl From<Transaction> for TransactionHash[src]

impl PartialEq<Transaction> for Transaction[src]

impl StructuralEq for Transaction[src]

impl StructuralPartialEq for Transaction[src]

impl ZcashDeserialize for Transaction[src]

impl ZcashSerialize for Transaction[src]

Auto Trait Implementations

impl RefUnwindSafe for Transaction

impl Send for Transaction

impl Sync for Transaction

impl Unpin for Transaction

impl UnwindSafe for Transaction

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.