ex_plasma v0.1.0 ExPlasma.Block
Encapsulates the block data we receive from the contract. It returns two things:
- hash - The merkle root block hash of the plasma blocks.
- transactions - the list of Transactions associated with this given block
Link to this section Summary
Functions
Generate a new Block from a list of transactions
Link to this section Types
Link to this type
t()
t() :: %ExPlasma.Block{
hash: binary() | nil,
timestamp: non_neg_integer() | nil,
transactions: maybe_improper_list()
}
Link to this section Functions
Generate a new Block from a list of transactions
Example
iex> %ExPlasma.Transaction{} |> List.wrap() |> ExPlasma.Block.new %ExPlasma.Block{
hash: <<162, 30, 56, 202, 121, 64, 48, 158, 182, 172, 255, 172, 103, 46, 193, 151, 236, 162, 92, 242, 78, 195, 132, 176, 200, 239, 249, 20, 160, 176, 63, 29>>,
timestamp: nil,
transactions: [
%ExPlasma.Transaction{inputs: [], metadata: nil, outputs: [], sigs: []}
]
}