pub fn action_fee_operations(
payer_id: Identifier,
action_fees: &[ResolvedDocumentActionFee],
) -> Result<Vec<DriveOperation<'static>>, ProtocolError>Expand description
The operations that charge action_fees to payer_id: one removal from the payer’s
balance and one addition per contract fee pot that receives something. Empty when nothing
is owed.
The additions are summed per pot because a pot’s new total is computed from the committed one: two additions to the same pot in one batch would lose the first. The credits only move, from an identity balance into pots under the prefunded balances sum tree, so the sum of all credits is unchanged.
The transition’s own operations may write the payer’s balance too (a purchase price, a
contested document’s voting fund, a sale paying a contract owner who sponsors the gas):
apply_drive_operations merges those writes with this removal into one.
Fee validation and execution both build the operations here: fee validation to estimate the batch for the sponsor and, when the sponsor does not pay, for the identity; execution for the payer fee validation settled on.