Skip to content

Commit

Permalink
GH-3 Define block data structure
Browse files Browse the repository at this point in the history
* Put block and header records in blocks.hrl
  • Loading branch information
zp-sd committed Aug 30, 2017
1 parent 01a754e commit b84b0d5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions apps/aecore/include/blocks.hrl
@@ -0,0 +1,24 @@
-record(trees, {}).
-type(trees() :: #trees{}).

-record(block, {
height = 0 :: non_neg_integer(),
prev_block_hash = <<>> :: binary(),
trees = #trees{} :: trees(),
trees_root_hash = <<>> :: binary(),
txs = [] :: list(),
difficulty = 0 :: non_neg_integer(),
nonce = 0 :: non_neg_integer(),
time = 0 :: non_neg_integer(),
version = 0 :: non_neg_integer()}).
-type(block() :: #block{}).

-record(header, {
height = 0 :: non_neg_integer(),
prev_block_hash = <<>> :: binary(),
trees_root_hash = <<>> :: binary(),
difficulty = 0 :: non_neg_integer(),
nonce = 0 :: non_neg_integer(),
time = 0 :: non_neg_integer(),
version = 0 :: non_neg_integer()}).
-type(header() :: #header{}).

0 comments on commit b84b0d5

Please sign in to comment.