registry/discharge

Discharging each collected duty against the transaction (#157 token-destinations-and-refunds, #177).

Responsibility

Once the fold has walked every request, dutiesFault checks each collected Duty in order against the transaction’s outputs and inputs: a delivered active token sits in the output its request named with its deposit, and a retirement consumes its one active witness. Lovelace owed to payees is settled by registry/settlement after duties hold.

Dependencies

Imports registry/duty (the duties), registry/refusal (deposit-returned), types and lib. Imported by registry/modify, and by the Aiken suite for the token-missing reason.

Assumptions

Invariants

Functions

dutiesFault(
  pins: State,
  cageAddress: Address,
  duties: List<Duty>,
  tx: Transaction,
) -> Option<String>

Why the transaction does not discharge the fold’s collected duties, or None when every one holds. Checked in order; the first fault is the reason, and ReturnDeposit always pass here.

tokenMissingRefusal() -> String

Why a retirement whose key IS Active still refuses: the transaction does not present that key’s one active witness for the burn to destroy (#177 I177-CHAIN). Lean: token-missing.

Search Document