summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-10-11 09:17:15 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2022-10-11 09:17:15 +0200
commita9f11b7a5fb693d6b1b4b44bdf2eb12de0a7f528 (patch)
tree092bcef004c8da0febe63137725a6b1177388160
parent360dc88d5148cf2f5ab09f3e454f59d478747ad2 (diff)
downloaddocs-a9f11b7a5fb693d6b1b4b44bdf2eb12de0a7f528.tar.gz
docs-a9f11b7a5fb693d6b1b4b44bdf2eb12de0a7f528.tar.bz2
docs-a9f11b7a5fb693d6b1b4b44bdf2eb12de0a7f528.zip
define various amount fields for the policy_details
-rw-r--r--design-documents/028-deposit-policies.rst17
1 files changed, 10 insertions, 7 deletions
diff --git a/design-documents/028-deposit-policies.rst b/design-documents/028-deposit-policies.rst
index 62c45170..be840353 100644
--- a/design-documents/028-deposit-policies.rst
+++ b/design-documents/028-deposit-policies.rst
@@ -87,7 +87,7 @@ TODO: Description
label=<<B>policy_details</B>>
margin=20
policy_details [
- label="<id>id\l|<hash>hash_code (unique)\l|deadline\l|total_amount\l|policy_fee\l|refresh_amount\l|state\l"
+ label="<id>id\l|<hash>hash_code (unique)\l|deadline\l|commitment (amount)\l|accumulated_total (amount)\l|fee (amount)\l|transferable (amount)\l|fulfilment_state\l"
]
}
@@ -124,9 +124,10 @@ Ready
fulfilment to arrive before the deadline.
Insufficient
- The policy lacks funding, but has otherwise been accepted. Funding can
- be continued by calling ``/deposit`` with more coins and the same
- policy details.
+ The policy lacks funding, that is ``accumulated_total`` <
+ ``commitment``, but has otherwise been accepted. Funding can be
+ continued by calling ``/deposit`` with more coins and the same policy
+ details.
Success
The policy is provably fulfilled. The amounts for payout, fees and
@@ -149,9 +150,11 @@ Invariants
The following invariants need to be fulfilled and be checked by the auditor:
-- The total sum of amounts of all deposits that refer the same policy detail
- MUST NOT be less than the amount in the ``total_amount`` field in the
- ``policy_details`` table.
+- The fulfilment state of a policy is **Insufficient** IF AND ONLY IF the
+ amount in ``commitment`` is larger than the amount in ``accumulated_total``.
+
+- The sum of amounts in ``fee`` and ``transferable`` must be less or equal to
+ the amount in ``accumulated_total``.
- If the fulfilment state of a policy is **Success**, there MUST exists an
entry in the ``policy_details_fulfilment`` table for the corresponding