summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_insert_deposit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-25 13:56:33 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-25 13:56:40 +0100
commit87376e02eba3f5c2cf83a493446dee0c300565a4 (patch)
tree18103edb2bdf2b29a773cce2de596b06d8265abb /src/testing/testing_api_cmd_insert_deposit.c
parent2c14d338704f4574055c4b5c51d8a79dd2e22345 (diff)
downloadexchange-87376e02eba3f5c2cf83a493446dee0c300565a4.tar.gz
exchange-87376e02eba3f5c2cf83a493446dee0c300565a4.tar.bz2
exchange-87376e02eba3f5c2cf83a493446dee0c300565a4.zip
protocol v12 changes (/recoup split, signature changes) plus database sharding plus O(n^2)=>O(n) worst-case complexity reduction on coin balance checks
Diffstat (limited to 'src/testing/testing_api_cmd_insert_deposit.c')
-rw-r--r--src/testing/testing_api_cmd_insert_deposit.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/testing/testing_api_cmd_insert_deposit.c b/src/testing/testing_api_cmd_insert_deposit.c
index 276907e14..d45bd0c67 100644
--- a/src/testing/testing_api_cmd_insert_deposit.c
+++ b/src/testing/testing_api_cmd_insert_deposit.c
@@ -235,26 +235,35 @@ insert_deposit_run (void *cls,
deposit.wire_deadline = GNUNET_TIME_relative_to_timestamp (
ids->wire_deadline);
/* finally, actually perform the DB operation */
- if ( (GNUNET_OK !=
- ids->dbc->plugin->start (ids->dbc->plugin->cls,
- "libtalertesting: insert deposit")) ||
- (0 >
- ids->dbc->plugin->ensure_coin_known (ids->dbc->plugin->cls,
- &deposit.coin)) ||
- (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
- ids->dbc->plugin->insert_deposit (ids->dbc->plugin->cls,
- ids->exchange_timestamp,
- &deposit)) ||
- (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
- ids->dbc->plugin->commit (ids->dbc->plugin->cls)) )
{
- GNUNET_break (0);
- ids->dbc->plugin->rollback (ids->dbc->plugin->cls);
- GNUNET_free (deposit.receiver_wire_account);
- TALER_denom_pub_free (&dpk);
- TALER_denom_priv_free (&denom_priv);
- TALER_TESTING_interpreter_fail (is);
- return;
+ uint64_t known_coin_id;
+ struct TALER_DenominationHash dph;
+ struct TALER_AgeHash agh;
+
+ if ( (GNUNET_OK !=
+ ids->dbc->plugin->start (ids->dbc->plugin->cls,
+ "libtalertesting: insert deposit")) ||
+ (0 >
+ ids->dbc->plugin->ensure_coin_known (ids->dbc->plugin->cls,
+ &deposit.coin,
+ &known_coin_id,
+ &dph,
+ &agh)) ||
+ (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
+ ids->dbc->plugin->insert_deposit (ids->dbc->plugin->cls,
+ ids->exchange_timestamp,
+ &deposit)) ||
+ (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
+ ids->dbc->plugin->commit (ids->dbc->plugin->cls)) )
+ {
+ GNUNET_break (0);
+ ids->dbc->plugin->rollback (ids->dbc->plugin->cls);
+ GNUNET_free (deposit.receiver_wire_account);
+ TALER_denom_pub_free (&dpk);
+ TALER_denom_priv_free (&denom_priv);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
}
TALER_denom_sig_free (&deposit.coin.denom_sig);