Check that a transfer carries one currency

This commit is contained in:
ai-bot committed 2026-11-15 18:30:08 +00:00
1 parent a95ef9da73
commit 0d31ad7250
1 file changed
+8
+8
View File
@@ -199,6 +199,14 @@ def _check_admin_cost(legs, errors):
errors["leg_out_sats"] = "Fyll ut kostnaden i kroner."
def _check_transfer_out(legs, errors):
"""A transfer carries sats or kroner, never both (docs/spec.md section 3.11)."""
if legs["leg_out_sats"] is not None and legs["leg_out_ore"] is not None:
errors["leg_out_sats"] = "Berre éi valuta om gongen."
elif legs["leg_out_sats"] is None and legs["leg_out_ore"] is None:
errors["leg_out_sats"] = "Fyll ut antalet som vert sendt."
def _check_fee(legs, tx_type, errors):
"""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: