Class: Casper::Entity::BlockInfo
- Inherits:
-
Object
- Object
- Casper::Entity::BlockInfo
- Defined in:
- lib/entity/block_info.rb
Overview
BlockInfo class entity
Instance Method Summary collapse
-
#get_creator ⇒ String
Hex-encoded cryptographic public key, including the algorithm tag prefix.
-
#get_era_id ⇒ Integer
Era id in which this block was created.
-
#get_hash ⇒ String
A cryptographic hash identifying a Block.
-
#get_height ⇒ Integer
The height of this block, i.e., the number of ancestors.
-
#get_state_root_hash ⇒ String
The global state root hash produced by executing this block’s body.
-
#get_timestamp ⇒ String
Timestamp formatted as per RFC 3339.
-
#initialize(last_added_block_info = {}) ⇒ BlockInfo
constructor
A new instance of BlockInfo.
Constructor Details
#initialize(last_added_block_info = {}) ⇒ BlockInfo
Returns a new instance of BlockInfo.
13 14 15 16 17 18 19 20 |
# File 'lib/entity/block_info.rb', line 13 def initialize(last_added_block_info = {}) @hash = last_added_block_info[:hash] @timestamp = last_added_block_info[:timestamp] @era_id = last_added_block_info[:era_id] @height = last_added_block_info[:height] @state_root_hash = last_added_block_info[:state_root_hash] @creator = last_added_block_info[:creator] end |
Instance Method Details
#get_creator ⇒ String
Returns hex-encoded cryptographic public key, including the algorithm tag prefix.
51 52 53 |
# File 'lib/entity/block_info.rb', line 51 def get_creator @creator end |
#get_era_id ⇒ Integer
Returns era id in which this block was created.
33 34 35 |
# File 'lib/entity/block_info.rb', line 33 def get_era_id @era_id end |
#get_hash ⇒ String
Returns a cryptographic hash identifying a Block.
23 24 25 |
# File 'lib/entity/block_info.rb', line 23 def get_hash @hash end |
#get_height ⇒ Integer
Returns the height of this block, i.e., the number of ancestors.
39 40 41 |
# File 'lib/entity/block_info.rb', line 39 def get_height @height end |
#get_state_root_hash ⇒ String
Returns the global state root hash produced by executing this block’s body.
45 46 47 |
# File 'lib/entity/block_info.rb', line 45 def get_state_root_hash @state_root_hash end |
#get_timestamp ⇒ String
Returns timestamp formatted as per RFC 3339.
28 29 30 |
# File 'lib/entity/block_info.rb', line 28 def @timestamp end |