[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: -add more accounting fields to r
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: -add more accounting fields to reserve table |
Date: |
Sat, 23 Apr 2022 19:01:30 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new b054c969 -add more accounting fields to reserve table
b054c969 is described below
commit b054c969cbd84f7ed0f61da3db6a8168b944318f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Apr 23 19:01:28 2022 +0200
-add more accounting fields to reserve table
---
src/exchangedb/common-0001.sql | 6 +++++-
src/exchangedb/exchange-0001-part.sql | 10 +++++++++-
src/lib/exchange_api_purse_create_with_merge.c | 6 +++---
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/exchangedb/common-0001.sql b/src/exchangedb/common-0001.sql
index 1bf3e630..a96b91fa 100644
--- a/src/exchangedb/common-0001.sql
+++ b/src/exchangedb/common-0001.sql
@@ -106,6 +106,10 @@ BEGIN
',reserve_pub BYTEA PRIMARY KEY CHECK(LENGTH(reserve_pub)=32)'
',current_balance_val INT8 NOT NULL'
',current_balance_frac INT4 NOT NULL'
+ ',purses_active INT8 NOT NULL DEFAULT(0)'
+ ',purses_allowed INT8 NOT NULL DEFAULT(0)'
+ ',kyc_required BOOLEAN NOT NULL DEFAULT(FALSE)'
+ ',kyc_passed BOOLEAN NOT NULL DEFAULT(FALSE)'
',expiration_date INT8 NOT NULL'
',gc_date INT8 NOT NULL'
') %s ;'
@@ -2331,7 +2335,7 @@ BEGIN
DROP CONSTRAINT IF EXISTS wads_in_pkey CASCADE
,DROP CONSTRAINT IF EXISTS wads_in_wad_id_origin_exchange_url_key
;
-
+
ALTER TABLE IF EXISTS wad_in_entries
DROP CONSTRAINT IF EXISTS wad_in_entries_pkey CASCADE
;
diff --git a/src/exchangedb/exchange-0001-part.sql
b/src/exchangedb/exchange-0001-part.sql
index b3e62a1e..0a333880 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -99,7 +99,15 @@ COMMENT ON TABLE reserves
COMMENT ON COLUMN reserves.reserve_pub
IS 'EdDSA public key of the reserve. Knowledge of the private key implies
ownership over the balance.';
COMMENT ON COLUMN reserves.current_balance_val
- IS 'Current balance remaining with the reserve';
+ IS 'Current balance remaining with the reserve.';
+COMMENT ON COLUMN reserves.purses_active
+ IS 'Number of purses that were created by this reserve that are not expired
and not fully paid.';
+COMMENT ON COLUMN reserves.purses_allowed
+ IS 'Number of purses that this reserve is allowed to have active at most.';
+COMMENT ON COLUMN reserves.kyc_required
+ IS 'True if a KYC check must have been passed before withdrawing from this
reserve. Set to true once a reserve received a P2P payment.';
+COMMENT ON COLUMN reserves.kyc_passed
+ IS 'True once KYC was passed for this reserve. The KYC details are then
available via the wire_targets table under the key of wire_target_h_payto which
is to be derived from the reserve_pub and the base URL of this exchange.';
COMMENT ON COLUMN reserves.expiration_date
IS 'Used to trigger closing of reserves that have not been drained after
some time';
COMMENT ON COLUMN reserves.gc_date
diff --git a/src/lib/exchange_api_purse_create_with_merge.c
b/src/lib/exchange_api_purse_create_with_merge.c
index 61d4e545..acf60cee 100644
--- a/src/lib/exchange_api_purse_create_with_merge.c
+++ b/src/lib/exchange_api_purse_create_with_merge.c
@@ -345,7 +345,7 @@ TALER_EXCHANGE_purse_create_with_merge (
GNUNET_free (pcm);
return NULL;
}
- TALER_wallet_purse_create_sign (purse_expiration,
+ TALER_wallet_purse_create_sign (pcm->purse_expiration,
&pcm->h_contract_terms,
&merge_pub,
min_age,
@@ -359,7 +359,7 @@ TALER_EXCHANGE_purse_create_with_merge (
&merge_sig);
TALER_wallet_account_merge_sign (merge_timestamp,
&pcm->purse_pub,
- purse_expiration,
+ pcm->purse_expiration,
&pcm->h_contract_terms,
&pcm->purse_value_after_fees,
min_age,
@@ -416,7 +416,7 @@ TALER_EXCHANGE_purse_create_with_merge (
GNUNET_JSON_pack_timestamp ("merge_timestamp",
merge_timestamp),
GNUNET_JSON_pack_timestamp ("purse_expiration",
- purse_expiration));
+ pcm->purse_expiration));
GNUNET_assert (NULL != create_with_merge_obj);
GNUNET_free (econtract);
eh = TALER_EXCHANGE_curl_easy_get_ (pcm->url);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: -add more accounting fields to reserve table,
gnunet <=