Class: Casper::Entity::BlockHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/entity/block_header.rb

Overview

BlockHeader

Instance Method Summary collapse

Constructor Details

#initialize(header = {}) ⇒ BlockHeader

Returns a new instance of BlockHeader.

Options Hash (header):

  • :parent_hash (String)
  • :state_root_hash (String)
  • :parent_hash (String)
  • :body_hash (String)
  • :random_bit (Boolean)
  • :accumulated_seed (String)
  • :era_end (String)
  • :timestamp (Integer)
  • :era_id (Integer)
  • :height (Integer)


17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/entity/block_header.rb', line 17

def initialize(header = {})
  @parent_hash = header[:parent_hash]
  @state_root_hash = header[:state_root_hash]
  @body_hash = header[:body_hash]
  @random_bit = header[:random_bit]
  @accumulated_seed = header[:accumulated_seed]
  @era_end = header[:era_end]
  @timestamp = header[:timestamp]
  @era_id = header[:era_id]
  @height = header[:height]
  @protocol_version = header[:protocol_version]
end

Instance Method Details

#get_accumulated_seedString



51
52
53
# File 'lib/entity/block_header.rb', line 51

def get_accumulated_seed
  @accumulated_seed
end

#get_body_hashString



41
42
43
# File 'lib/entity/block_header.rb', line 41

def get_body_hash
  @body_hash
end

#get_era_endString



56
57
58
# File 'lib/entity/block_header.rb', line 56

def get_era_end
  @era_end
end

#get_era_idInteger



66
67
68
# File 'lib/entity/block_header.rb', line 66

def get_era_id
  @era_id
end

#get_heightInteger



71
72
73
# File 'lib/entity/block_header.rb', line 71

def get_height
  @height
end

#get_parent_hashString



31
32
33
# File 'lib/entity/block_header.rb', line 31

def get_parent_hash
  @parent_hash
end

#get_protocol_versionString



76
77
78
# File 'lib/entity/block_header.rb', line 76

def get_protocol_version
  @protocol_version
end

#get_random_bitBoolean



46
47
48
# File 'lib/entity/block_header.rb', line 46

def get_random_bit
  @random_bit
end

#get_state_root_hashString



36
37
38
# File 'lib/entity/block_header.rb', line 36

def get_state_root_hash
  @state_root_hash
end

#get_timestampInteger



61
62
63
# File 'lib/entity/block_header.rb', line 61

def get_timestamp
  @timestamp
end