blockchain v0.1.7 Blockchain.Interface.BlockInterface

Defines an interface for methods to interact with the block chain.

Link to this section Summary

Functions

Returns a new block interface

Link to this section Types

Link to this type t()
t() :: %Blockchain.Interface.BlockInterface{block_header: Block.Header.t, db: MerklePatriciaTree.DB.db}

Link to this section Functions

Link to this function new(block_header, db)

Returns a new block interface.

Examples

iex> block_header = %Block.Header{}
iex> db = MerklePatriciaTree.Test.random_ets_db(:new_block_interface)
iex> Blockchain.Interface.BlockInterface.new(block_header, db)
%Blockchain.Interface.BlockInterface{
  block_header: %Block.Header{},
  db: {MerklePatriciaTree.DB.ETS, :new_block_interface}
}