pub enum ClaimLogObservation {
Consulted {
observed_at: u64,
claims_submitted_count: u64,
},
NotConsulted {
observed_at: u64,
},
}Expand description
What a node can say about its own claim log: it read the log and has a count, or it did not read the log and has no count to give.
§Why the count is inside the variant
The count and the fact that anything was counted cannot be separated, for the
same reason Half’s items live inside Consulted. A node whose claim log
is missing, unreadable, or failed to read has nothing to report, and a
claims_submitted_count: 0 beside a freshly stamped observed_at is worse
than an undated zero: the date actively reassures the reader that something
looked at the log just now and found nothing, which is dig-rewards-coin SPEC
§12.5 clause 6’s “reassuring zero” reproduced inside the type added to remove
it. There is no arm here that can carry a count without having read the log.
This is a sibling of Half rather than an instance of it: Half answers
for a collection and carries items, and forcing a scalar tally through it
would mean either a vacuous Vec or a wire key that names the wrong thing.
The vocabulary — outcome, two arms, observed_at in both — is deliberately
identical, so a reader who has learned one has learned the other.
observed_at dates the consultation, not the assembly of the answer:
in Consulted it is when the log was read, and in
NotConsulted it is when the responder established
that it could not read it. Fail-closed like Half: internally tagged, no
#[serde(other)], no Default, no skip_serializing_if.
Variants§
Consulted
The claim log WAS read as of observed_at (Unix seconds), and
claims_submitted_count is what it held.
Fields
NotConsulted
The claim log was NOT read as of observed_at (Unix seconds) — missing,
unreadable, or the read failed. There is deliberately no count here.
Trait Implementations§
Source§impl Clone for ClaimLogObservation
impl Clone for ClaimLogObservation
Source§fn clone(&self) -> ClaimLogObservation
fn clone(&self) -> ClaimLogObservation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more