Class: Sigma::TransactionHintsBag
- Inherits:
-
Object
- Object
- Sigma::TransactionHintsBag
- Extended by:
- FFI::Library
- Defined in:
- lib/sigma/transaction.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Class Method Summary collapse
-
.create ⇒ TransactionHintsBag
Create empty collection.
-
.extract_hints_from_signed_transaction(transaction:, state_context:, boxes_to_spend:, data_boxes:, real_propositions:, simulated_propositions:) ⇒ TransactionHintsBag
Extract hints from signed transaction.
-
.with_raw_pointer(pointer) ⇒ TransactionHintsBag
Takes ownership of an existing TransactionHintsBag Pointer.
Instance Method Summary collapse
-
#add_hints_for_input(index:, hints_bag:) ⇒ Object
Add hints for input.
-
#all_hints_for_input(index) ⇒ HintsBag
Get hints corresponding to index.
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
247 248 249 |
# File 'lib/sigma/transaction.rb', line 247 def pointer @pointer end |
Class Method Details
.create ⇒ TransactionHintsBag
Create empty collection
251 252 253 254 255 |
# File 'lib/sigma/transaction.rb', line 251 def self.create pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_transaction_hints_bag_empty(pointer) init(pointer) end |
.extract_hints_from_signed_transaction(transaction:, state_context:, boxes_to_spend:, data_boxes:, real_propositions:, simulated_propositions:) ⇒ TransactionHintsBag
Extract hints from signed transaction
273 274 275 276 277 278 |
# File 'lib/sigma/transaction.rb', line 273 def self.extract_hints_from_signed_transaction(transaction:, state_context:, boxes_to_spend:, data_boxes:, real_propositions:, simulated_propositions:) pointer = FFI::MemoryPointer.new(:pointer) error = ergo_lib_transaction_extract_hints(transaction.pointer, state_context.pointer, boxes_to_spend.pointer, data_boxes.pointer, real_propositions.pointer, simulated_propositions.pointer, pointer) Util.check_error!(error) init(pointer) end |
.with_raw_pointer(pointer) ⇒ TransactionHintsBag
Note:
A user of sigma_rb generally does not need to call this function
Takes ownership of an existing TransactionHintsBag Pointer.
261 262 263 |
# File 'lib/sigma/transaction.rb', line 261 def self.with_raw_pointer(pointer) init(pointer) end |
Instance Method Details
#add_hints_for_input(index:, hints_bag:) ⇒ Object
Add hints for input
283 284 285 |
# File 'lib/sigma/transaction.rb', line 283 def add_hints_for_input(index:, hints_bag:) ergo_lib_transaction_hints_bag_add_hints_for_input(self.pointer, index, hints_bag.pointer) end |
#all_hints_for_input(index) ⇒ HintsBag
Get hints corresponding to index
290 291 292 293 294 |
# File 'lib/sigma/transaction.rb', line 290 def all_hints_for_input(index) pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_transaction_hints_bag_all_hints_for_input(self.pointer, index, pointer) Sigma::HintsBag.with_raw_pointer(pointer) end |