[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-donau] branch master updated: [db] Added donation units tables, m
From: |
gnunet |
Subject: |
[taler-donau] branch master updated: [db] Added donation units tables, modified other tables |
Date: |
Thu, 05 Oct 2023 13:15:23 +0200 |
This is an automated email from the git hooks/post-receive script.
johannes-casaburi pushed a commit to branch master
in repository donau.
The following commit(s) were added to refs/heads/master by this push:
new 9eff9f5 [db] Added donation units tables, modified other tables
9eff9f5 is described below
commit 9eff9f5aea89fc97d591a6cdfd9f2ef9a2c7cc49
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Thu Oct 5 13:14:33 2023 +0200
[db] Added donation units tables, modified other tables
---
...ions.sql => 0002-donation_unit_revocations.sql} | 13 ++++-----
src/donaudb/0002-donation_units.sql | 32 ++++++++++++++++++++++
src/donaudb/0002-donau_receipts_issued.sql | 8 ++----
src/donaudb/0002-donau_receipts_submitted.sql | 8 +++---
src/donaudb/0002-donau_sign_keys.sql | 4 +--
src/donaudb/0002-signkey_revocations.sql | 3 +-
6 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/src/donaudb/0002-signkey_revocations.sql
b/src/donaudb/0002-donation_unit_revocations.sql
similarity index 58%
copy from src/donaudb/0002-signkey_revocations.sql
copy to src/donaudb/0002-donation_unit_revocations.sql
index 181dc62..12f9000 100644
--- a/src/donaudb/0002-signkey_revocations.sql
+++ b/src/donaudb/0002-donation_unit_revocations.sql
@@ -7,17 +7,16 @@
-- Foundation; either version 3, or (at your option) any later version.
--
-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
--- WARRANTY; without even the implied warranty of CHARITYABILITY or FITNESS FOR
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR
-- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License along with
-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
--
-CREATE TABLE signkey_revocations
- (signkey_revocations_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
- ,esk_serial INT8 PRIMARY KEY REFERENCES donau_sign_keys (esk_serial) ON
DELETE CASCADE
- ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
+CREATE TABLE IF NOT EXISTS donation_unit_revocations
+ (donation_unit_revocations_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY
UNIQUE
+ ,donation_unit_serial INT8 PRIMARY KEY REFERENCES donation_units
(donation_unit_serial) ON DELETE CASCADE
);
-COMMENT ON TABLE signkey_revocations
- IS 'Table storing which online signing keys have been revoked';
+COMMENT ON TABLE donation_unit_revocations
+ IS 'remembering which donation_unit keys have been revoked';
diff --git a/src/donaudb/0002-donation_units.sql
b/src/donaudb/0002-donation_units.sql
new file mode 100644
index 0000000..feebf1b
--- /dev/null
+++ b/src/donaudb/0002-donation_units.sql
@@ -0,0 +1,32 @@
+--
+-- This file is part of TALER
+-- Copyright (C) 2014--2022 Taler Systems SA
+--
+-- TALER is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 3, or (at your option) any later version.
+--
+-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR
+-- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License along with
+-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+--
+
+CREATE TABLE donation_units
+ (donation_unit_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+ ,donation_unit_pub_hash BYTEA PRIMARY KEY CHECK
(LENGTH(donation_unit_pub_hash)=64)
+ ,donation_unit_pub BYTEA NOT NULL
+ ,valid_from INT8 NOT NULL
+ ,expire_legal INT8 NOT NULL
+ ,donation_unit taler_amount NOT NULL
+ );
+COMMENT ON TABLE donation_units
+ IS 'Main donation_unit table. All the valid donation_unit the exchange knows
about.';
+COMMENT ON COLUMN donation_units.donation_unit_serial
+ IS 'needed for exchange-auditor replication logic';
+
+CREATE INDEX donation_units_by_expire_legal_index
+ ON donation_units
+ (expire_legal);
diff --git a/src/donaudb/0002-donau_receipts_issued.sql
b/src/donaudb/0002-donau_receipts_issued.sql
index 1817cef..3457c0a 100644
--- a/src/donaudb/0002-donau_receipts_issued.sql
+++ b/src/donaudb/0002-donau_receipts_issued.sql
@@ -18,10 +18,8 @@ CREATE TABLE receipts_issued
(receipt_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,charity_sig BYTEA CHECK (LENGTH(charity_sig)=64)
,charity_id BIGINT NOT NULL REFERENCES charities (charity_id) ON DELETE
CASCADE
- ,receipt_hash BYTEA NOT NULL -- H(BDID+...)
- -- + amount
--- ,donation_unit_key_id INT8 NOT NULL
--- ,donation_unit_sig BYTEA CHECK (LENGTH(donation_unit_sig)=64)
+ ,receipt_hash BYTEA NOT NULL
+ ,amount taler_amount NOT NULL
);
COMMENT ON TABLE receipts_issued
IS 'Table containing the issued blinded donation receipts to the charity.';
@@ -29,5 +27,3 @@ COMMENT ON COLUMN receipts_issued.charity_sig
IS 'Signature from the charity.';
COMMENT ON COLUMN receipts_issued.receipt_hash
IS 'Hash value of the receipt received.';
-
--- Sign (total-amount, H(BDID_1 + H(p1), BDID_2 + H(p2), ...))
diff --git a/src/donaudb/0002-donau_receipts_submitted.sql
b/src/donaudb/0002-donau_receipts_submitted.sql
index 6812746..05cb664 100644
--- a/src/donaudb/0002-donau_receipts_submitted.sql
+++ b/src/donaudb/0002-donau_receipts_submitted.sql
@@ -17,8 +17,8 @@
CREATE TABLE receipts_submitted
(receipt_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,hash_tax_number BYTEA NOT NULL
- ,nonce BYTEA NOT NULL UNIQUE -- LENGTH constraint
- ,total_amount taler_amount NOT NULL -- or maybe better: reference to public
key used to sign! => donation unit key
+ ,nonce BYTEA NOT NULL UNIQUE CHECK (LENGTH(nonce)=32)
+ ,donation_unit_pub BYTEA NOT NULL REFERENCES donation_units
(donation_unit_pub)
,donau_sig BYTEA NOT NULL UNIQUE
,donation_year INT8 NOT NULL
);
@@ -26,5 +26,5 @@ COMMENT ON TABLE receipts_submitted
IS 'Table containing information of the donation receips submitted from the
donor.';
COMMENT ON COLUMN receipts_submitted.hash_tax_number
IS 'The hash of the tax number and salt.';
-COMMENT ON COLUMN receipts_submitted.total_amount
- IS 'The total amount over all donation receipts.';
+COMMENT ON COLUMN receipts_submitted.donation_unit_pub
+ IS 'Reference to public key used to sign.';
diff --git a/src/donaudb/0002-donau_sign_keys.sql
b/src/donaudb/0002-donau_sign_keys.sql
index 094b587..7888cbf 100644
--- a/src/donaudb/0002-donau_sign_keys.sql
+++ b/src/donaudb/0002-donau_sign_keys.sql
@@ -15,7 +15,7 @@
--
CREATE TABLE donau_sign_keys
- (esk_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+ (dsk_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,donau_pub BYTEA PRIMARY KEY CHECK (LENGTH(donau_pub)=32)
,valid_from INT8 NOT NULL
,expire_sign INT8 NOT NULL
@@ -25,8 +25,6 @@ COMMENT ON TABLE donau_sign_keys
IS 'Table with master public key signatures on donau online signing keys.';
COMMENT ON COLUMN donau_sign_keys.donau_pub
IS 'Public online signing key of the donau.';
-COMMENT ON COLUMN donau_sign_keys.master_sig
- IS 'Signature affirming the validity of the signing key of purpose
TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY.';
COMMENT ON COLUMN donau_sign_keys.valid_from
IS 'Time when this online signing key will first be used to sign messages.';
COMMENT ON COLUMN donau_sign_keys.expire_sign
diff --git a/src/donaudb/0002-signkey_revocations.sql
b/src/donaudb/0002-signkey_revocations.sql
index 181dc62..9363a3d 100644
--- a/src/donaudb/0002-signkey_revocations.sql
+++ b/src/donaudb/0002-signkey_revocations.sql
@@ -16,8 +16,7 @@
CREATE TABLE signkey_revocations
(signkey_revocations_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
- ,esk_serial INT8 PRIMARY KEY REFERENCES donau_sign_keys (esk_serial) ON
DELETE CASCADE
- ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
+ ,dsk_serial INT8 PRIMARY KEY REFERENCES donau_sign_keys (dsk_serial) ON
DELETE CASCADE
);
COMMENT ON TABLE signkey_revocations
IS 'Table storing which online signing keys have been revoked';
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-donau] branch master updated: [db] Added donation units tables, modified other tables,
gnunet <=