Class: Sigma::ErgoStateContext

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

Overview

Blockchain state (last headers, etc)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer.



15
16
17
# File 'lib/sigma/ergo_state_context.rb', line 15

def pointer
  @pointer
end

Class Method Details

.create(pre_header:, headers:) ⇒ ErgoStateContext

Createa new context

Parameters:

Returns:



21
22
23
24
25
26
# File 'lib/sigma/ergo_state_context.rb', line 21

def self.create(pre_header:, headers:)
  pointer = FFI::MemoryPointer.new(:pointer)
  error = ergo_lib_ergo_state_context_new(pre_header.pointer, headers.pointer, pointer)
  Util.check_error!(error)
  init(pointer)
end

Instance Method Details

#==(esc_two) ⇒ bool

Equality check

Parameters:

Returns:

  • (bool)


31
32
33
# File 'lib/sigma/ergo_state_context.rb', line 31

def ==(esc_two)
  ergo_lib_ergo_state_context_eq(self.pointer, esc.pointer)
end