pub trait FinalizedOffchainStorageError<Context, Value>where
Context: Config,{
type Error: RuntimeError;
// Required methods
fn hanging_hash() -> Self::Error;
fn hanging_value() -> Self::Error;
}Expand description
Defines caller-facing error signals specific to
Finalized storage.
Intended for Substrate FRAME-based runtimes only.
This trait allows callers to control how semantic invariant violations
detected by the Finalized storage model are surfaced as
[DispatchError] values.
These errors:
- originate from finality-specific consistency checks,
- are logged by the storage layer,
- and are returned to the caller as signals of inconsistency, not as definitive storage failures.
This trait does not affect storage behavior. It only defines which error values are emitted when an invariant is violated.
Required Associated Types§
Sourcetype Error: RuntimeError
type Error: RuntimeError
Concrete error type chosen by the caller.
This error is converted into a [DispatchError] before being
logged or returned.
Required Methods§
Sourcefn hanging_hash() -> Self::Error
fn hanging_hash() -> Self::Error
Emitted when a fork-aware value hash exists without a corresponding entry in persistent storage.
This indicates a hanging speculative value. The fork-aware entry is cleaned up automatically before this error is returned.
Sourcefn hanging_value() -> Self::Error
fn hanging_value() -> Self::Error
Emitted when persistent storage contains no value at all for the given key.
This means there is no speculative value being tracked, and therefore the fork-aware entry has no semantic meaning.
When this condition is detected, the fork-aware entry is cleaned up automatically before this error is returned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.