ExPlasma.Transaction.Type.PaymentV1 (ExPlasma v0.2.0)
Implementation of Transaction behaviour for Payment V1 type.
Link to this section Summary
Functions
Creates output for a payment v1 transaction
Decodes an RLP list into a Payment V1 Transaction.
Turns a structure instance into a structure of RLP items, ready to be RLP encoded
Validates the Transaction.
Link to this section Types
Link to this type
mapping_error()
Specs
mapping_error() :: :malformed_transaction | :malformed_tx_data | :malformed_input_position_rlp | :malformed_output_rlp
Link to this type
metadata()
Specs
metadata() :: <<_::256>> | nil
Link to this type
outputs()
Specs
outputs() :: [ExPlasma.Output.t()] | []
Link to this type
validation_error()
Specs
validation_error() :: ExPlasma.Transaction.Type.PaymentV1.Validator.inputs_validation_error() | ExPlasma.Transaction.Type.PaymentV1.Validator.outputs_validation_error() | {:tx_data, :malformed_tx_data} | {:metadata, :malformed_metadata}
Link to this section Functions
Link to this function
new_output(owner, token, amount)
Specs
new_output( ExPlasma.Crypto.address_t(), ExPlasma.Crypto.address_t(), pos_integer() ) :: ExPlasma.Output.t()
Creates output for a payment v1 transaction
Example
iex> output = new_output(<<1::160>>, <<0::160>>, 1)
iex> %ExPlasma.Output{
...> output_data: %{amount: 1, output_guard: <<1::160>>, token: <<0::160>>},
...> output_id: nil,
...> output_type: 1
...> } = output
Link to this function
to_map(arg1)
Decodes an RLP list into a Payment V1 Transaction.
Only validates that the RLP is structurally correct. Does not perform any other kind of validation, use validate/1 for that.
Link to this function
to_rlp(transaction)
Turns a structure instance into a structure of RLP items, ready to be RLP encoded
Link to this function
validate(transaction)
Validates the Transaction.