Require a destination for a sats transfer only
This commit is contained in:
1 parent
0d31ad7250
commit
bda3db46f6
1 file changed
+7
@@ -291,6 +291,13 @@ def validate_transaction(payload, markets):
|
|||||||
if name not in _ALLOWED_LEGS.get(tx_type, ()):
|
if name not in _ALLOWED_LEGS.get(tx_type, ()):
|
||||||
errors[name] = "Feltet høyrer ikkje til denne typen."
|
errors[name] = "Feltet høyrer ikkje til denne typen."
|
||||||
if tx_type == "transfer_out":
|
if tx_type == "transfer_out":
|
||||||
|
_check_transfer_out(legs, errors)
|
||||||
|
# An empty destination is a withdrawal, and only kroner can be
|
||||||
|
# withdrawn (docs/spec.md section 3.11).
|
||||||
|
if _blank(data.get("to_market_id")):
|
||||||
|
if legs["leg_out_ore"] is None:
|
||||||
|
errors["to_market_id"] = "Ei overføring i sats må ha ein mottakar."
|
||||||
|
else:
|
||||||
to_market_id, error = validate_market_id(
|
to_market_id, error = validate_market_id(
|
||||||
data.get("to_market_id"), markets, "to_market_id"
|
data.get("to_market_id"), markets, "to_market_id"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user