summaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-21 19:22:03 +0200
committerChristian Grothoff <christian@grothoff.org>2016-05-21 19:22:03 +0200
commit8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2 (patch)
tree913b31d9e4c59050d68214298801403e293bf344 /src/exchangedb
parent9160245167ded9b2b7c11716dfa1a1e8887187f4 (diff)
downloadexchange-8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2.tar.gz
exchange-8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2.tar.bz2
exchange-8dfb3b87b47ca2d25f6bdcbdfa2acc517fbe6ae2.zip
testing refund, fixing bugs, refund test passes
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index f53b23104..e2b158c90 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2260,13 +2260,18 @@ postgres_test_deposit_done (void *cls,
PQclear (result);
return GNUNET_SYSERR;
}
+ if (1 != PQntuples (result))
+ {
+ GNUNET_break (0);
+ PQclear (result);
+ return GNUNET_SYSERR;
+ }
{
- /* NOTE: maybe wrong type for a 'boolean' */
- uint32_t done = 0;
+ uint8_t done = 0;
struct GNUNET_PQ_ResultSpec rs[] = {
- GNUNET_PQ_result_spec_uint32 ("done",
- &done),
+ GNUNET_PQ_result_spec_auto_from_type ("done",
+ &done),
GNUNET_PQ_result_spec_end
};
if (GNUNET_OK !=
@@ -3703,6 +3708,16 @@ postgres_get_coin_transactions (void *cls,
tl->next = head;
tl->type = TALER_EXCHANGEDB_TT_DEPOSIT;
tl->details.deposit = deposit;
+ if (GNUNET_SYSERR == get_known_coin (cls,
+ session,
+ &deposit->coin.coin_pub,
+ &deposit->coin))
+ {
+ GNUNET_break (0);
+ GNUNET_free (deposit);
+ PQclear (result);
+ goto cleanup;
+ }
head = tl;
continue;
}
@@ -3762,6 +3777,16 @@ postgres_get_coin_transactions (void *cls,
tl->next = head;
tl->type = TALER_EXCHANGEDB_TT_REFRESH_MELT;
tl->details.melt = melt;
+ if (GNUNET_SYSERR == get_known_coin (cls,
+ session,
+ coin_pub,
+ &melt->coin))
+ {
+ GNUNET_break (0);
+ GNUNET_free (melt);
+ PQclear (result);
+ goto cleanup;
+ }
head = tl;
continue;
}
@@ -3826,6 +3851,16 @@ postgres_get_coin_transactions (void *cls,
tl->next = head;
tl->type = TALER_EXCHANGEDB_TT_REFUND;
tl->details.refund = refund;
+ if (GNUNET_SYSERR == get_known_coin (cls,
+ session,
+ coin_pub,
+ &refund->coin))
+ {
+ GNUNET_break (0);
+ GNUNET_free (refund);
+ PQclear (result);
+ goto cleanup;
+ }
head = tl;
continue;
}