Require the sats leg of an admin_cost and reject a kroner leg
This commit is contained in:
1 parent
041e36de49
commit
e6b07afd2a
1 file changed
+8
-3
+8
-3
@@ -189,12 +189,17 @@ def _check_trade(legs, errors):
|
|||||||
|
|
||||||
|
|
||||||
def _check_admin_cost(legs, errors):
|
def _check_admin_cost(legs, errors):
|
||||||
present = [name for name in ("leg_out_sats", "leg_out_ore") if legs[name] is not None]
|
"""admin_cost takes sats only and stands on its own (docs/spec.md section 3.10)."""
|
||||||
if len(present) != 1:
|
if legs["leg_out_sats"] is None or legs["leg_out_ore"] is not None:
|
||||||
errors["leg_out_sats"] = "Fyll ut kostnaden i sats eller i kroner, men berre éin."
|
errors["leg_out_sats"] = "Fyll ut kostnaden i sats."
|
||||||
|
|
||||||
|
|
||||||
def _check_fee(legs, tx_type, errors):
|
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:
|
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."
|
errors["fee_ore"] = "Avgifta kan berre førast i éin valuta."
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in new issue
Block a user