Class: Reth::TransientBlock
- Inherits:
-
Object
- Object
- Reth::TransientBlock
- Includes:
- RLP::Sedes::Serializable
- Defined in:
- lib/reth/transient_block.rb
Instance Attribute Summary collapse
-
#newblock_timestamp ⇒ Object
readonly
Returns the value of attribute newblock_timestamp.
Instance Method Summary collapse
- #full_hash_hex ⇒ Object
-
#initialize(block_data, newblock_timestamp = 0) ⇒ TransientBlock
constructor
A new instance of TransientBlock.
- #to_block(env, parent = nil) ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(block_data, newblock_timestamp = 0) ⇒ TransientBlock
Returns a new instance of TransientBlock.
16 17 18 19 20 21 22 23 |
# File 'lib/reth/transient_block.rb', line 16 def initialize(block_data, =0) @newblock_timestamp = header = BlockHeader.deserialize block_data[0] transaction_list = RLP::Sedes::CountableList.new(Transaction).deserialize block_data[1] uncles = RLP::Sedes::CountableList.new(BlockHeader).deserialize block_data[2] super(header, transaction_list, uncles) end |
Instance Attribute Details
#newblock_timestamp ⇒ Object (readonly)
Returns the value of attribute newblock_timestamp.
14 15 16 |
# File 'lib/reth/transient_block.rb', line 14 def @newblock_timestamp end |
Instance Method Details
#full_hash_hex ⇒ Object
29 30 31 |
# File 'lib/reth/transient_block.rb', line 29 def full_hash_hex header.full_hash_hex end |
#to_block(env, parent = nil) ⇒ Object
25 26 27 |
# File 'lib/reth/transient_block.rb', line 25 def to_block(env, parent=nil) Block.new header: header, transaction_list: transaction_list, uncles: uncles, env: env, parent: parent end |
#to_s ⇒ Object Also known as: inspect
33 34 35 |
# File 'lib/reth/transient_block.rb', line 33 def to_s "<TransientBlock(##{header.number} #{header.full_hash_hex[0,8]})" end |