pub trait Transaction: Serialize {
    type Input;
    type Output;
    type Inputs: ?Sized;
    type Outputs: ?Sized;

    // Required methods
    fn inputs(&self) -> &Self::Inputs;
    fn outputs(&self) -> &Self::Outputs;
}
Expand description

define a transaction within the blockchain. This transaction can be used for the UTxO model. However it can also be used for any other elements that the blockchain has (a transaction type to add Stacking Pools and so on…).

TODO: add a Readable trait bound

Required Associated Types§

source

type Input

The input type of the transaction (if none use ()).

source

type Output

The output type of the transaction (if none use ()).

source

type Inputs: ?Sized

The iterable type of transaction inputs (if none use Option<()> and return None).

source

type Outputs: ?Sized

The iterable type of transaction outputs (if none use Option<()> and return None).

Required Methods§

source

fn inputs(&self) -> &Self::Inputs

Returns a reference that can be used to iterate over transaction’s inputs.

source

fn outputs(&self) -> &Self::Outputs

Returns a reference that can be used to iterate over transaction’s outputs.

Implementors§