Module balance

Module balance 

Source
Expand description

(owner, coin_type)BalanceDelta.

Each row holds two independent i128 accumulators: coin from the owned-Coin<T>-object pipeline and address from the accumulator-balance pipeline. Both pipelines stage merge operands carrying only their own field; the merge operator sums each field component-wise with saturation, and the compaction filter drops rows where both components are zero so a fully cancelled balance doesn’t linger on disk.

Structs§

Balance
Caller-facing view of one balance row, decomposed into its two contributing sources.
Key
OwnerPrefix
Prefix encoder for “all balances of owner”. The prefix is the 32 raw owner bytes — the leading bytes of any Key whose owner matches.

Constants§

NAME

Functions§

address_delta
Build a (Key, Value) pair representing an accumulator-side delta — the change in address-balance for (owner, coin_type) observed via the accumulator-bucket pipeline.
coin_delta
Build a (Key, Value) pair representing a coin-side delta — the change in coin balance for (owner, coin_type) due to a Coin<T> create / transfer / destroy event.
delta
Build a (Key, Value) pair representing both sides of the balance change for (owner, coin_type) in a single merge operand. Either field may be zero; the merge operator’s field-wise sum makes a zero contribution a no-op against the accumulator.
options
CF options: install the field-wise i128 merge operator and the drop-when-zero compaction filter.

Type Aliases§

Value