Class: BSV::Transaction::UnlockingScriptTemplate Abstract
- Inherits:
-
Object
- Object
- BSV::Transaction::UnlockingScriptTemplate
- Defined in:
- lib/bsv/transaction/unlocking_script_template.rb
Overview
This class is abstract.
Subclass and override #sign and #estimated_length.
Abstract base class for unlocking script templates.
Templates provide deferred signing — an input can hold a template that generates the unlocking script at sign time, when the full transaction is available for sighash computation. Subclass and implement #sign and #estimated_length.
Direct Known Subclasses
Instance Method Summary collapse
-
#estimated_length(_tx, _input_index) ⇒ Integer
Estimate the unlocking script length in bytes (for fee estimation).
-
#sign(_tx, _input_index) ⇒ Script::Script
Generate the unlocking script for a transaction input.
Instance Method Details
#estimated_length(_tx, _input_index) ⇒ Integer
Estimate the unlocking script length in bytes (for fee estimation).
31 32 33 |
# File 'lib/bsv/transaction/unlocking_script_template.rb', line 31 def estimated_length(_tx, _input_index) raise NotImplementedError, "#{self.class}#estimated_length must be implemented" end |
#sign(_tx, _input_index) ⇒ Script::Script
Generate the unlocking script for a transaction input.
21 22 23 |
# File 'lib/bsv/transaction/unlocking_script_template.rb', line 21 def sign(_tx, _input_index) raise NotImplementedError, "#{self.class}#sign must be implemented" end |