Module balance

Module balance 

Source
Expand description

Reading address balances.

In the functions in this module:

The block write task commits blocks to the finalized state before updating chain with a cached copy of the best non-finalized chain from NonFinalizedState.chain_set. Then the block commit task can commit additional blocks to the finalized state after weโ€™ve cloned the chain.

This means that some blocks can be in both:

  • the cached Chain, and
  • the shared finalized ZebraDb reference.

Functionsยง

apply_balance_change ๐Ÿ”’
Add the supplied finalized and non-finalized balances together, and return the result.
chain_transparent_balance_change ๐Ÿ”’
Returns the total transparent balance change for addresses in the non-finalized chain, matching the balance for the finalized_tip.
finalized_transparent_balance ๐Ÿ”’
Returns the total transparent balance for addresses in the finalized chain, and the finalized tip height the balances were queried at.
transparent_balance
Returns the total transparent balance and received balance for the supplied transparent::Addresses.