Class: Sigma::BlockHeader
- Inherits:
-
Object
- Object
- Sigma::BlockHeader
- Extended by:
- FFI::Library
- Defined in:
- lib/sigma/block_header.rb
Overview
Represents data available of the Block Header in Sigma propositions.
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Class Method Summary collapse
-
.with_json(json) ⇒ BlockHeader
Parse BlockHeader array from json (NODE API).
-
.with_raw_pointer(pointer) ⇒ BlockHeader
Takes ownership of an existing BlockHeader Pointer.
Instance Method Summary collapse
-
#==(bh_two) ⇒ bool
Equality check between two BlockHeaders.
-
#get_block_id ⇒ BlockId
Get BlockId of BlockHeader.
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
14 15 16 |
# File 'lib/sigma/block_header.rb', line 14 def pointer @pointer end |
Class Method Details
.with_json(json) ⇒ BlockHeader
Parse BlockHeader array from json (NODE API)
19 20 21 22 23 24 |
# File 'lib/sigma/block_header.rb', line 19 def self.with_json(json) pointer = FFI::MemoryPointer.new(:pointer) error = ergo_lib_block_header_from_json(json, pointer) Util.check_error!(error) init(pointer) end |
.with_raw_pointer(pointer) ⇒ BlockHeader
Note:
A user of sigma_rb generally does not need to call this function
Takes ownership of an existing BlockHeader Pointer.
30 31 32 |
# File 'lib/sigma/block_header.rb', line 30 def self.with_raw_pointer(pointer) init(pointer) end |
Instance Method Details
#==(bh_two) ⇒ bool
Equality check between two BlockHeaders
45 46 47 |
# File 'lib/sigma/block_header.rb', line 45 def ==(bh_two) ergo_lib_block_header_eq(self.pointer, bh_two.pointer) end |
#get_block_id ⇒ BlockId
Get BlockId of BlockHeader
36 37 38 39 40 |
# File 'lib/sigma/block_header.rb', line 36 def get_block_id pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_block_header_id(self.pointer, pointer) Sigma::BlockId.with_raw_pointer(:pointer) end |