[][src]Struct ergo_lib::chain::transaction::Transaction

pub struct Transaction {
    pub inputs: Vec<Input>,
    pub data_inputs: Vec<DataInput>,
    pub output_candidates: Vec<ErgoBoxCandidate>,
    // some fields omitted
}

ErgoTransaction is an atomic state transition operation. It destroys Boxes from the state and creates new ones. If transaction is spending boxes protected by some non-trivial scripts, its inputs should also contain proof of spending correctness - context extension (user-defined key-value map) and data inputs (links to existing boxes in the state) that may be used during script reduction to crypto, signatures that satisfies the remaining cryptographic protection of the script. Transactions are not encrypted, so it is possible to browse and view every transaction ever collected into a block.

Fields

inputs: Vec<Input>

inputs, that will be spent by this transaction.

data_inputs: Vec<DataInput>

inputs, that are not going to be spent by transaction, but will be reachable from inputs scripts. dataInputs scripts will not be executed, thus their scripts costs are not included in transaction cost and they do not contain spending proofs.

output_candidates: Vec<ErgoBoxCandidate>

box candidates to be created by this transaction. Differ from ordinary ones in that they do not include transaction id and index

Implementations

impl Transaction[src]

pub const MAX_OUTPUTS_COUNT: usize[src]

Maximum number of outputs

pub fn new(
    inputs: Vec<Input>,
    data_inputs: Vec<DataInput>,
    output_candidates: Vec<ErgoBoxCandidate>
) -> Transaction
[src]

Creates new transaction

pub fn outputs(&self) -> Vec<ErgoBox>[src]

create ErgoBox from ErgoBoxCandidate with tx id and indices

pub fn bytes_to_sign(&self) -> Vec<u8>[src]

Serialized tx with empty proofs

pub fn id(&self) -> TxId[src]

Get transaction id

Trait Implementations

impl Clone for Transaction[src]

impl Debug for Transaction[src]

impl<'de> Deserialize<'de> for Transaction[src]

impl PartialEq<Transaction> for Transaction[src]

impl Serialize for Transaction[src]

impl SigmaSerializable for Transaction[src]

impl StructuralPartialEq for Transaction[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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<F> TryExtractInto<F> for F[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,