Let validation know which account is the bank
This commit is contained in:
1 parent
6205097dd8
commit
d43596363a
1 file changed
+4
-2
+4
-2
@@ -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 = {}
|
||||
|
||||
Reference in new issue
Block a user