pub enum ExternalReceiptVerifyError {
ReadHistory {
path: PathBuf,
source: Error,
},
Parse {
path: PathBuf,
source: ExternalReceiptParseError,
},
Anchor {
path: PathBuf,
receipt_index: usize,
source: AnchorParseError,
},
AnchorVerify {
path: PathBuf,
receipt_index: usize,
source: Box<AnchorVerifyError>,
},
AnchorTextHashMismatch {
invariant: &'static str,
path: PathBuf,
receipt_index: usize,
declared: String,
observed: String,
},
TrustedRootStale {
invariant: &'static str,
trust_root_status: &'static str,
cache_path: Option<PathBuf>,
signed_at: Option<DateTime<Utc>>,
now: DateTime<Utc>,
max_age: Duration,
},
TrustedRootIo {
invariant: &'static str,
path: PathBuf,
source: Box<TrustedRootIoError>,
},
}Expand description
Verification errors for an external receipt history checked against a JSONL ledger.
Variants§
ReadHistory
The receipt history file could not be read.
Parse
The receipt history did not parse as repeated v1 records.
Fields
source: ExternalReceiptParseErrorParse failure.
Anchor
One receipt referenced a chain-head hash that does not validate as a
canonical LedgerAnchor.
Fields
source: AnchorParseErrorAnchor field validation failure.
AnchorVerify
The receipt’s position-bound anchor failed to verify against the local ledger.
Fields
source: Box<AnchorVerifyError>Local-ledger anchor verification failure.
AnchorTextHashMismatch
The recomputed anchor_text_sha256 did not match the receipt-declared value.
Fields
invariant: &'static strStable invariant token, equal to ANCHOR_TEXT_HASH_MISMATCH_INVARIANT.
TrustedRootStale
The cached or embedded trusted_root.json is older than the
operator-configured staleness window. Emits the stable
TRUSTED_ROOT_STALE_INVARIANT.
Fields
invariant: &'static strStable invariant token, equal to TRUSTED_ROOT_STALE_INVARIANT.
trust_root_status: &'static strProvenance token: EMBEDDED_ROOT_STATUS or CACHED_ROOT_STATUS.
TrustedRootIo
The cached trusted_root.json could not be loaded — I/O or parse
failure on the operator-supplied path. The embedded fallback path
is selected by passing None for the cache; this variant only
fires when a cache path was supplied AND the file existed.
Fields
invariant: &'static strStable invariant token, equal to TRUSTED_ROOT_PARSE_INVARIANT.
source: Box<TrustedRootIoError>Underlying I/O / parse failure.
Trait Implementations§
Source§impl Debug for ExternalReceiptVerifyError
impl Debug for ExternalReceiptVerifyError
Source§impl Display for ExternalReceiptVerifyError
impl Display for ExternalReceiptVerifyError
Source§impl Error for ExternalReceiptVerifyError
impl Error for ExternalReceiptVerifyError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()