Class: BSV::Transaction::Beef::ProvenTxEntry

Inherits:
BeefTx
  • Object
show all
Defined in:
lib/bsv/transaction/beef.rb

Overview

A BEEF entry containing a raw transaction with an associated BUMP index.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BeefTx

#dtxid

Constructor Details

#initialize(transaction:, bump_index:) ⇒ ProvenTxEntry

Returns a new instance of ProvenTxEntry.

Parameters:

  • transaction (Transaction)

    the transaction

  • bump_index (Integer)

    index into the bumps array

Raises:

  • (ArgumentError)

    if transaction or bump_index is nil



111
112
113
114
115
116
117
118
# File 'lib/bsv/transaction/beef.rb', line 111

def initialize(transaction:, bump_index:)
  raise ArgumentError, 'ProvenTxEntry requires a transaction' if transaction.nil?
  raise ArgumentError, 'ProvenTxEntry requires a bump_index' if bump_index.nil?

  super()
  @transaction = transaction
  @bump_index = bump_index
end

Instance Attribute Details

#bump_indexInteger (readonly)

Returns index into the BEEF bumps array.

Returns:

  • (Integer)

    index into the BEEF bumps array



106
107
108
# File 'lib/bsv/transaction/beef.rb', line 106

def bump_index
  @bump_index
end

#transactionTransaction (readonly)

Returns the transaction.

Returns:



103
104
105
# File 'lib/bsv/transaction/beef.rb', line 103

def transaction
  @transaction
end

Instance Method Details

#format_flagInteger

Returns FORMAT_RAW_TX_AND_BUMP wire-protocol flag.

Returns:

  • (Integer)

    FORMAT_RAW_TX_AND_BUMP wire-protocol flag



126
127
128
# File 'lib/bsv/transaction/beef.rb', line 126

def format_flag
  FORMAT_RAW_TX_AND_BUMP
end

#wtxidString

Returns wire-order wtxid delegated to the transaction.

Returns:

  • (String)

    wire-order wtxid delegated to the transaction



121
122
123
# File 'lib/bsv/transaction/beef.rb', line 121

def wtxid
  @transaction.wtxid
end