Class: Sigma::PreHeader

Inherits:
Object
  • Object
show all
Extended by:
FFI::Library
Defined in:
lib/sigma/pre_header.rb

Overview

Block header with the current ‘spendingTransaction`, that can be predicted by a miner before its formation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer.



14
15
16
# File 'lib/sigma/pre_header.rb', line 14

def pointer
  @pointer
end

Class Method Details

.with_block_header(block_header) ⇒ PreHeader

Create using data from block_header

Parameters:

Returns:



19
20
21
22
23
# File 'lib/sigma/pre_header.rb', line 19

def self.with_block_header(block_header)
  pointer = FFI::MemoryPointer.new(:pointer) 
  ergo_lib_preheader_from_block_header(block_header.pointer, pointer)
  init(pointer) 
end

Instance Method Details

#==(ph_two) ⇒ bool

Equality check

Parameters:

Returns:

  • (bool)


28
29
30
# File 'lib/sigma/pre_header.rb', line 28

def ==(ph_two)
  ergo_lib_pre_header_eq(self.pointer, ph_two.pointer)
end