Exception: BSV::Transaction::VerificationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bsv/transaction/verification_error.rb

Overview

Error raised during SPV verification.

Carries a machine-readable code alongside a human-readable message, matching the typed error pattern used by the Go SDK (ErrInvalidMerklePath, ErrFeeTooLow, ErrScriptVerificationFailed).

Error Codes

  • :invalid_merkle_proof — merkle path verification failed against the chain tracker

  • :insufficient_fee — transaction fee is below the fee model’s requirement

  • :output_overflow — total outputs exceed total inputs

  • :script_failure — script interpreter rejected an input (original ScriptError in #cause)

  • :missing_source — required input data (unlocking script, source locking script, or source satoshis) is absent

Constant Summary collapse

INVALID_MERKLE_PROOF =
:invalid_merkle_proof
INSUFFICIENT_FEE =
:insufficient_fee
OUTPUT_OVERFLOW =
:output_overflow
SCRIPT_FAILURE =
:script_failure
MISSING_SOURCE =
:missing_source

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ VerificationError

Returns a new instance of VerificationError.

Parameters:

  • code (Symbol)

    error code

  • message (String)

    human-readable description



31
32
33
34
# File 'lib/bsv/transaction/verification_error.rb', line 31

def initialize(code, message)
  @code = code
  super(message)
end

Instance Attribute Details

#codeSymbol (readonly)

Returns the error code.

Returns:

  • (Symbol)

    the error code



21
22
23
# File 'lib/bsv/transaction/verification_error.rb', line 21

def code
  @code
end