Skip to main content

process_pads

Function process_pads 

Source
pub fn process_pads(directives: &[Directive]) -> PadResult
Expand description

Process pad directives and generate synthetic transactions.

This function:

  1. Tracks account inventories
  2. When a pad is encountered, stores it as pending
  3. When a balance assertion is encountered for an account with a pending pad, generates a synthetic transaction to make the balance match

§Arguments

  • directives - The directives to process. Order does not matter: process_pads sorts a view of them by date internally before applying pad math.

§Returns

A PadResult containing:

  • The synthetic padding transactions derived from the input
  • Any errors encountered

The input directives are NOT echoed back in the result; the caller already owns them. To get the source merged with the synth transactions, use merge_with_padding.