Skip to content

Instantly share code, notes, and snippets.

@yatender-oktalk
Last active September 12, 2020 12:45
Show Gist options
  • Save yatender-oktalk/0481bdfcb1ea94d3314a1a1a0e7d1dde to your computer and use it in GitHub Desktop.
Save yatender-oktalk/0481bdfcb1ea94d3314a1a1a0e7d1dde to your computer and use it in GitHub Desktop.
defmodule ExChain.BlockChain.Block do
@moduledoc """
This module is the single block struct in a blockchain
"""
alias __MODULE__
@type t :: %Block{
timestamp: pos_integer(),
last_hash: String.t(),
hash: String.t(),
data: any()
}
defstruct ~w(timestamp last_hash hash data)a
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment