pub struct Verdict {
pub status: String,
pub height: Option<Height>,
pub reason: Option<String>,
pub competitors: Vec<TxId>,
}Expand description
Raw broadcaster metadata. HTTP acceptance is not chain evidence.
Fields§
§status: StringThe txStatus word, trimmed and upper-cased by Verdict::from_arc_body.
height: Option<Height>The raw blockHeight, when present.
reason: Option<String>The raw extraInfo, when present: text, never a status.
competitors: Vec<TxId>The competingTxs, lowercased and checked for shape and uniqueness.
Implementations§
Source§impl Verdict
impl Verdict
Sourcepub fn from_arc_body(
expected_txid: &str,
bytes: &[u8],
) -> Result<Self, VerdictError>
pub fn from_arc_body( expected_txid: &str, bytes: &[u8], ) -> Result<Self, VerdictError>
Read an ARC body as metadata, checking its echoed txid and the bounded status vocabulary at bsv-rs@7bc623c. HTTP status is never consulted.
The word is trimmed before the vocabulary check and kept trimmed and
upper-cased, so " SEEN_ON_NETWORK " reads as SEEN_ON_NETWORK
(0.4.1; bsv-stack-lean #169, the spaced body of LOW’s door test
tracker_vocabulary_differs_from_the_door_exactly_here in
bsv-overlay-cloudflare crates/overlay-cloudflare/src/door_words.rs).
§Errors
VerdictError::Shape when the body does not decode,
VerdictError::TxidMismatch when it echoes another or a malformed
txid, VerdictError::InvalidMetadata when its text or competitors
break the bounds, and VerdictError::UnknownStatus for a status word
outside the vocabulary.
Sourcepub fn into_hint(self, source: impl Into<String>, observed: Timestamp) -> Hint
pub fn into_hint(self, source: impl Into<String>, observed: Timestamp) -> Hint
Interpret a status as a hint; no result is a node verdict or a proof.
Only the status word moves the status (0.4.1; bsv-stack-lean #169,
LOW’s door test tracker_vocabulary_differs_from_the_door_exactly_here
in bsv-overlay-cloudflare crates/overlay-cloudflare/src/door_words.rs):
extraInfo is text and stays on reason, so an ORPHAN or
reorg_unmined there no longer overrides the word; only
SEEN_IN_ORPHAN_MEMPOOL is HintStatus::OrphanMempool and only the
stale-block words are HintStatus::StaleBlock. PENDING_RETRY and
STUMP_PROCESSING, a broadcaster still working on it, are
HintStatus::Accepted. A mined word with no height stays
HintStatus::Unknown, and named competitors still turn an accepting
word into HintStatus::DoubleSpend.