Skip to main content

Module shardtree_ext

Module shardtree_ext 

Source
Expand description

Domain-typed outcomes for shardtree’s boolean operations.

shardtree reports several operations as Ok(bool), where false conflates distinct situations that demand different responses. That conflation caused a real defect: a reorg truncation read the false from ShardTree::truncate_to_checkpoint on an empty migrated ironwood tree as corruption and wiped the wallet. This module is the crate’s single boundary with those boolean APIs: each wrapper names every outcome in a closed enum, so callers must match on meanings rather than interpret a bit.

Raw calls to the wrapped operations are confined to this module. The raw_boolean_calls_are_confined_to_this_module test enforces the boundary.

Enums§

CheckpointAppendOutcome
Outcome of appending a checkpoint that records the tree’s current frontier position at a new height.
RollbackOutcome
Outcome of rolling a tree back to a checkpoint.

Traits§

ShardTreeExt
The boundary wrapper over shardtree’s boolean operations, exported so downstream crates route through it too (zingolib’s legacy wallet import does. Its own source-walk test enforces its confinement).