From 06e550771ca5d10feb8afc7c158c05288e77435f Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 15 Nov 2026 10:33:59 +0000 Subject: [PATCH] Check the admin cost legs and the sats-only fee --- validation.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/validation.py b/validation.py index 73e8067..7bbae53 100644 --- a/validation.py +++ b/validation.py @@ -194,19 +194,15 @@ def _check_trade(legs, errors): def _check_admin_cost(legs, errors): - """admin_cost takes sats only and stands on its own (docs/spec.md section 3.10).""" - if legs["leg_out_sats"] is None or legs["leg_out_ore"] is not None: - errors["leg_out_sats"] = "Fyll ut kostnaden i sats." + """admin_cost is a kroner cost and stands on its own (docs/spec.md section 3.10).""" + if legs["leg_out_ore"] is None or legs["leg_out_sats"] is not None: + errors["leg_out_sats"] = "Fyll ut kostnaden i kroner." def _check_fee(legs, tx_type, errors): - if tx_type in NO_FEE_TYPES: - for name in ("fee_sats", "fee_ore"): - if legs[name] is not None: - errors[name] = "Denne typen tek ikkje avgift." - return - if legs["fee_sats"] is not None and legs["fee_ore"] is not None: - errors["fee_ore"] = "Avgifta kan berre førast i éin valuta." + """A fee is in sats only (docs/spec.md section 3.2).""" + if legs["fee_sats"] is not None and tx_type in NO_FEE_TYPES: + errors["fee_sats"] = "Denne typen tek ikkje avgift." return fee_sats = legs["fee_sats"] or 0 if not fee_sats: