pub enum Reason {
Show 24 variants
BadVersion {
word: u32,
},
BadVarint,
Truncated {
needed: u64,
},
BadFlag {
byte: u8,
},
TreeHeightOver64 {
height: u8,
},
TreeHeightZero,
OffsetOutsideTree {
level: u8,
offset: u64,
},
NoTxidAtLevelZero,
MissingSibling {
level: u8,
offset: u64,
},
MismatchedNode {
level: u8,
offset: u64,
},
RootNotCarried {
height: u64,
root: [u8; 32],
},
BumpIndexNamesNoBump {
index: u64,
},
TxidNotInBump {
index: u64,
txid: [u8; 32],
},
InputNamesNoElement {
txid: [u8; 32],
},
StubNotProven {
txid: [u8; 32],
},
TrailingBytes,
SubjectMissing {
subject: [u8; 32],
},
UnrelatedTransaction {
txid: [u8; 32],
},
NoInputs,
NoOutputs,
UnprovenCoinbase,
NullOutpoint,
DuplicateInput,
ValueOutOfRange,
}Expand description
A refusal’s reason with its data, the Lean’s Reason.
Variants§
BadVersion
The version word read.
BadVarint
A varint cut short or encoded non-canonically.
Truncated
A fixed-width field cut short.
BadFlag
A BUMP leaf flag not 00, 01 or 02; a has-BUMP byte not 00 or
01; a V2 format byte not 0, 1 or 2.
TreeHeightOver64
The tree-height byte read.
TreeHeightZero
A tree height of 0: no level 0, no txid, no root.
OffsetOutsideTree
A leaf outside its level.
NoTxidAtLevelZero
Nothing to prove.
MissingSibling
The node a path needs.
MismatchedNode
The node that disagrees.
RootNotCarried
The root computed and the height the BUMP claims.
BumpIndexNamesNoBump
The index read.
TxidNotInBump
The BUMP named and the txid it does not carry.
InputNamesNoElement
The previous txid an input names.
StubNotProven
The txid of the entry.
TrailingBytes
The byte at the offset belongs to no field.
SubjectMissing
The subject that is not the tip.
The transaction nothing spends.
NoInputs
A raw transaction whose input count is 0, named at the transaction’s
leading byte. It is no transaction: the node refuses one before any
script runs (the sibling’s rule, bsv-script-lean
lean/BsvScript/TxRules.lean, checkTransactionCommon_vinEmpty), so
no block holds it, a BUMP that claims it proves nothing, and an
unproven one has no input for the reader to hold it by.
NoOutputs
A raw transaction with at least one input and an output count of 0,
named at the transaction’s leading byte. The node refuses it beside
one with no input, after it (bsv-script-lean@87f0461
lean/BsvScript/TxRules.lean:86, checkTransactionCommon_voutEmpty),
so a transaction with neither is Reason::NoInputs. An unproven
coinbase is Reason::UnprovenCoinbase ahead of this check.
UnprovenCoinbase
An unproven single null-outpoint input, at the transaction’s leading byte. [SRC] sibling@87f0461 TxRules.lean:35-38,102 (#68).
NullOutpoint
A null outpoint in a regular transaction, at the input’s previous txid. [SRC] sibling@87f0461 TxRules.lean:31-32,107 (#68).
DuplicateInput
A repeated outpoint, at the repeating input’s previous txid. [SRC] sibling@87f0461 TxRules.lean:108 (#68).
ValueOutOfRange
An output value or running total outside MoneyRange, at the value field. [SRC] sibling@87f0461 TxRules.lean:25,88-93 (#68).