gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: Splitted auditor-0001 and remove


From: gnunet
Subject: [taler-exchange] branch master updated: Splitted auditor-0001 and removed master_pub
Date: Mon, 25 Sep 2023 23:13:24 +0200

This is an automated email from the git hooks/post-receive script.

nic-eigel pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 732ba9c8 Splitted auditor-0001 and removed master_pub
732ba9c8 is described below

commit 732ba9c860b1e7cace1d582bcaf891dbc48f6200
Author: nic <nic@eigel.ch>
AuthorDate: Mon Sep 25 23:13:08 2023 +0200

    Splitted auditor-0001 and removed master_pub
---
 src/auditordb/0002-auditor_balance_summary.sql     | 40 +++++++++++++++++++++
 .../0002-auditor_denomination_pending.sql          | 38 ++++++++++++++++++++
 src/auditordb/0002-auditor_exchange_signkeys.sql   | 25 +++++++++++++
 .../0002-auditor_historic_denomination_revenue.sql | 28 +++++++++++++++
 .../0002-auditor_historic_reserve_summary.sql      | 28 +++++++++++++++
 src/auditordb/0002-auditor_predicted_result.sql    | 24 +++++++++++++
 .../0002-auditor_progress_aggregation.sql          | 23 ++++++++++++
 src/auditordb/0002-auditor_progress_coin.sql       | 31 ++++++++++++++++
 .../0002-auditor_progress_deposit_confirmation.sql | 23 ++++++++++++
 src/auditordb/0002-auditor_progress_purse.sql      | 27 ++++++++++++++
 src/auditordb/0002-auditor_progress_reserve.sql    | 24 +++++++++++++
 src/auditordb/0002-auditor_purse_summary.sql       | 23 ++++++++++++
 src/auditordb/0002-auditor_purses.sql              | 31 ++++++++++++++++
 src/auditordb/0002-auditor_reserve_balance.sql     | 34 ++++++++++++++++++
 src/auditordb/0002-auditor_reserves.sql            | 42 ++++++++++++++++++++++
 src/auditordb/0002-auditor_wire_fee_balance.sql    | 22 ++++++++++++
 src/auditordb/0002-deposit_confirmations.sql       | 35 ++++++++++++++++++
 .../0002-wire_auditor_account_progress.sql         | 27 ++++++++++++++
 src/auditordb/0002-wire_auditor_progress.sql       | 21 +++++++++++
 src/auditordb/auditor-0002.sql                     | 39 ++++++++++++++++++++
 src/auditordb/auditor-0002.sql.in                  | 42 ++++++++++++++++++++++
 21 files changed, 627 insertions(+)

diff --git a/src/auditordb/0002-auditor_balance_summary.sql 
b/src/auditordb/0002-auditor_balance_summary.sql
new file mode 100644
index 00000000..ffb8e4fa
--- /dev/null
+++ b/src/auditordb/0002-auditor_balance_summary.sql
@@ -0,0 +1,40 @@
+--
+-- 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 IF NOT EXISTS auditor_balance_summary
+    ,denom_balance_val INT8 NOT NULL
+    ,denom_balance_frac INT4 NOT NULL
+    ,deposit_fee_balance_val INT8 NOT NULL
+    ,deposit_fee_balance_frac INT4 NOT NULL
+    ,melt_fee_balance_val INT8 NOT NULL
+    ,melt_fee_balance_frac INT4 NOT NULL
+    ,refund_fee_balance_val INT8 NOT NULL
+    ,refund_fee_balance_frac INT4 NOT NULL
+    ,purse_fee_balance_val INT8 NOT NULL
+    ,purse_fee_balance_frac INT4 NOT NULL
+    ,open_deposit_fee_balance_val INT8 NOT NULL
+    ,open_deposit_fee_balance_frac INT4 NOT NULL
+    ,risk_val INT8 NOT NULL
+    ,risk_frac INT4 NOT NULL
+    ,loss_val INT8 NOT NULL
+    ,loss_frac INT4 NOT NULL
+    ,irregular_loss_val INT8 NOT NULL
+    ,irregular_loss_frac INT4 NOT NULL
+    );
+COMMENT ON TABLE auditor_balance_summary
+  IS 'the sum of the outstanding coins from auditor_denomination_pending 
(denom_pubs must belong to the respectives exchange master public key); it 
represents the auditor_balance_summary of the exchange at this point (modulo 
unexpected historic_loss-style events where denomination keys are compromised)';
+COMMENT ON COLUMN auditor_balance_summary.denom_balance_frac
+ IS 'total amount we should have in escrow for all denominations';
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_denomination_pending.sql 
b/src/auditordb/0002-auditor_denomination_pending.sql
new file mode 100644
index 00000000..e03febfe
--- /dev/null
+++ b/src/auditordb/0002-auditor_denomination_pending.sql
@@ -0,0 +1,38 @@
+--
+-- 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 IF NOT EXISTS auditor_denomination_pending
+(denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64)
+    ,denom_balance_val INT8 NOT NULL
+    ,denom_balance_frac INT4 NOT NULL
+    ,denom_loss_val INT8 NOT NULL
+    ,denom_loss_frac INT4 NOT NULL
+    ,num_issued INT8 NOT NULL
+    ,denom_risk_val INT8 NOT NULL
+    ,denom_risk_frac INT4 NOT NULL
+    ,recoup_loss_val INT8 NOT NULL
+    ,recoup_loss_frac INT4 NOT NULL
+    );
+COMMENT ON TABLE auditor_denomination_pending
+  IS 'outstanding denomination coins that the exchange is aware of and what 
the respective balances are (outstanding as well as issued overall which 
implies the maximum value at risk).';
+COMMENT ON COLUMN auditor_denomination_pending.num_issued
+  IS 'counts the number of coins issued (withdraw, refresh) of this 
denomination';
+COMMENT ON COLUMN auditor_denomination_pending.denom_risk_val
+  IS 'amount that could theoretically be lost in the future due to recoup 
operations';
+COMMENT ON COLUMN auditor_denomination_pending.denom_loss_val
+  IS 'amount that was lost due to failures by the exchange';
+COMMENT ON COLUMN auditor_denomination_pending.recoup_loss_val
+  IS 'amount actually lost due to recoup operations after a revocation';
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_exchange_signkeys.sql 
b/src/auditordb/0002-auditor_exchange_signkeys.sql
new file mode 100644
index 00000000..dbd15cf7
--- /dev/null
+++ b/src/auditordb/0002-auditor_exchange_signkeys.sql
@@ -0,0 +1,25 @@
+--
+-- 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 IF NOT EXISTS auditor_exchange_signkeys
+    ,ep_start INT8 NOT NULL
+    ,ep_expire INT8 NOT NULL
+    ,ep_end INT8 NOT NULL
+    ,exchange_pub BYTEA NOT NULL CHECK (LENGTH(exchange_pub)=32)
+    ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
+    );
+COMMENT ON TABLE auditor_exchange_signkeys
+  IS 'list of the online signing keys of exchanges we are auditing';
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_historic_denomination_revenue.sql 
b/src/auditordb/0002-auditor_historic_denomination_revenue.sql
new file mode 100644
index 00000000..ac8b9c9f
--- /dev/null
+++ b/src/auditordb/0002-auditor_historic_denomination_revenue.sql
@@ -0,0 +1,28 @@
+--
+-- 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 IF NOT EXISTS auditor_historic_denomination_revenue
+    ,denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64)
+    ,revenue_timestamp INT8 NOT NULL
+    ,revenue_balance_val INT8 NOT NULL
+    ,revenue_balance_frac INT4 NOT NULL
+    ,loss_balance_val INT8 NOT NULL
+    ,loss_balance_frac INT4 NOT NULL
+    );
+COMMENT ON TABLE auditor_historic_denomination_revenue
+  IS 'Table with historic profits; basically, when a denom_pub has expired and 
everything associated with it is garbage collected, the final profits end up in 
here; note that the denom_pub here is not a foreign key, we just keep it as a 
reference point.';
+COMMENT ON COLUMN auditor_historic_denomination_revenue.revenue_balance_val
+  IS 'the sum of all of the profits we made on the coin except for withdraw 
fees (which are in historic_reserve_revenue); so this includes the deposit, 
melt and refund fees';
diff --git a/src/auditordb/0002-auditor_historic_reserve_summary.sql 
b/src/auditordb/0002-auditor_historic_reserve_summary.sql
new file mode 100644
index 00000000..78bffd32
--- /dev/null
+++ b/src/auditordb/0002-auditor_historic_reserve_summary.sql
@@ -0,0 +1,28 @@
+--
+-- 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 IF NOT EXISTS auditor_historic_reserve_summary
+    ,start_date INT8 NOT NULL
+    ,end_date INT8 NOT NULL
+    ,reserve_profits_val INT8 NOT NULL
+    ,reserve_profits_frac INT4 NOT NULL
+    );
+COMMENT ON TABLE auditor_historic_reserve_summary
+  IS 'historic profits from reserves; we eventually GC 
auditor_historic_reserve_revenue, and then store the totals in here (by time 
intervals).';
+
+CREATE INDEX IF NOT EXISTS 
auditor_historic_reserve_summary_by_master_pub_start_date
+    ON auditor_historic_reserve_summary
+    (start_date);
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_predicted_result.sql 
b/src/auditordb/0002-auditor_predicted_result.sql
new file mode 100644
index 00000000..cc39afb1
--- /dev/null
+++ b/src/auditordb/0002-auditor_predicted_result.sql
@@ -0,0 +1,24 @@
+--
+-- 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 IF NOT EXISTS auditor_predicted_result
+    ,balance_val INT8 NOT NULL
+    ,balance_frac INT4 NOT NULL
+    ,drained_val INT8 NOT NULL
+    ,drained_frac INT4 NOT NULL
+    );
+COMMENT ON TABLE auditor_predicted_result
+  IS 'Table with the sum of the ledger, auditor_historic_revenue and the 
auditor_reserve_balance and the drained profits.  This is the final amount that 
the exchange should have in its bank account right now (and the total amount 
drained as profits to non-escrow accounts).';
diff --git a/src/auditordb/0002-auditor_progress_aggregation.sql 
b/src/auditordb/0002-auditor_progress_aggregation.sql
new file mode 100644
index 00000000..033d63be
--- /dev/null
+++ b/src/auditordb/0002-auditor_progress_aggregation.sql
@@ -0,0 +1,23 @@
+--
+-- 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 IF NOT EXISTS auditor_progress_aggregation
+    ,last_wire_out_serial_id INT8 NOT NULL DEFAULT 0
+    -- ,PRIMARY KEY (master_pub)
+    );
+COMMENT ON TABLE auditor_progress_aggregation
+  IS 'information as to which transactions the auditor has processed in the 
exchange database.  Used for SELECTing the
+ statements to process.  The indices include the last serial ID from the 
respective tables that we have processed. Thus, we need to select those table 
entries that are strictly larger (and process in monotonically increasing 
order).';
diff --git a/src/auditordb/0002-auditor_progress_coin.sql 
b/src/auditordb/0002-auditor_progress_coin.sql
new file mode 100644
index 00000000..8f555164
--- /dev/null
+++ b/src/auditordb/0002-auditor_progress_coin.sql
@@ -0,0 +1,31 @@
+--
+-- 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 IF NOT EXISTS auditor_progress_coin
+    ,last_withdraw_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_deposit_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_melt_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_refund_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_recoup_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_recoup_refresh_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_open_deposits_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_purse_deposits_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_purse_decision_serial_id INT8 NOT NULL DEFAULT 0
+    -- ,PRIMARY KEY (master_pub)
+    );
+COMMENT ON TABLE auditor_progress_coin
+  IS 'information as to which transactions the auditor has processed in the 
exchange database.  Used for SELECTing the
+ statements to process.  The indices include the last serial ID from the 
respective tables that we have processed. Thus, we need to select those table 
entries that are strictly larger (and process in monotonically increasing 
order).';
diff --git a/src/auditordb/0002-auditor_progress_deposit_confirmation.sql 
b/src/auditordb/0002-auditor_progress_deposit_confirmation.sql
new file mode 100644
index 00000000..73d3c09d
--- /dev/null
+++ b/src/auditordb/0002-auditor_progress_deposit_confirmation.sql
@@ -0,0 +1,23 @@
+--
+-- 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 IF NOT EXISTS auditor_progress_deposit_confirmation
+    ,last_deposit_confirmation_serial_id INT8 NOT NULL DEFAULT 0
+    --,PRIMARY KEY (master_pub)
+    );
+COMMENT ON TABLE auditor_progress_deposit_confirmation
+  IS 'information as to which transactions the auditor has processed in the 
exchange database.  Used for SELECTing the
+ statements to process.  The indices include the last serial ID from the 
respective tables that we have processed. Thus, we need to select those table 
entries that are strictly larger (and process in monotonically increasing 
order).';
diff --git a/src/auditordb/0002-auditor_progress_purse.sql 
b/src/auditordb/0002-auditor_progress_purse.sql
new file mode 100644
index 00000000..29e14dc9
--- /dev/null
+++ b/src/auditordb/0002-auditor_progress_purse.sql
@@ -0,0 +1,27 @@
+--
+-- 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 IF NOT EXISTS auditor_progress_purse
+    ,last_purse_request_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_purse_decision_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_purse_merges_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_account_merges_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_purse_deposits_serial_id INT8 NOT NULL DEFAULT 0
+    -- ,PRIMARY KEY (master_pub)
+    );
+COMMENT ON TABLE auditor_progress_purse
+  IS 'information as to which purses the purse auditor has processed in the 
exchange database.  Used for SELECTing the
+ statements to process.  The indices include the last serial ID from the 
respective tables that we have processed. Thus, we need to select those table 
entries that are strictly larger (and process in monotonically increasing 
order).';
diff --git a/src/auditordb/0002-auditor_progress_reserve.sql 
b/src/auditordb/0002-auditor_progress_reserve.sql
new file mode 100644
index 00000000..5b392f42
--- /dev/null
+++ b/src/auditordb/0002-auditor_progress_reserve.sql
@@ -0,0 +1,24 @@
+--
+-- 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 IF NOT EXISTS auditor_progress_reserve
+    ,reserve_name TEXT NOT NULL
+    ,serial_id INT8 NOT NULL
+   --  ,PRIMARY KEY (master_pub)
+    );
+COMMENT ON TABLE auditor_progress_reserve
+  IS 'information as to which transactions the reserve auditor has processed 
in the exchange database.  Used for SELECTing the
+ statements to process.  The indices include the last serial ID from the 
respective tables that we have processed. Thus, we need to select those table 
entries that are strictly larger (and process in monotonically increasing 
order).';
diff --git a/src/auditordb/0002-auditor_purse_summary.sql 
b/src/auditordb/0002-auditor_purse_summary.sql
new file mode 100644
index 00000000..7a3a1bda
--- /dev/null
+++ b/src/auditordb/0002-auditor_purse_summary.sql
@@ -0,0 +1,23 @@
+--
+-- 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 IF NOT EXISTS auditor_purse_summary
+    ,balance_val INT8 NOT NULL
+    ,balance_frac INT4 NOT NULL
+    ,open_purses INT8 NOT NULL
+    );
+COMMENT ON TABLE auditor_purse_summary
+  IS 'sum of the balances in open purses';
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_purses.sql 
b/src/auditordb/0002-auditor_purses.sql
new file mode 100644
index 00000000..9dd1286f
--- /dev/null
+++ b/src/auditordb/0002-auditor_purses.sql
@@ -0,0 +1,31 @@
+--
+-- 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 IF NOT EXISTS auditor_purses
+(purse_pub BYTEA NOT NULL CHECK(LENGTH(purse_pub)=32)
+    ,balance_val INT8 NOT NULL DEFAULT(0)
+    ,balance_frac INT4 NOT NULL DEFAULT(0)
+    ,target_val INT8 NOT NULL
+    ,target_frac INT4 NOT NULL
+    ,expiration_date INT8 NOT NULL
+    ,auditor_purses_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+    );
+COMMENT ON TABLE auditor_purses
+  IS 'all of the purses and their respective balances that the auditor is 
aware of';
+
+CREATE INDEX IF NOT EXISTS auditor_purses_by_purse_pub
+    ON auditor_purses
+    (purse_pub);
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_reserve_balance.sql 
b/src/auditordb/0002-auditor_reserve_balance.sql
new file mode 100644
index 00000000..8267a3a2
--- /dev/null
+++ b/src/auditordb/0002-auditor_reserve_balance.sql
@@ -0,0 +1,34 @@
+--
+-- 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 IF NOT EXISTS auditor_reserve_balance
+    ,reserve_balance_val INT8 NOT NULL
+    ,reserve_balance_frac INT4 NOT NULL
+    ,reserve_loss_val INT8 NOT NULL
+    ,reserve_loss_frac INT4 NOT NULL
+    ,withdraw_fee_balance_val INT8 NOT NULL
+    ,withdraw_fee_balance_frac INT4 NOT NULL
+    ,close_fee_balance_val INT8 NOT NULL
+    ,close_fee_balance_frac INT4 NOT NULL
+    ,purse_fee_balance_val INT8 NOT NULL
+    ,purse_fee_balance_frac INT4 NOT NULL
+    ,open_fee_balance_val INT8 NOT NULL
+    ,open_fee_balance_frac INT4 NOT NULL
+    ,history_fee_balance_val INT8 NOT NULL
+    ,history_fee_balance_frac INT4 NOT NULL
+    );
+COMMENT ON TABLE auditor_reserve_balance
+  IS 'sum of the balances of all customer reserves';
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_reserves.sql 
b/src/auditordb/0002-auditor_reserves.sql
new file mode 100644
index 00000000..5da886dc
--- /dev/null
+++ b/src/auditordb/0002-auditor_reserves.sql
@@ -0,0 +1,42 @@
+--
+-- 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 IF NOT EXISTS auditor_reserves
+(reserve_pub BYTEA NOT NULL CHECK(LENGTH(reserve_pub)=32)
+    ,reserve_balance_val INT8 NOT NULL
+    ,reserve_balance_frac INT4 NOT NULL
+    ,reserve_loss_val INT8 NOT NULL
+    ,reserve_loss_frac INT4 NOT NULL
+    ,withdraw_fee_balance_val INT8 NOT NULL
+    ,withdraw_fee_balance_frac INT4 NOT NULL
+    ,close_fee_balance_val INT8 NOT NULL
+    ,close_fee_balance_frac INT4 NOT NULL
+    ,purse_fee_balance_val INT8 NOT NULL
+    ,purse_fee_balance_frac INT4 NOT NULL
+    ,open_fee_balance_val INT8 NOT NULL
+    ,open_fee_balance_frac INT4 NOT NULL
+    ,history_fee_balance_val INT8 NOT NULL
+    ,history_fee_balance_frac INT4 NOT NULL
+    ,expiration_date INT8 NOT NULL
+    ,auditor_reserves_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+    ,origin_account TEXT
+    );
+COMMENT ON TABLE auditor_reserves
+  IS 'all of the customer reserves and their respective balances that the 
auditor is aware of';
+
+CREATE INDEX IF NOT EXISTS auditor_reserves_by_reserve_pub
+    ON auditor_reserves
+    (reserve_pub);
\ No newline at end of file
diff --git a/src/auditordb/0002-auditor_wire_fee_balance.sql 
b/src/auditordb/0002-auditor_wire_fee_balance.sql
new file mode 100644
index 00000000..85e5f710
--- /dev/null
+++ b/src/auditordb/0002-auditor_wire_fee_balance.sql
@@ -0,0 +1,22 @@
+--
+-- 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 IF NOT EXISTS auditor_wire_fee_balance
+    ,wire_fee_balance_val INT8 NOT NULL
+    ,wire_fee_balance_frac INT4 NOT NULL
+    );
+COMMENT ON TABLE auditor_wire_fee_balance
+  IS 'sum of the balances of all wire fees';
\ No newline at end of file
diff --git a/src/auditordb/0002-deposit_confirmations.sql 
b/src/auditordb/0002-deposit_confirmations.sql
new file mode 100644
index 00000000..340799cd
--- /dev/null
+++ b/src/auditordb/0002-deposit_confirmations.sql
@@ -0,0 +1,35 @@
+--
+-- 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 IF NOT EXISTS deposit_confirmations
+    ,serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
+    ,h_contract_terms BYTEA NOT NULL CHECK (LENGTH(h_contract_terms)=64)
+    ,h_policy BYTEA NOT NULL CHECK (LENGTH(h_policy)=64)
+    ,h_wire BYTEA NOT NULL CHECK (LENGTH(h_wire)=64)
+    ,exchange_timestamp INT8 NOT NULL
+    ,refund_deadline INT8 NOT NULL
+    ,wire_deadline INT8 NOT NULL
+    ,amount_without_fee_val INT8 NOT NULL
+    ,amount_without_fee_frac INT4 NOT NULL
+    ,coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)
+    ,merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)
+    ,exchange_sig BYTEA NOT NULL CHECK (LENGTH(exchange_sig)=64)
+    ,exchange_pub BYTEA NOT NULL CHECK (LENGTH(exchange_pub)=32)
+    ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
+    ,PRIMARY KEY 
(h_contract_terms,h_wire,coin_pub,merchant_pub,exchange_sig,exchange_pub,master_sig)
+    );
+COMMENT ON TABLE deposit_confirmations
+  IS 'deposit confirmation sent to us by merchants; we must check that the 
exchange reported these properly.';
diff --git a/src/auditordb/0002-wire_auditor_account_progress.sql 
b/src/auditordb/0002-wire_auditor_account_progress.sql
new file mode 100644
index 00000000..9b346a10
--- /dev/null
+++ b/src/auditordb/0002-wire_auditor_account_progress.sql
@@ -0,0 +1,27 @@
+--
+-- 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 IF NOT EXISTS wire_auditor_account_progress
+    ,account_name TEXT NOT NULL
+    ,last_wire_reserve_in_serial_id INT8 NOT NULL DEFAULT 0
+    ,last_wire_wire_out_serial_id INT8 NOT NULL DEFAULT 0
+    ,wire_in_off INT8 NOT NULL
+    ,wire_out_off INT8 NOT NULL
+    ,PRIMARY KEY (account_name)
+    );
+COMMENT ON TABLE wire_auditor_account_progress
+  IS 'information as to which transactions the auditor has processed in the 
exchange database.  Used for SELECTing the
+ statements to process.  The indices include the last serial ID from the 
respective tables that we have processed. Thus, we need to select those table 
entries that are strictly larger (and process in monotonically increasing 
order).';
diff --git a/src/auditordb/0002-wire_auditor_progress.sql 
b/src/auditordb/0002-wire_auditor_progress.sql
new file mode 100644
index 00000000..05887e6c
--- /dev/null
+++ b/src/auditordb/0002-wire_auditor_progress.sql
@@ -0,0 +1,21 @@
+--
+-- 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 IF NOT EXISTS wire_auditor_progress
+    ,last_timestamp INT8 NOT NULL
+    ,last_reserve_close_uuid INT8 NOT NULL
+    --,PRIMARY KEY (master_pub)
+    );
diff --git a/src/auditordb/auditor-0002.sql b/src/auditordb/auditor-0002.sql
new file mode 100644
index 00000000..dcffbd02
--- /dev/null
+++ b/src/auditordb/auditor-0002.sql
@@ -0,0 +1,39 @@
+--
+-- 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/>
+--
+
+-- Everything in one big transaction
+BEGIN;
+
+-- Check patch versioning is in place.
+SELECT _v.register_patch('auditor-0001', NULL, NULL);
+
+
+CREATE SCHEMA auditor;
+COMMENT ON SCHEMA auditor IS 'taler-auditor data';
+
+SET search_path TO auditor;
+
+-- Not needed anymore because no longer multitenant
+/*CREATE TABLE IF NOT EXISTS auditor_exchanges
+  (master_pub BYTEA PRIMARY KEY CHECK (LENGTH(master_pub)=32)
+  ,exchange_url VARCHAR NOT NULL
+  );
+COMMENT ON TABLE auditor_exchanges
+  IS 'list of the exchanges we are auditing';*/
+
+#include "0002-denominations.sql"
+-- Finally, commit everything
+COMMIT;
diff --git a/src/auditordb/auditor-0002.sql.in 
b/src/auditordb/auditor-0002.sql.in
new file mode 100644
index 00000000..d662bbad
--- /dev/null
+++ b/src/auditordb/auditor-0002.sql.in
@@ -0,0 +1,42 @@
+--
+-- 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/>
+--
+
+BEGIN;
+
+SELECT _v.register_patch('auditor-0002', NULL, NULL);
+SET search_path TO auditordb;
+
+#include "0002-auditor_denomination_pending.sql"
+#include "0002-auditor_wire_fee_balance.sql"
+#include "0002-auditor_balance_summary.sql"
+#include "0002-auditor_exchange_signkeys.sql"
+#include "0002-auditor_historic_denomination_revenue.sql"
+#include "0002-auditor_historic_reserve_summary.sql"
+#include "0002-auditor_predicted_result.sql"
+#include "0002-auditor_progress_aggregation.sql"
+#include "0002-auditor_progress_coin.sql"
+#include "0002-auditor_progress_deposit_confirmation.sql"
+#include "0002-auditor_progress_purse.sql"
+#include "0002-auditor_progress_reserve.sql"
+#include "0002-auditor_purse_summary.sql"
+#include "0002-auditor_purses.sql"
+#include "0002-auditor_reserve_balance.sql"
+#include "0002-auditor_reserves.sql"
+#include "0002-deposit_confirmations.sql"
+#include "0002-wire_auditor_account_progress.sql"
+#include "0002-wire_auditor_progress.sql"
+
+COMMIT;
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]