diff --git a/validation.py b/validation.py index 066ca45..281f47b 100644 --- a/validation.py +++ b/validation.py @@ -220,11 +220,13 @@ def _check_fee(legs, tx_type, errors): errors["fee_sats"] = "Avgifta kan ikkje vere like stor som eller større enn antalet." -def validate_transaction(payload, markets): +def validate_transaction(payload, markets, bank_id=None): """Return (transaction, errors) for a transaction to be stored. `markets` maps account id to its row, so that the taxable flag can default - from the account and a transfer destination can be checked. + from the account and a transfer destination can be checked. `bank_id` is the + account that pays the costs (docs/spec.md section 3.11), and it is optional so + that a caller without it still validates everything else. """ data = payload if isinstance(payload, dict) else {} errors = {}