[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] branch master updated (736927f0 -> e43b679
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] branch master updated (736927f0 -> e43b6793) |
Date: |
Tue, 03 Sep 2019 04:29:51 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a change to branch master
in repository exchange.
from 736927f0 another test, more fixes in auditor-report template
new d2b85341 auditor needs serial IDs in coin history
new 961793ec note where table is tested
new 380bf67d generate with fast deposits in the future
new 05b92c24 check h_wire/wire consistency
new e43b6793 expand test suite, minor style improvements
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
contrib/auditor-report.tex.j2 | 6 +-
src/auditor/taler-auditor.c | 22 +++
src/auditor/test-auditor.sh | 206 ++++++++++++++++++++++++----
src/benchmark/generate-auditor-basedb.conf | 4 +-
src/exchangedb/plugin_exchangedb_postgres.c | 36 ++++-
src/include/taler_exchangedb_plugin.h | 5 +
6 files changed, 247 insertions(+), 32 deletions(-)
diff --git a/contrib/auditor-report.tex.j2 b/contrib/auditor-report.tex.j2
index 2216d8d0..5a423592 100644
--- a/contrib/auditor-report.tex.j2
+++ b/contrib/auditor-report.tex.j2
@@ -443,10 +443,12 @@ the (hash of the) denomination public key for
``payback-verify'' and ``deposit-verify'' operations, and the master
public key for ``payback-master'' operations.
+% Table generation tested by testcase #4/#5 in test-auditor.sh
+
{% if data.bad_sig_losses|length() == 0 %}
{\bf All signatures were valid.}
{% else %}
- \begin{longtable}{c|r|r}
+ \begin{longtable}{l|r|r}
\multicolumn{3}{l}{ {\bf Public key} }\\
{\bf Operation type} & Database row & {\bf Loss amount} \\
\hline \hline
@@ -459,7 +461,7 @@ public key for ``payback-master'' operations.
{\bf Operation type} & Database row & {\bf Loss amount} \\
\endfoot
\hline
- {\bf Total losses} & &
+ \multicolumn{2}{l}{ {\bf Total losses} } &
{\bf {{ data.total_bad_sig_loss}} } \\
\caption{Losses from operations performed on coins without proper
signatures.}
\label{table:bad_signature_losses}
diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 9ef8871e..ca421cd8 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -2071,6 +2071,28 @@ check_transaction_history_for_deposit (const struct
switch (tl->type)
{
case TALER_EXCHANGEDB_TT_DEPOSIT:
+ /* check wire and h_wire are consistent */
+ {
+ struct GNUNET_HashCode hw;
+
+ if (GNUNET_OK !=
+ TALER_JSON_merchant_wire_signature_hash (
+ tl->details.deposit->receiver_wire_account,
+ &hw))
+ {
+ report_row_inconsistency ("deposits",
+ tl->serial_id,
+ "wire value malformed");
+ }
+ else if (0 !=
+ GNUNET_memcmp (&hw,
+ &tl->details.deposit->h_wire))
+ {
+ report_row_inconsistency ("deposits",
+ tl->serial_id,
+ "h_wire does not match wire");
+ }
+ }
amount_with_fee = &tl->details.deposit->amount_with_fee;
fee = &tl->details.deposit->deposit_fee;
fee_dki = &dki->properties.fee_deposit;
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index 8122307c..b46301e8 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -9,7 +9,7 @@ set -eu
# Set of numbers for all the testcases.
# When adding new tests, increase the last number:
-ALL_TESTS=`seq 1 4`
+ALL_TESTS=`seq 0 4`
# $TESTS determines which tests we should run.
# This construction is used to make it easy to
@@ -37,7 +37,9 @@ function exit_fail() {
}
# Run audit process on current database, including report
-# generation.
+# generation. Pass "aggregator" as $1 to run
+# $ taler-exchange-aggregator
+# before auditor (to trigger pending wire transfers).
function run_audit () {
# Launch bank
echo "Launching bank"
@@ -50,14 +52,20 @@ function run_audit () {
done
echo "OK"
+ if test ${1:-no} = "aggregator"
+ then
+ echo "Running exchange aggregator"
+ taler-exchange-aggregator -t -c test-auditor.conf
+ fi
+
# Run the auditor!
echo "Running audit(s)"
- taler-auditor -r -c test-auditor.conf -m $MASTER_PUB > test-audit.json ||
exit_fail "auditor failed"
+ taler-auditor -r -c test-auditor.conf -m $MASTER_PUB > test-audit.json 2>
test-audit.log || exit_fail "auditor failed"
- taler-wire-auditor -r -c test-auditor.conf -m $MASTER_PUB >
test-wire-audit.json || exit_fail "wire auditor failed"
+ taler-wire-auditor -r -c test-auditor.conf -m $MASTER_PUB >
test-wire-audit.json 2> test-wire-audit.log || exit_fail "wire auditor failed"
echo "Shutting down services"
- kill `jobs -p`
+ kill `jobs -p` || true
echo "TeXing"
../../contrib/render.py test-audit.json test-wire-audit.json <
../../contrib/auditor-report.tex.j2 > test-report.tex || exit_fail "Renderer
failed"
@@ -67,24 +75,79 @@ function run_audit () {
}
-# test required commands exist
-echo "Testing for jq"
-jq -h > /dev/null || exit_skip "jq required"
-echo "Testing for taler-bank-manage"
-taler-bank-manage -h >/dev/null </dev/null || exit_skip "taler-bank-manage
required"
-echo "Testing for pdflatex"
-which pdflatex > /dev/null </dev/null || exit_skip "pdflatex required"
+# Do a full reload of the (original) database
+full_reload()
+{
+ dropdb $DB 2> /dev/null || true
+ createdb -T template0 $DB || exit_skip "could not create database"
+ # Import pre-generated database, -q(ietly) using single (-1) transaction
+ psql -Aqt $DB -q -1 -f ../benchmark/auditor-basedb.sql > /dev/null
+}
-echo "Database setup"
-DB=taler-auditor-test
-dropdb $DB 2> /dev/null || true
-createdb -T template0 $DB || exit_skip "could not create database"
-# Import pre-generated database, -q(ietly) using single (-1) transaction
-psql $DB -q -1 -f ../benchmark/auditor-basedb.sql > /dev/null
-MASTER_PUB=`cat ../benchmark/auditor-basedb.mpub`
+test_0() {
+
+echo "===========0: normal run with aggregator==========="
+run_audit aggregator
+
+echo "Checking output"
+# if an emergency was detected, that is a bug and we should fail
+echo -n "Test for emergencies... "
+jq -e .emergencies[0] < test-audit.json > /dev/null && exit_fail "Unexpected
emergency detected in ordinary run" || echo OK
+
+jq -e .emergencies_by_count[0] < test-audit.json > /dev/null && exit_fail
"Unexpected emergency by count detected in ordinary run" || echo OK
+
+echo -n "Test for wire inconsistencies... "
+jq -e .wire_out_amount_inconsistencies[0] < test-wire-audit.json > /dev/null
&& exit_fail "Unexpected wire out inconsistency detected in ordinary run"
+jq -e .reserve_in_amount_inconsistencies[0] < test-wire-audit.json > /dev/null
&& exit_fail "Unexpected reserve in inconsistency detected in ordinary run"
+jq -e .missattribution_inconsistencies[0] < test-wire-audit.json > /dev/null
&& exit_fail "Unexpected missattribution inconsistency detected in ordinary run"
+jq -e .row_inconsistencies[0] < test-wire-audit.json > /dev/null && exit_fail
"Unexpected row inconsistency detected in ordinary run"
+jq -e .row_minor_inconsistencies[0] < test-wire-audit.json > /dev/null &&
exit_fail "Unexpected minor row inconsistency detected in ordinary run"
+jq -e .lag_details[0] < test-wire-audit.json > /dev/null && exit_fail
"Unexpected lag detected in ordinary run"
+jq -e .wire_format_inconsistencies[0] < test-wire-audit.json > /dev/null &&
exit_fail "Unexpected wire format inconsistencies detected in ordinary run"
+
+# FIXME: check operation balances are correct (once we have more transaction
types)
+# FIXME: check revenue summaries are correct (once we have more transaction
types)
+
+echo OK
+
+echo -n "Test for wire amounts... "
+WIRED=`jq -r .total_wire_in_delta_plus < test-wire-audit.json`
+if test $WIRED != "TESTKUDOS:0"
+then
+ exit_fail "Expected total wire delta plus wrong, got $WIRED"
+fi
+WIRED=`jq -r .total_wire_in_delta_minus < test-wire-audit.json`
+if test $WIRED != "TESTKUDOS:0"
+then
+ exit_fail "Expected total wire delta minus wrong, got $WIRED"
+fi
+WIRED=`jq -r .total_wire_out_delta_plus < test-wire-audit.json`
+if test $WIRED != "TESTKUDOS:0"
+then
+ exit_fail "Expected total wire delta plus wrong, got $WIRED"
+fi
+WIRED=`jq -r .total_wire_out_delta_minus < test-wire-audit.json`
+if test $WIRED != "TESTKUDOS:0"
+then
+ exit_fail "Expected total wire delta minus wrong, got $WIRED"
+fi
+WIRED=`jq -r .total_missattribution_in < test-wire-audit.json`
+if test $WIRED != "TESTKUDOS:0"
+then
+ exit_fail "Expected total missattribution in wrong, got $WIRED"
+fi
+# FIXME: check NO lag reported
+# cannot easily undo aggregator, hence full reload
+full_reload
+echo "OK"
+}
+
+
+# Run without aggregator, hence auditor should detect wire
+# transfer lag!
test_1() {
echo "===========1: normal run==========="
@@ -111,6 +174,8 @@ jq -e .wire_format_inconsistencies[0] <
test-wire-audit.json > /dev/null && exit
echo OK
+# FIXME: check wire transfer lag reported (no aggregator!)
+
echo -n "Test for wire amounts... "
WIRED=`jq -r .total_wire_in_delta_plus < test-wire-audit.json`
if test $WIRED != "TESTKUDOS:0"
@@ -137,14 +202,16 @@ if test $WIRED != "TESTKUDOS:0"
then
exit_fail "Expected total missattribution in wrong, got $WIRED"
fi
+# Database was unmodified, no need to undo
echo "OK"
}
+# Change amount of wire transfer reported by exchange
test_2() {
echo "===========2: reserves_in inconsitency==========="
-echo "UPDATE reserves_in SET credit_val=5 WHERE reserve_in_serial_id=1" | psql
$DB
+echo "UPDATE reserves_in SET credit_val=5 WHERE reserve_in_serial_id=1" | psql
-Aqt $DB
run_audit
@@ -178,7 +245,7 @@ fi
echo OK
# Undo database modification
-echo "UPDATE reserves_in SET credit_val=10 WHERE reserve_in_serial_id=1" |
psql $DB
+echo "UPDATE reserves_in SET credit_val=10 WHERE reserve_in_serial_id=1" |
psql -Aqt $DB
}
@@ -188,7 +255,7 @@ echo "UPDATE reserves_in SET credit_val=10 WHERE
reserve_in_serial_id=1" | psql
test_3() {
echo "===========3: reserves_in inconsitency==========="
-echo "UPDATE reserves_in SET credit_val=15 WHERE reserve_in_serial_id=1" |
psql $DB
+echo "UPDATE reserves_in SET credit_val=15 WHERE reserve_in_serial_id=1" |
psql -Aqt $DB
run_audit
@@ -241,7 +308,7 @@ then
fi
# Undo database modification
-echo "UPDATE reserves_in SET credit_val=10 WHERE reserve_in_serial_id=1" |
psql $DB
+echo "UPDATE reserves_in SET credit_val=10 WHERE reserve_in_serial_id=1" |
psql -Aqt $DB
}
@@ -252,7 +319,7 @@ test_4() {
echo "===========4: deposit wire target wrong================="
# Original target bank account was 43, changing to 44
-echo "UPDATE deposits SET
wire='{\"url\":\"payto://x-taler-bank/localhost:8082/44\",\"salt\":\"test-salt
(must be constant for aggregation tests)\"}' WHERE deposit_serial_id=1" | psql
$DB
+echo "UPDATE deposits SET
wire='{\"url\":\"payto://x-taler-bank/localhost:8082/44\",\"salt\":\"test-salt
(must be constant for aggregation tests)\"}' WHERE deposit_serial_id=1" | psql
-Aqt $DB
run_audit
@@ -281,16 +348,102 @@ then
fi
# Undo:
-echo "UPDATE deposits SET
wire='{\"url\":\"payto://x-taler-bank/localhost:8082/43\",\"salt\":\"test-salt
(must be constant for aggregation tests)\"}' WHERE deposit_serial_id=1" | psql
$DB
+echo "UPDATE deposits SET
wire='{\"url\":\"payto://x-taler-bank/localhost:8082/43\",\"salt\":\"test-salt
(must be constant for aggregation tests)\"}' WHERE deposit_serial_id=1" | psql
-Aqt $DB
}
+# Test where h_contract_terms in the deposit table is wrong
+# (=> bad signature)
+test_5() {
+echo "===========5: deposit contract hash wrong================="
+# Modify h_wire hash, so it is inconsistent with 'wire'
+OLD_H=`echo 'SELECT h_contract_terms FROM deposits WHERE deposit_serial_id=1;'
| psql taler-auditor-test -Aqt`
+echo "UPDATE deposits SET
h_contract_terms='\x12bb676444955c98789f219148aa31899d8c354a63330624d3d143222cf3bb8b8e16f69accd5a8773127059b804c1955696bf551dd7be62719870613332aa8d5'
WHERE deposit_serial_id=1" | psql -Aqt $DB
+
+run_audit
+
+ROW=`jq -e .bad_sig_losses[0].row < test-audit.json`
+if test $ROW != 1
+then
+ exit_fail "Row wrong, got $ROW"
+fi
+
+LOSS=`jq -r .bad_sig_losses[0].loss < test-audit.json`
+if test $LOSS != "TESTKUDOS:0.1"
+then
+ exit_fail "Wrong deposit bad signature loss, got $LOSS"
+fi
+
+OP=`jq -r .bad_sig_losses[0].operation < test-audit.json`
+if test $OP != "deposit"
+then
+ exit_fail "Wrong operation, got $OP"
+fi
+
+LOSS=`jq -r .total_bad_sig_loss < test-audit.json`
+if test $LOSS != "TESTKUDOS:0.1"
+then
+ exit_fail "Wrong total bad sig loss, got $LOSS"
+fi
+# Undo:
+echo "UPDATE deposits SET h_contract_terms='${OLD_H}' WHERE
deposit_serial_id=1" | psql -Aqt $DB
+}
+
+
+
+
+# Test where h_wire in the deposit table is wrong
+test_99() {
+echo "===========99: deposit wire hash wrong================="
+# Modify h_wire hash, so it is inconsistent with 'wire'
+echo "UPDATE deposits SET
h_wire='\x973e52d193a357940be9ef2939c19b0575ee1101f52188c3c01d9005b7d755c397e92624f09cfa709104b3b65605fe5130c90d7e1b7ee30f8fc570f39c16b853'
WHERE deposit_serial_id=1" | psql -Aqt $DB
+
+# The auditor checks h_wire consistency only for
+# coins where the wire transfer has happened, hence
+# run aggregator first to get this test to work.
+#
+# FIXME: current test database has transfers still
+# in the *distant* future, test cannot yet work.
+# patch up once DB was re-generated!
+run_audit aggregator
+
+# FIXME: check for the respective inconsistency in the report!
+
+# Undo:
+# echo "UPDATE deposits SET
h_wire='\x973e52d193a357940be9ef2939c19b0575ee1101f52188c3c01d9005b7d755c397e92624f09cfa709104b3b65605fe5130c90d7e1b7ee30f8fc570f39c16b852'
WHERE deposit_serial_id=1" | psql -Aqt $DB
+
+}
+
+
+
+
+# **************************************************
# Add more tests here! :-)
+# **************************************************
+
+
+# *************** Main logic starts here **************
+
+# Setup globals
+DB=taler-auditor-test
+MASTER_PUB=`cat ../benchmark/auditor-basedb.mpub`
+
+# test required commands exist
+echo "Testing for jq"
+jq -h > /dev/null || exit_skip "jq required"
+echo "Testing for taler-bank-manage"
+taler-bank-manage -h >/dev/null </dev/null || exit_skip "taler-bank-manage
required"
+echo "Testing for pdflatex"
+which pdflatex > /dev/null </dev/null || exit_skip "pdflatex required"
+
+echo "Database setup"
+full_reload
+# Run test suite
fail=0
for i in $TESTS
do
@@ -303,6 +456,7 @@ done
echo "Cleanup"
-#$ dropdb $DB
+# dropdb $DB
+# rm -f test-audit.log test-wire-audit.log
exit $fail
diff --git a/src/benchmark/generate-auditor-basedb.conf
b/src/benchmark/generate-auditor-basedb.conf
index f33cdc72..ccdad552 100644
--- a/src/benchmark/generate-auditor-basedb.conf
+++ b/src/benchmark/generate-auditor-basedb.conf
@@ -22,7 +22,9 @@ UNIXPATH_MODE = 660
DEFAULT_WIRE_FEE_AMORTIZATION = 1
DB = postgres
WIREFORMAT = default
-WIRE_TRANSFER_DELAY = 3 week
+# Set very low, so we can be sure that the database generated
+# will contain wire transfers "ready" for the aggregator.
+WIRE_TRANSFER_DELAY = 1 minute
DEFAULT_PAY_DEADLINE = 1 day
DEFAULT_MAX_DEPOSIT_FEE = TESTKUDOS:0.1
KEYFILE = ${TALER_DATA_HOME}/merchant/merchant.priv
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c
b/src/exchangedb/plugin_exchangedb_postgres.c
index 54f18da9..6b5790c7 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -937,6 +937,7 @@ postgres_prepare (PGconn *db_conn)
",amount_with_fee_frac"
",denom.fee_refresh_val "
",denom.fee_refresh_frac "
+ ",melt_serial_id"
" FROM refresh_commitments"
" JOIN known_coins "
" ON (refresh_commitments.old_coin_pub =
known_coins.coin_pub)"
@@ -1020,6 +1021,7 @@ postgres_prepare (PGconn *db_conn)
",amount_with_fee_frac"
",denom.fee_refund_val "
",denom.fee_refund_frac "
+ ",refund_serial_id"
" FROM refunds"
" JOIN known_coins USING (coin_pub)"
" JOIN denominations denom USING
(denom_pub_hash)"
@@ -1168,9 +1170,9 @@ postgres_prepare (PGconn *db_conn)
" JOIN denominations denom"
" USING (denom_pub_hash)"
" WHERE"
- " merchant_pub=$1 AND"
- " h_wire=$2 AND"
- " done=FALSE"
+ " merchant_pub=$1 AND"
+ " h_wire=$2 AND"
+ " done=FALSE"
" ORDER BY wire_deadline ASC"
" LIMIT "
TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT_STR ";",
@@ -1212,6 +1214,7 @@ postgres_prepare (PGconn *db_conn)
",h_wire"
",wire"
",coin_sig"
+ ",deposit_serial_id"
" FROM deposits"
" JOIN known_coins"
" USING (coin_pub)"
@@ -1547,6 +1550,7 @@ postgres_prepare (PGconn *db_conn)
",timestamp"
",coins.denom_pub_hash"
",coins.denom_sig"
+ ",payback_refresh_uuid"
" FROM payback_refresh"
" JOIN known_coins coins"
" USING (coin_pub)"
@@ -1599,6 +1603,7 @@ postgres_prepare (PGconn *db_conn)
",timestamp"
",coins.denom_pub_hash"
",coins.denom_sig"
+ ",payback_uuid"
" FROM payback"
" JOIN known_coins coins"
" USING (coin_pub)"
@@ -1619,6 +1624,7 @@ postgres_prepare (PGconn *db_conn)
",timestamp"
",coins.denom_pub_hash"
",coins.denom_sig"
+ ",payback_refresh_uuid"
" FROM payback_refresh"
" JOIN refresh_revealed_coins rrc"
" ON (rrc.coin_ev = h_blind_ev)"
@@ -4352,6 +4358,7 @@ add_coin_deposit (void *cls,
struct TALER_EXCHANGEDB_Deposit *deposit;
struct TALER_EXCHANGEDB_TransactionList *tl;
enum GNUNET_DB_QueryStatus qs;
+ uint64_t serial_id;
deposit = GNUNET_new (struct TALER_EXCHANGEDB_Deposit);
{
@@ -4376,6 +4383,8 @@ add_coin_deposit (void *cls,
&deposit->receiver_wire_account),
GNUNET_PQ_result_spec_auto_from_type ("coin_sig",
&deposit->csig),
+ GNUNET_PQ_result_spec_uint64 ("deposit_serial_id",
+ &serial_id),
GNUNET_PQ_result_spec_end
};
@@ -4395,6 +4404,7 @@ add_coin_deposit (void *cls,
tl->next = chc->head;
tl->type = TALER_EXCHANGEDB_TT_DEPOSIT;
tl->details.deposit = deposit;
+ tl->serial_id = serial_id;
qs = postgres_get_known_coin (chc->db_cls,
chc->session,
chc->coin_pub,
@@ -4432,6 +4442,7 @@ add_coin_melt (void *cls,
struct TALER_EXCHANGEDB_RefreshMelt *melt;
struct TALER_EXCHANGEDB_TransactionList *tl;
enum GNUNET_DB_QueryStatus qs;
+ uint64_t serial_id;
melt = GNUNET_new (struct TALER_EXCHANGEDB_RefreshMelt);
{
@@ -4445,6 +4456,8 @@ add_coin_melt (void *cls,
&melt->session.amount_with_fee),
TALER_PQ_RESULT_SPEC_AMOUNT ("fee_refresh",
&melt->melt_fee),
+ GNUNET_PQ_result_spec_uint64 ("melt_serial_id",
+ &serial_id),
GNUNET_PQ_result_spec_end
};
@@ -4464,6 +4477,7 @@ add_coin_melt (void *cls,
tl->next = chc->head;
tl->type = TALER_EXCHANGEDB_TT_REFRESH_MELT;
tl->details.melt = melt;
+ tl->serial_id = serial_id;
/* FIXME: integrate via JOIN in main select, instead of using separate
query */
qs = postgres_get_known_coin (chc->db_cls,
chc->session,
@@ -4502,6 +4516,7 @@ add_coin_refund (void *cls,
struct TALER_EXCHANGEDB_Refund *refund;
struct TALER_EXCHANGEDB_TransactionList *tl;
enum GNUNET_DB_QueryStatus qs;
+ uint64_t serial_id;
refund = GNUNET_new (struct TALER_EXCHANGEDB_Refund);
{
@@ -4518,6 +4533,8 @@ add_coin_refund (void *cls,
&refund->refund_amount),
TALER_PQ_RESULT_SPEC_AMOUNT ("fee_refund",
&refund->refund_fee),
+ GNUNET_PQ_result_spec_uint64 ("refund_serial_id",
+ &serial_id),
GNUNET_PQ_result_spec_end
};
@@ -4537,6 +4554,7 @@ add_coin_refund (void *cls,
tl->next = chc->head;
tl->type = TALER_EXCHANGEDB_TT_REFUND;
tl->details.refund = refund;
+ tl->serial_id = serial_id;
qs = postgres_get_known_coin (chc->db_cls,
chc->session,
chc->coin_pub,
@@ -4573,6 +4591,7 @@ add_old_coin_payback (void *cls,
{
struct TALER_EXCHANGEDB_PaybackRefresh *payback;
struct TALER_EXCHANGEDB_TransactionList *tl;
+ uint64_t serial_id;
payback = GNUNET_new (struct TALER_EXCHANGEDB_PaybackRefresh);
{
@@ -4592,6 +4611,8 @@ add_old_coin_payback (void *cls,
GNUNET_PQ_result_spec_rsa_signature ("denom_sig",
&payback->coin.denom_sig.
rsa_signature),
+ GNUNET_PQ_result_spec_uint64 ("payback_refresh_uuid",
+ &serial_id),
GNUNET_PQ_result_spec_end
};
@@ -4611,6 +4632,7 @@ add_old_coin_payback (void *cls,
tl->next = chc->head;
tl->type = TALER_EXCHANGEDB_TT_OLD_COIN_PAYBACK;
tl->details.old_coin_payback = payback;
+ tl->serial_id = serial_id;
chc->head = tl;
}
}
@@ -4636,6 +4658,7 @@ add_coin_payback (void *cls,
{
struct TALER_EXCHANGEDB_Payback *payback;
struct TALER_EXCHANGEDB_TransactionList *tl;
+ uint64_t serial_id;
payback = GNUNET_new (struct TALER_EXCHANGEDB_Payback);
{
@@ -4655,6 +4678,8 @@ add_coin_payback (void *cls,
GNUNET_PQ_result_spec_rsa_signature ("denom_sig",
&payback->coin.denom_sig.
rsa_signature),
+ GNUNET_PQ_result_spec_uint64 ("payback_uuid",
+ &serial_id),
GNUNET_PQ_result_spec_end
};
@@ -4674,6 +4699,7 @@ add_coin_payback (void *cls,
tl->next = chc->head;
tl->type = TALER_EXCHANGEDB_TT_PAYBACK;
tl->details.payback = payback;
+ tl->serial_id = serial_id;
chc->head = tl;
}
}
@@ -4699,6 +4725,7 @@ add_coin_payback_refresh (void *cls,
{
struct TALER_EXCHANGEDB_PaybackRefresh *payback;
struct TALER_EXCHANGEDB_TransactionList *tl;
+ uint64_t serial_id;
payback = GNUNET_new (struct TALER_EXCHANGEDB_PaybackRefresh);
{
@@ -4718,6 +4745,8 @@ add_coin_payback_refresh (void *cls,
GNUNET_PQ_result_spec_rsa_signature ("denom_sig",
&payback->coin.denom_sig.
rsa_signature),
+ GNUNET_PQ_result_spec_uint64 ("payback_refresh_uuid",
+ &serial_id),
GNUNET_PQ_result_spec_end
};
@@ -4737,6 +4766,7 @@ add_coin_payback_refresh (void *cls,
tl->next = chc->head;
tl->type = TALER_EXCHANGEDB_TT_PAYBACK_REFRESH;
tl->details.payback_refresh = payback;
+ tl->serial_id = serial_id;
chc->head = tl;
}
}
diff --git a/src/include/taler_exchangedb_plugin.h
b/src/include/taler_exchangedb_plugin.h
index 88cb2a40..11404959 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -655,6 +655,11 @@ struct TALER_EXCHANGEDB_TransactionList
enum TALER_EXCHANGEDB_TransactionType type;
/**
+ * Serial ID of this entry in the database.
+ */
+ uint64_t serial_id;
+
+ /**
* Details about the transaction, depending on @e type.
*/
union
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [taler-exchange] branch master updated (736927f0 -> e43b6793),
gnunet <=
- [GNUnet-SVN] [taler-exchange] 04/05: check h_wire/wire consistency, gnunet, 2019/09/02
- [GNUnet-SVN] [taler-exchange] 02/05: note where table is tested, gnunet, 2019/09/02
- [GNUnet-SVN] [taler-exchange] 03/05: generate with fast deposits in the future, gnunet, 2019/09/02
- [GNUnet-SVN] [taler-exchange] 01/05: auditor needs serial IDs in coin history, gnunet, 2019/09/02
- [GNUnet-SVN] [taler-exchange] 05/05: expand test suite, minor style improvements, gnunet, 2019/09/02