Class: Sigma::ReducedTransaction

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer.



13
14
15
# File 'lib/sigma/reduced_transaction.rb', line 13

def pointer
  @pointer
end

Class Method Details

.from_unsigned_tx(unsigned_tx:, boxes_to_spend:, data_boxes:, state_context:) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sigma/reduced_transaction.rb', line 15

def self.from_unsigned_tx(unsigned_tx:, boxes_to_spend:, data_boxes:, state_context:)
  pointer = FFI::MemoryPointer.new(:pointer)
  error = ergo_lib_reduced_tx_from_unsigned_tx(
      unsigned_tx.pointer,
      boxes_to_spend.pointer,
      data_boxes.pointer,
      state_context.pointer,
      pointer
    )
  Util.check_error!(error)
  init(pointer)
end

.with_raw_pointer(pointer) ⇒ Object



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

def self.with_raw_pointer(pointer)
  init(pointer)
end

Instance Method Details

#get_unsigned_transactionObject



32
33
34
35
36
# File 'lib/sigma/reduced_transaction.rb', line 32

def get_unsigned_transaction
  pointer = FFI::MemoryPointer.new(:pointer)
  ergo_lib_reduced_tx_unsigned_tx(self.pointer, pointer)
  UnsignedTransaction.with_raw_pointer(pointer)
end