Skip to main content

apply_balances

Function apply_balances 

Source
pub fn apply_balances(
    base: &mut Vec<u64>,
    delta: &ArchivedBalancesDiff,
) -> Result<(), Error>
Expand description

Applies a balance delta to a contiguous balance vector in place.

base must initially contain the balance snapshot from which delta was generated. After successful application, base contains the reconstructed target snapshot.

This is a convenience wrapper around apply_balances_iter for clients that store balances contiguously.

ยงErrors

Returns an error if delta is malformed or if its represented base length does not match base.