[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: add triggers to populate reserve
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: add triggers to populate reserve history table |
Date: |
Sat, 16 Sep 2023 20:48:28 +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 7045d3df add triggers to populate reserve history table
7045d3df is described below
commit 7045d3df1694d92c98369402adee675238833d6c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Sep 16 20:48:25 2023 +0200
add triggers to populate reserve history table
---
src/exchangedb/0002-close_requests.sql | 39 +++++++++-
src/exchangedb/0002-history_requests.sql | 38 +++++++++-
src/exchangedb/0002-purse_merges.sql | 38 +++++++++-
src/exchangedb/0002-recoup.sql | 20 ++++-
...close_requests.sql => 0002-reserve_history.sql} | 85 +++++++++++-----------
src/exchangedb/0002-reserves_close.sql | 38 +++++++++-
src/exchangedb/0002-reserves_in.sql | 39 +++++++++-
src/exchangedb/0002-reserves_open_requests.sql | 38 +++++++++-
src/exchangedb/0002-reserves_out.sql | 17 ++++-
src/exchangedb/exchange-0002.sql.in | 1 +
src/exchangedb/pg_get_reserve_history.c | 14 ++--
src/exchangedb/test_exchangedb.c | 4 +-
12 files changed, 305 insertions(+), 66 deletions(-)
diff --git a/src/exchangedb/0002-close_requests.sql
b/src/exchangedb/0002-close_requests.sql
index d13822ef..6a702809 100644
--- a/src/exchangedb/0002-close_requests.sql
+++ b/src/exchangedb/0002-close_requests.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 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
@@ -117,6 +117,38 @@ END
$$;
+CREATE OR REPLACE FUNCTION close_requests_insert_trigger()
+ RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ VALUES
+ (NEW.reserve_pub
+ ,'close_requests'
+ ,NEW.close_request_serial_id);
+ RETURN NEW;
+END $$;
+COMMENT ON FUNCTION close_requests_insert_trigger()
+ IS 'Automatically generate reserve history entry.';
+
+
+CREATE FUNCTION master_table_close_requests()
+RETURNS VOID
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ CREATE TRIGGER close_requests_on_insert
+ AFTER INSERT
+ ON close_requests
+ FOR EACH ROW EXECUTE FUNCTION close_requests_insert_trigger();
+END $$;
+
+
+
INSERT INTO exchange_tables
(name
,version
@@ -138,4 +170,9 @@ INSERT INTO exchange_tables
,'exchange-0002'
,'foreign'
,TRUE
+ ,FALSE),
+ ('close_requests'
+ ,'exchange-0002'
+ ,'master'
+ ,TRUE
,FALSE);
diff --git a/src/exchangedb/0002-history_requests.sql
b/src/exchangedb/0002-history_requests.sql
index d6a81c45..0714e1be 100644
--- a/src/exchangedb/0002-history_requests.sql
+++ b/src/exchangedb/0002-history_requests.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 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
@@ -99,6 +99,37 @@ BEGIN
END $$;
+CREATE OR REPLACE FUNCTION history_requests_insert_trigger()
+ RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ VALUES
+ (NEW.reserve_pub
+ ,'history_requests'
+ ,NEW.history_request_serial_id);
+ RETURN NEW;
+END $$;
+COMMENT ON FUNCTION history_requests_insert_trigger()
+ IS 'Automatically generate reserve history entry.';
+
+
+CREATE FUNCTION master_table_history_requests()
+RETURNS VOID
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ CREATE TRIGGER history_requests_on_insert
+ AFTER INSERT
+ ON history_requests
+ FOR EACH ROW EXECUTE FUNCTION history_requests_insert_trigger();
+END $$;
+
+
INSERT INTO exchange_tables
(name
,version
@@ -120,4 +151,9 @@ INSERT INTO exchange_tables
,'exchange-0002'
,'foreign'
,TRUE
+ ,FALSE),
+ ('history_requests'
+ ,'exchange-0002'
+ ,'master'
+ ,TRUE
,FALSE);
diff --git a/src/exchangedb/0002-purse_merges.sql
b/src/exchangedb/0002-purse_merges.sql
index 4f171773..60a2067a 100644
--- a/src/exchangedb/0002-purse_merges.sql
+++ b/src/exchangedb/0002-purse_merges.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 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
@@ -125,6 +125,37 @@ END
$$;
+CREATE OR REPLACE FUNCTION purse_merges_insert_trigger()
+ RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ VALUES
+ (NEW.reserve_pub
+ ,'purse_merges'
+ ,NEW.purse_merge_request_serial_id);
+ RETURN NEW;
+END $$;
+COMMENT ON FUNCTION purse_merges_insert_trigger()
+ IS 'Automatically generate reserve history entry.';
+
+
+CREATE FUNCTION master_table_purse_merges()
+RETURNS VOID
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ CREATE TRIGGER purse_merges_on_insert
+ AFTER INSERT
+ ON purse_merges
+ FOR EACH ROW EXECUTE FUNCTION purse_merges_insert_trigger();
+END $$;
+
+
INSERT INTO exchange_tables
(name
,version
@@ -146,4 +177,9 @@ INSERT INTO exchange_tables
,'exchange-0002'
,'foreign'
,TRUE
+ ,FALSE),
+ ('purse_merges'
+ ,'exchange-0002'
+ ,'master'
+ ,TRUE
,FALSE);
diff --git a/src/exchangedb/0002-recoup.sql b/src/exchangedb/0002-recoup.sql
index 600091b6..4b345249 100644
--- a/src/exchangedb/0002-recoup.sql
+++ b/src/exchangedb/0002-recoup.sql
@@ -165,13 +165,13 @@ CREATE FUNCTION recoup_insert_trigger()
LANGUAGE plpgsql
AS $$
BEGIN
- INSERT INTO exchange.recoup_by_reserve
+ INSERT INTO recoup_by_reserve
(reserve_out_serial_id
,coin_pub)
VALUES
(NEW.reserve_out_serial_id
,NEW.coin_pub);
- INSERT INTO exchange.coin_history
+ INSERT INTO coin_history
(coin_pub
,table_name
,serial_id)
@@ -179,7 +179,19 @@ BEGIN
(NEW.coin_pub
,'recoup'
,NEW.recoup_uuid);
- RETURN NEW;
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ SELECT
+ res.reserve_pub
+ ,'recoup'
+ ,NEW.recoup_uuid
+ FROM reserves_out rout
+ JOIN reserves res
+ USING (reserve_uuid)
+ WHERE rout.reserve_out_serial_id = NEW.reserve_out_serial_id;
+ RETURN NEW;
END $$;
COMMENT ON FUNCTION recoup_insert_trigger()
IS 'Replicates recoup inserts into recoup_by_reserve table and updates the
coin_history table.';
@@ -190,7 +202,7 @@ CREATE FUNCTION recoup_delete_trigger()
LANGUAGE plpgsql
AS $$
BEGIN
- DELETE FROM exchange.recoup_by_reserve
+ DELETE FROM recoup_by_reserve
WHERE reserve_out_serial_id = OLD.reserve_out_serial_id
AND coin_pub = OLD.coin_pub;
RETURN OLD;
diff --git a/src/exchangedb/0002-close_requests.sql
b/src/exchangedb/0002-reserve_history.sql
similarity index 54%
copy from src/exchangedb/0002-close_requests.sql
copy to src/exchangedb/0002-reserve_history.sql
index d13822ef..b0c76430 100644
--- a/src/exchangedb/0002-close_requests.sql
+++ b/src/exchangedb/0002-reserve_history.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2023 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
@@ -14,109 +14,105 @@
-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
--
-CREATE FUNCTION create_table_close_requests(
+CREATE FUNCTION create_table_reserve_history (
IN partition_suffix TEXT DEFAULT NULL
)
RETURNS VOID
LANGUAGE plpgsql
AS $$
DECLARE
- table_name TEXT DEFAULT 'close_requests';
+ table_name TEXT DEFAULT 'reserve_history';
BEGIN
PERFORM create_partitioned_table(
- 'CREATE TABLE %I '
- '(close_request_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY'
+ 'CREATE TABLE %I'
+ '(reserve_history_serial_id INT8 GENERATED BY DEFAULT AS IDENTITY'
',reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32)'
- ',close_timestamp INT8 NOT NULL'
- ',reserve_sig BYTEA NOT NULL CHECK (LENGTH(reserve_sig)=64)'
- ',close taler_amount NOT NULL'
- ',close_fee taler_amount NOT NULL'
- ',payto_uri TEXT NOT NULL'
- ',done BOOL NOT NULL DEFAULT(FALSE)'
- ',PRIMARY KEY (reserve_pub,close_timestamp)'
+ ',table_name TEXT NOT NULL'
+ ',serial_id INT8 NOT NULL'
') %s ;'
,table_name
,'PARTITION BY HASH (reserve_pub)'
,partition_suffix
);
PERFORM comment_partitioned_table(
- 'Explicit requests by a reserve owner to close a reserve immediately'
+ 'Links to tables with entries that affected the transaction history of a
reserve.'
,table_name
,partition_suffix
);
PERFORM comment_partitioned_column(
- 'When the request was created by the client'
- ,'close_timestamp'
+ 'For which reserve is this a history entry'
+ ,'reserve_pub'
,table_name
,partition_suffix
);
PERFORM comment_partitioned_column(
- 'Signature affirming that the reserve is to be closed'
- ,'reserve_sig'
+ 'In which table is the history entry'
+ ,'table_name'
,table_name
,partition_suffix
);
PERFORM comment_partitioned_column(
- 'Balance of the reserve at the time of closing, to be wired to the
associated bank account (minus the closing fee)'
- ,'close'
+ 'Which is the generated serial ID of the entry in the table'
+ ,'serial_id'
,table_name
,partition_suffix
);
PERFORM comment_partitioned_column(
- 'Identifies the credited bank account. Optional.'
- ,'payto_uri'
+ 'Monotonic counter, used to generate Etags for caching'
+ ,'reserve_history_serial_id'
,table_name
,partition_suffix
);
-END $$;
+END
+$$;
-CREATE FUNCTION constrain_table_close_requests(
+CREATE FUNCTION constrain_table_reserve_history(
IN partition_suffix TEXT
)
-RETURNS VOID
+RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
- table_name TEXT DEFAULT 'close_requests';
+ table_name TEXT DEFAULT 'reserve_history';
BEGIN
table_name = concat_ws('_', table_name, partition_suffix);
EXECUTE FORMAT (
- 'CREATE INDEX ' || table_name || '_by_close_request_uuid_index '
- 'ON ' || table_name || ' '
- '(close_request_serial_id);'
- );
- EXECUTE FORMAT (
- 'CREATE INDEX ' || table_name || '_by_close_request_done_index '
- 'ON ' || table_name || ' '
- '(done);'
+ 'ALTER TABLE ' || table_name ||
+ ' ADD CONSTRAINT ' || table_name || '_reserve_history_serial_id_pkey'
+ ' PRIMARY KEY (reserve_history_serial_id) '
+ ',ADD CONSTRAINT ' || table_name || '_reserve_entry_key'
+ ' UNIQUE (reserve_pub, table_name, serial_id)'
);
EXECUTE FORMAT (
- 'ALTER TABLE ' || table_name ||
- ' ADD CONSTRAINT ' || table_name || '_close_request_uuid_pkey'
- ' UNIQUE (close_request_serial_id)'
+ 'CREATE INDEX ' || table_name || '_reserve_by_time'
+ ' ON ' || table_name || ' '
+ '(reserve_pub'
+ ',reserve_history_serial_id DESC'
+ ');'
);
END
$$;
-CREATE FUNCTION foreign_table_close_requests()
-RETURNS VOID
+CREATE FUNCTION foreign_table_reserve_history()
+RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
- table_name TEXT DEFAULT 'close_requests';
+ table_name TEXT DEFAULT 'reserve_history';
BEGIN
EXECUTE FORMAT (
'ALTER TABLE ' || table_name ||
' ADD CONSTRAINT ' || table_name || '_foreign_reserve_pub'
' FOREIGN KEY (reserve_pub) '
- ' REFERENCES reserves(reserve_pub) ON DELETE CASCADE'
+ ' REFERENCES reserves (reserve_pub) ON DELETE CASCADE'
);
END
$$;
+
INSERT INTO exchange_tables
(name
,version
@@ -124,18 +120,19 @@ INSERT INTO exchange_tables
,partitioned
,by_range)
VALUES
- ('close_requests'
+ ('reserve_history'
,'exchange-0002'
,'create'
,TRUE
,FALSE),
- ('close_requests'
+ ('reserve_history'
,'exchange-0002'
,'constrain'
,TRUE
,FALSE),
- ('close_requests'
+ ('reserve_history'
,'exchange-0002'
,'foreign'
,TRUE
- ,FALSE);
+ ,FALSE)
+ ;
diff --git a/src/exchangedb/0002-reserves_close.sql
b/src/exchangedb/0002-reserves_close.sql
index 2db4e5cc..16669768 100644
--- a/src/exchangedb/0002-reserves_close.sql
+++ b/src/exchangedb/0002-reserves_close.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 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
@@ -91,6 +91,37 @@ BEGIN
END $$;
+CREATE OR REPLACE FUNCTION reserves_close_insert_trigger()
+ RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ VALUES
+ (NEW.reserve_pub
+ ,'reserves_close'
+ ,NEW.close_uuid);
+ RETURN NEW;
+END $$;
+COMMENT ON FUNCTION reserves_close_insert_trigger()
+ IS 'Automatically generate reserve history entry.';
+
+
+CREATE FUNCTION master_table_reserves_close()
+RETURNS VOID
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ CREATE TRIGGER reserves_close_on_insert
+ AFTER INSERT
+ ON reserves_close
+ FOR EACH ROW EXECUTE FUNCTION reserves_close_insert_trigger();
+END $$;
+
+
INSERT INTO exchange_tables
(name
,version
@@ -112,4 +143,9 @@ INSERT INTO exchange_tables
,'exchange-0002'
,'foreign'
,TRUE
+ ,FALSE),
+ ('reserves_close'
+ ,'exchange-0002'
+ ,'master'
+ ,TRUE
,FALSE);
diff --git a/src/exchangedb/0002-reserves_in.sql
b/src/exchangedb/0002-reserves_in.sql
index 7fc2811d..1dfc5db6 100644
--- a/src/exchangedb/0002-reserves_in.sql
+++ b/src/exchangedb/0002-reserves_in.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 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
@@ -118,6 +118,38 @@ BEGIN
END $$;
+
+CREATE OR REPLACE FUNCTION reserves_in_insert_trigger()
+ RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ VALUES
+ (NEW.reserve_pub
+ ,'reserves_in'
+ ,NEW.reserve_in_serial_id);
+ RETURN NEW;
+END $$;
+COMMENT ON FUNCTION reserves_in_insert_trigger()
+ IS 'Automatically generate reserve history entry.';
+
+
+CREATE FUNCTION master_table_reserves_in()
+RETURNS VOID
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ CREATE TRIGGER reserves_in_on_insert
+ AFTER INSERT
+ ON reserves_in
+ FOR EACH ROW EXECUTE FUNCTION reserves_in_insert_trigger();
+END $$;
+
+
INSERT INTO exchange_tables
(name
,version
@@ -139,4 +171,9 @@ INSERT INTO exchange_tables
,'exchange-0002'
,'foreign'
,TRUE
+ ,FALSE),
+ ('reserves_in'
+ ,'exchange-0002'
+ ,'master'
+ ,TRUE
,FALSE);
diff --git a/src/exchangedb/0002-reserves_open_requests.sql
b/src/exchangedb/0002-reserves_open_requests.sql
index c8f9c22e..b51168dc 100644
--- a/src/exchangedb/0002-reserves_open_requests.sql
+++ b/src/exchangedb/0002-reserves_open_requests.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 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
@@ -90,6 +90,37 @@ END
$$;
+CREATE OR REPLACE FUNCTION reserves_open_requests_insert_trigger()
+ RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ VALUES
+ (NEW.reserve_pub
+ ,'reserves_open_requests'
+ ,NEW.open_request_uuid);
+ RETURN NEW;
+END $$;
+COMMENT ON FUNCTION reserves_open_requests_insert_trigger()
+ IS 'Automatically generate reserve history entry.';
+
+
+CREATE FUNCTION master_table_reserves_open_requests()
+RETURNS VOID
+LANGUAGE plpgsql
+AS $$
+BEGIN
+ CREATE TRIGGER reserves_open_requests_on_insert
+ AFTER INSERT
+ ON reserves_open_requests
+ FOR EACH ROW EXECUTE FUNCTION reserves_open_requests_insert_trigger();
+END $$;
+
+
INSERT INTO exchange_tables
(name
,version
@@ -111,4 +142,9 @@ INSERT INTO exchange_tables
,'exchange-0002'
,'foreign'
,TRUE
+ ,FALSE),
+ ('reserves_open_requests'
+ ,'exchange-0002'
+ ,'master'
+ ,TRUE
,FALSE);
diff --git a/src/exchangedb/0002-reserves_out.sql
b/src/exchangedb/0002-reserves_out.sql
index 7c5cf554..1e403895 100644
--- a/src/exchangedb/0002-reserves_out.sql
+++ b/src/exchangedb/0002-reserves_out.sql
@@ -1,6 +1,6 @@
--
-- This file is part of TALER
--- Copyright (C) 2014--2022 Taler Systems SA
+-- Copyright (C) 2014--2023 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
@@ -157,12 +157,23 @@ CREATE FUNCTION reserves_out_by_reserve_insert_trigger()
LANGUAGE plpgsql
AS $$
BEGIN
- INSERT INTO exchange.reserves_out_by_reserve
+ INSERT INTO reserves_out_by_reserve
(reserve_uuid
,h_blind_ev)
VALUES
(NEW.reserve_uuid
,NEW.h_blind_ev);
+ INSERT INTO reserve_history
+ (reserve_pub
+ ,table_name
+ ,serial_id)
+ SELECT
+ res.reserve_pub
+ ,'reserves_out'
+ ,NEW.reserve_out_serial_id
+ FROM
+ reserves res
+ WHERE res.reserve_uuid = NEW.reserve_uuid;
RETURN NEW;
END $$;
COMMENT ON FUNCTION reserves_out_by_reserve_insert_trigger()
@@ -174,7 +185,7 @@ CREATE FUNCTION reserves_out_by_reserve_delete_trigger()
LANGUAGE plpgsql
AS $$
BEGIN
- DELETE FROM exchange.reserves_out_by_reserve
+ DELETE FROM reserves_out_by_reserve
WHERE reserve_uuid = OLD.reserve_uuid;
RETURN OLD;
END $$;
diff --git a/src/exchangedb/exchange-0002.sql.in
b/src/exchangedb/exchange-0002.sql.in
index 6e0d5ae5..e209d550 100644
--- a/src/exchangedb/exchange-0002.sql.in
+++ b/src/exchangedb/exchange-0002.sql.in
@@ -63,6 +63,7 @@ COMMENT ON TYPE
exchange_do_select_deposits_missing_wire_return_type
#include "0002-legitimization_processes.sql"
#include "0002-legitimization_requirements.sql"
#include "0002-reserves.sql"
+#include "0002-reserve_history.sql"
#include "0002-reserves_in.sql"
#include "0002-reserves_close.sql"
#include "0002-close_requests.sql"
diff --git a/src/exchangedb/pg_get_reserve_history.c
b/src/exchangedb/pg_get_reserve_history.c
index 86a33946..c0cb08f5 100644
--- a/src/exchangedb/pg_get_reserve_history.c
+++ b/src/exchangedb/pg_get_reserve_history.c
@@ -648,7 +648,7 @@ TEH_PG_get_reserve_history (void *cls,
GNUNET_PQ_query_param_end
};
- PREPARE (pg,
+ PREPARE (pg, // done
"reserves_in_get_transactions",
/*
"SELECT"
@@ -677,7 +677,7 @@ TEH_PG_get_reserve_history (void *cls,
"WHERE wire_target_h_payto = ( "
" SELECT wire_source_h_payto FROM ri "
"); ");
- PREPARE (pg,
+ PREPARE (pg, // DONE
"get_reserves_out",
/*
"SELECT"
@@ -718,7 +718,7 @@ TEH_PG_get_reserve_history (void *cls,
" ON (ro.h_blind_ev = robr.h_blind_ev)"
" JOIN denominations denom"
" ON (ro.denominations_serial = denom.denominations_serial);");
- PREPARE (pg,
+ PREPARE (pg, // DONE
"recoup_by_reserve",
/*
"SELECT"
@@ -767,7 +767,7 @@ TEH_PG_get_reserve_history (void *cls,
" JOIN wire_targets"
" USING (wire_target_h_payto)"
" WHERE reserve_pub=$1;");
- PREPARE (pg,
+ PREPARE (pg, // DONE
"merge_by_reserve",
"SELECT"
" pr.amount_with_fee"
@@ -792,7 +792,7 @@ TEH_PG_get_reserve_history (void *cls,
" WHERE pm.reserve_pub=$1"
" AND COALESCE(pm.partner_serial_id,0)=0" /* must be local! */
" AND NOT COALESCE (pdes.refunded, FALSE);");
- PREPARE (pg,
+ PREPARE (pg, // done
"history_by_reserve",
"SELECT"
" history_fee"
@@ -800,7 +800,7 @@ TEH_PG_get_reserve_history (void *cls,
",reserve_sig"
" FROM history_requests"
" WHERE reserve_pub=$1;");
- PREPARE (pg,
+ PREPARE (pg, // done
"open_request_by_reserve",
"SELECT"
" reserve_payment"
@@ -810,7 +810,7 @@ TEH_PG_get_reserve_history (void *cls,
",reserve_sig"
" FROM reserves_open_requests"
" WHERE reserve_pub=$1;");
- PREPARE (pg,
+ PREPARE (pg, // done
"close_request_by_reserve",
"SELECT"
" close_timestamp"
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 90c539a9..56925acf 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -33,9 +33,9 @@ static int result;
/**
* Report line of error if @a cond is true, and jump to label "drop".
*/
-#define FAILIF(cond) \
+#define FAILIF(cond) \
do { \
- if (! (cond)) { break;} \
+ if (! (cond)) { break;} \
GNUNET_break (0); \
goto drop; \
} while (0)
--
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 triggers to populate reserve history table,
gnunet <=