Class: Bitcoin::Protocol::TxWitness
- Inherits:
-
Object
- Object
- Bitcoin::Protocol::TxWitness
- Defined in:
- lib/segwit/tx_witness.rb
Instance Attribute Summary collapse
-
#tx_in_wit ⇒ Object
readonly
Returns the value of attribute tx_in_wit.
Instance Method Summary collapse
-
#add_witness(tx_in_wit) ⇒ Object
Add witness @param tx_in_wit witness object.
-
#initialize ⇒ TxWitness
constructor
A new instance of TxWitness.
-
#to_payload ⇒ Object
output witness in raw binary format.
Constructor Details
#initialize ⇒ TxWitness
Returns a new instance of TxWitness.
5 6 7 |
# File 'lib/segwit/tx_witness.rb', line 5 def initialize @tx_in_wit = [] end |
Instance Attribute Details
#tx_in_wit ⇒ Object (readonly)
Returns the value of attribute tx_in_wit.
3 4 5 |
# File 'lib/segwit/tx_witness.rb', line 3 def tx_in_wit @tx_in_wit end |
Instance Method Details
#add_witness(tx_in_wit) ⇒ Object
Add witness @param tx_in_wit witness object
11 12 13 |
# File 'lib/segwit/tx_witness.rb', line 11 def add_witness(tx_in_wit) (@tx_in_wit ||= []) << tx_in_wit end |
#to_payload ⇒ Object
output witness in raw binary format
16 17 18 19 20 |
# File 'lib/segwit/tx_witness.rb', line 16 def to_payload payload = "" tx_in_wit.each{|w|payload << w.to_payload} payload end |