gnunet-svn
[Top][All Lists]
Advanced

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

[taler-donau] branch master updated: cleanup


From: gnunet
Subject: [taler-donau] branch master updated: cleanup
Date: Tue, 26 Dec 2023 12:25:36 +0100

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

johannes-casaburi pushed a commit to branch master
in repository donau.

The following commit(s) were added to refs/heads/master by this push:
     new ecfe116  cleanup
ecfe116 is described below

commit ecfe116b9b48c02cafeecf0be81e921feb296633
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Sun Dec 24 13:31:06 2023 +0100

    cleanup
---
 src/donau-tools/donau-offline.c                    | 5220 +------------------
 src/donau-tools/taler-donau-offline.c              | 5251 +-------------------
 src/donaudb/Makefile.am                            |   12 +-
 src/donaudb/bench-db-postgres.conf                 |   14 -
 src/donaudb/benchmark-0001.sql                     |   55 -
 src/donaudb/donau-0002.sql.in                      |   45 -
 src/donaudb/pg_add_donation_unit_key.h             |    6 +-
 src/donaudb/pg_get_donation_unit_info.c            |    8 +-
 src/donaudb/pg_get_donation_unit_info.h            |    6 +-
 src/donaudb/pg_insert_charity.c                    |   12 +-
 src/donaudb/pg_insert_charity.h                    |    2 +-
 src/donaudb/pg_insert_history_entry.c              |    8 +-
 src/donaudb/pg_insert_history_entry.h              |    8 +-
 src/donaudb/pg_insert_issued_receipt.h             |   12 +-
 src/donaudb/pg_insert_submitted_receipt.h          |   16 +-
 src/donaudb/pg_lookup_donation_unit_key.h          |    4 +-
 src/donaudb/plugin_donaudb_postgres.c              |  388 +-
 src/include/donau_crypto_lib.h                     |    7 +-
 src/json/Makefile.am                               |   18 +-
 src/json/json.c                                    |  859 +---
 src/json/json_helper.c                             | 1366 -----
 src/json/json_pack.c                               |  308 --
 src/json/test_json.c                               |  439 --
 src/lib/donau_api_charities_close.c                |  289 --
 src/lib/donau_api_charities_open.c                 |  529 --
 src/lib/donau_api_common.c                         | 2365 ---------
 src/lib/donau_api_common.h                         |  191 +-
 src/lib/donau_api_handle.c                         | 1654 +-----
 src/lib/donau_api_submit_receipts_get.c            |  165 -
 src/pq/pq_common.h                                 |    2 +-
 src/pq/pq_query_helper.c                           |   15 +-
 src/testing/donau-unified-setup.sh                 |    2 +-
 src/testing/test_donau_api.c                       | 1186 +----
 src/testing/test_donau_api.conf                    |   34 -
 src/testing/testing_api_cmd_batch.c                |  235 -
 src/testing/testing_api_cmd_batch_deposit.c        |  626 ---
 src/testing/testing_api_cmd_batch_withdraw.c       |  533 --
 src/testing/testing_api_cmd_common.c               |  226 -
 src/testing/testing_api_cmd_deposit.c              |  791 ---
 src/testing/testing_api_cmd_deposits_get.c         |  375 --
 src/testing/testing_api_cmd_get_donau.c            |  411 --
 src/testing/testing_api_cmd_insert_deposit.c       |  388 --
 .../testing_api_cmd_offline_sign_extensions.c      |  164 -
 .../testing_api_cmd_offline_sign_global_fees.c     |  230 -
 src/testing/testing_api_cmd_offline_sign_keys.c    |  165 -
 src/testing/testing_api_cmd_reserve_close.c        |  260 -
 src/testing/testing_api_cmd_reserve_get.c          |  390 --
 src/testing/testing_api_cmd_reserve_history.c      |  455 --
 src/testing/testing_api_cmd_reserve_open.c         |  349 --
 src/testing/testing_api_cmd_reserve_status.c       |  397 --
 src/testing/testing_api_cmd_revoke.c               |  207 -
 src/testing/testing_api_cmd_revoke_denom_key.c     |  256 -
 src/testing/testing_api_cmd_revoke_sign_key.c      |  256 -
 src/testing/testing_api_cmd_stat.c                 |  168 -
 src/testing/testing_api_cmd_transfer_get.c         |  406 --
 src/testing/testing_api_cmd_wait.c                 |  134 -
 src/testing/testing_api_cmd_withdraw.c             |  696 ---
 src/util/donau-config.c                            |    2 +-
 58 files changed, 241 insertions(+), 28375 deletions(-)

diff --git a/src/donau-tools/donau-offline.c b/src/donau-tools/donau-offline.c
index f52c91e..3aa7f8c 100644
--- a/src/donau-tools/donau-offline.c
+++ b/src/donau-tools/donau-offline.c
@@ -34,48 +34,6 @@
  */
 #define OP_INPUT_KEYS "donau-input-keys-0"
 
-/**
- * Name of the operation to 'disable auditor'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_DISABLE_AUDITOR "donau-disable-auditor-0"
-
-/**
- * Name of the operation to 'enable auditor'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_ENABLE_AUDITOR "donau-enable-auditor-0"
-
-/**
- * Name of the operation to 'enable wire'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_ENABLE_WIRE "donau-enable-wire-0"
-
-/**
- * Name of the operation to 'disable wire'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_DISABLE_WIRE "donau-disable-wire-0"
-
-/**
- * Name of the operation to set a 'wire-fee'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_SET_WIRE_FEE "donau-set-wire-fee-0"
-
-/**
- * Name of the operation to set a 'global-fee'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_SET_GLOBAL_FEE "donau-set-global-fee-0"
-
 /**
  * Name of the operation to 'upload' key signatures
  * The last component --by convention-- identifies the protocol version
@@ -83,13 +41,6 @@
  */
 #define OP_UPLOAD_SIGS "donau-upload-sigs-0"
 
-/**
- * Name of the operation to 'revoke-denomination' key
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_REVOKE_DENOMINATION "donau-revoke-denomination-0"
-
 /**
  * Name of the operation to 'revoke-signkey'
  * The last component --by convention-- identifies the protocol version
@@ -104,36 +55,6 @@
  */
 #define OP_SETUP "donau-setup-0"
 
-/**
- * sign the enabled and configured extensions.
- */
-#define OP_EXTENSIONS "donau-extensions-0"
-
-/**
- * Generate message to drain profits.
- */
-#define OP_DRAIN_PROFITS "donau-drain-profits-0"
-
-/**
- * Setup AML staff.
- */
-#define OP_UPDATE_AML_STAFF "donau-add-aml-staff-0"
-
-/**
- * Setup partner donau for wad transfers.
- */
-#define OP_ADD_PARTNER "donau-add-partner-0"
-
-/**
- * Our private key, initialized in #load_offline_key().
- */
-static struct TALER_MasterPrivateKeyP master_priv;
-
-/**
- * Our private key, initialized in #load_offline_key().
- */
-static struct TALER_MasterPublicKeyP master_pub;
-
 /**
  * Our context for making HTTP requests.
  */
@@ -205,34 +126,6 @@ struct SubCommand
 };
 
 
-/**
- * Data structure for denomination revocation requests.
- */
-struct DenomRevocationRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DenomRevocationRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DenomRevocationRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementRevokeDenominationKeyHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
 /**
  * Data structure for signkey revocation requests.
  */
@@ -262,5124 +155,25 @@ struct SignkeyRevocationRequest
 
 
 /**
- * Data structure for auditor add requests.
- */
-struct AuditorAddRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorAddRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorAddRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementAuditorEnableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for auditor del requests.
- */
-struct AuditorDelRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorDelRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorDelRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementAuditorDisableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for wire add requests.
- */
-struct WireAddRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireAddRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireAddRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementWireEnableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for wire del requests.
- */
-struct WireDelRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireDelRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireDelRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementWireDisableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for announcing wire fees.
- */
-struct WireFeeRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireFeeRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireFeeRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementSetWireFeeHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for draining profits.
+ * Next work item to perform.
  */
-struct DrainProfitsRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DrainProfitsRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DrainProfitsRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementDrainProfitsHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
+static struct GNUNET_SCHEDULER_Task *nxt;
 
 /**
- * Data structure for announcing global fees.
+ * Handle for #do_download.
  */
-struct GlobalFeeRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct GlobalFeeRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct GlobalFeeRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementSetGlobalFeeHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
+static struct DONAU_ManagementGetKeysHandle *mgkh;
 
 /**
- * Ongoing /keys request.
+ * Active signkey revocation requests.
  */
-struct UploadKeysRequest
-{
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadKeysRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadKeysRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementPostKeysHandle *h;
-
-  /**
-   * Operation index.
-   */
-  size_t idx;
-};
+static struct SignkeyRevocationRequest *srr_head;
 
 /**
- * Ongoing /management/extensions request.
- */
-struct UploadExtensionsRequest
-{
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadExtensionsRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadExtensionsRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementPostExtensionsHandle *h;
-
-  /**
-   * Operation index.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for AML staff requests.
- */
-struct AmlStaffRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AmlStaffRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AmlStaffRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementUpdateAmlOfficer *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for partner add requests.
- */
-struct PartnerAddRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct PartnerAddRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct PartnerAddRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementAddPartner *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Next work item to perform.
- */
-static struct GNUNET_SCHEDULER_Task *nxt;
-
-/**
- * Handle for #do_download.
- */
-static struct DONAU_ManagementGetKeysHandle *mgkh;
-
-
-/**
- * Active AML staff change requests.
- */
-static struct AmlStaffRequest *asr_head;
-
-/**
- * Active AML staff change requests.
- */
-static struct AmlStaffRequest *asr_tail;
-
-/**
- * Active partner add requests.
- */
-static struct PartnerAddRequest *par_head;
-
-/**
- * Active partner add requests.
- */
-static struct PartnerAddRequest *par_tail;
-
-/**
- * Active denomiantion revocation requests.
- */
-static struct DenomRevocationRequest *drr_head;
-
-/**
- * Active denomiantion revocation requests.
- */
-static struct DenomRevocationRequest *drr_tail;
-
-/**
- * Active signkey revocation requests.
- */
-static struct SignkeyRevocationRequest *srr_head;
-
-/**
- * Active signkey revocation requests.
+ * Active signkey revocation requests.
  */
 static struct SignkeyRevocationRequest *srr_tail;
 
-/**
- * Active auditor add requests.
- */
-static struct AuditorAddRequest *aar_head;
-
-/**
- * Active auditor add requests.
- */
-static struct AuditorAddRequest *aar_tail;
-
-/**
- * Active auditor del requests.
- */
-static struct AuditorDelRequest *adr_head;
-
-/**
- * Active auditor del requests.
- */
-static struct AuditorDelRequest *adr_tail;
-
-/**
- * Active wire add requests.
- */
-static struct WireAddRequest *war_head;
-
-/**
- * Active wire add requests.
- */
-static struct WireAddRequest *war_tail;
-
-/**
- * Active wire del requests.
- */
-static struct WireDelRequest *wdr_head;
-
-/**
- * Active wire del requests.
- */
-static struct WireDelRequest *wdr_tail;
-
-/**
- * Active wire fee requests.
- */
-static struct WireFeeRequest *wfr_head;
-
-/**
- * Active wire fee requests.
- */
-static struct WireFeeRequest *wfr_tail;
-
-/**
- * Active global fee requests.
- */
-static struct GlobalFeeRequest *gfr_head;
-
-/**
- * Active global fee requests.
- */
-static struct GlobalFeeRequest *gfr_tail;
-
-/**
- * Active keys upload requests.
- */
-static struct UploadKeysRequest *ukr_head;
-
-/**
- * Active keys upload requests.
- */
-static struct UploadKeysRequest *ukr_tail;
-
-/**
- * Active extensions upload requests.
- */
-static struct UploadExtensionsRequest *uer_head;
-
-/**
- * Active extensions upload requests.
- */
-static struct UploadExtensionsRequest *uer_tail;
-
-/**
- * Active drain profits requests.
- */
-struct DrainProfitsRequest *dpr_head;
-
-/**
- * Active drain profits requests.
- */
-static struct DrainProfitsRequest *dpr_tail;
-
-
-/**
- * Shutdown task. Invoked when the application is being terminated.
- *
- * @param cls NULL
- */
-// static void
-// do_shutdown (void *cls)
-// {
-//   (void) cls;
-
-//   {
-//     struct AmlStaffRequest *asr;
-
-//     while (NULL != (asr = asr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete AML staff update #%u\n",
-//                   (unsigned int) asr->idx);
-//       DONAU_management_update_aml_officer_cancel (asr->h);
-//       GNUNET_CONTAINER_DLL_remove (asr_head,
-//                                    asr_tail,
-//                                    asr);
-//       GNUNET_free (asr);
-//     }
-//   }
-//   {
-//     struct PartnerAddRequest *par;
-
-//     while (NULL != (par = par_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete partner add request #%u\n",
-//                   (unsigned int) par->idx);
-//       DONAU_management_add_partner_cancel (par->h);
-//       GNUNET_CONTAINER_DLL_remove (par_head,
-//                                    par_tail,
-//                                    par);
-//       GNUNET_free (par);
-//     }
-//   }
-//   {
-//     struct DenomRevocationRequest *drr;
-
-//     while (NULL != (drr = drr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete denomination revocation #%u\n",
-//                   (unsigned int) drr->idx);
-//       DONAU_management_revoke_denomination_key_cancel (drr->h);
-//       GNUNET_CONTAINER_DLL_remove (drr_head,
-//                                    drr_tail,
-//                                    drr);
-//       GNUNET_free (drr);
-//     }
-//   }
-//   {
-//     struct SignkeyRevocationRequest *srr;
-
-//     while (NULL != (srr = srr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete signkey revocation #%u\n",
-//                   (unsigned int) srr->idx);
-//       DONAU_management_revoke_signing_key_cancel (srr->h);
-//       GNUNET_CONTAINER_DLL_remove (srr_head,
-//                                    srr_tail,
-//                                    srr);
-//       GNUNET_free (srr);
-//     }
-//   }
-
-//   {
-//     struct AuditorAddRequest *aar;
-
-//     while (NULL != (aar = aar_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete auditor add #%u\n",
-//                   (unsigned int) aar->idx);
-//       DONAU_management_enable_auditor_cancel (aar->h);
-//       GNUNET_CONTAINER_DLL_remove (aar_head,
-//                                    aar_tail,
-//                                    aar);
-//       GNUNET_free (aar);
-//     }
-//   }
-//   {
-//     struct AuditorDelRequest *adr;
-
-//     while (NULL != (adr = adr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete auditor del #%u\n",
-//                   (unsigned int) adr->idx);
-//       DONAU_management_disable_auditor_cancel (adr->h);
-//       GNUNET_CONTAINER_DLL_remove (adr_head,
-//                                    adr_tail,
-//                                    adr);
-//       GNUNET_free (adr);
-//     }
-//   }
-//   {
-//     struct WireAddRequest *war;
-
-//     while (NULL != (war = war_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete wire add #%u\n",
-//                   (unsigned int) war->idx);
-//       DONAU_management_enable_wire_cancel (war->h);
-//       GNUNET_CONTAINER_DLL_remove (war_head,
-//                                    war_tail,
-//                                    war);
-//       GNUNET_free (war);
-//     }
-//   }
-//   {
-//     struct WireDelRequest *wdr;
-
-//     while (NULL != (wdr = wdr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete wire del #%u\n",
-//                   (unsigned int) wdr->idx);
-//       DONAU_management_disable_wire_cancel (wdr->h);
-//       GNUNET_CONTAINER_DLL_remove (wdr_head,
-//                                    wdr_tail,
-//                                    wdr);
-//       GNUNET_free (wdr);
-//     }
-//   }
-//   {
-//     struct WireFeeRequest *wfr;
-
-//     while (NULL != (wfr = wfr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete wire fee #%u\n",
-//                   (unsigned int) wfr->idx);
-//       DONAU_management_set_wire_fees_cancel (wfr->h);
-//       GNUNET_CONTAINER_DLL_remove (wfr_head,
-//                                    wfr_tail,
-//                                    wfr);
-//       GNUNET_free (wfr);
-//     }
-//   }
-//   {
-//     struct GlobalFeeRequest *gfr;
-
-//     while (NULL != (gfr = gfr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete global fee #%u\n",
-//                   (unsigned int) gfr->idx);
-//       DONAU_management_set_global_fees_cancel (gfr->h);
-//       GNUNET_CONTAINER_DLL_remove (gfr_head,
-//                                    gfr_tail,
-//                                    gfr);
-//       GNUNET_free (gfr);
-//     }
-//   }
-//   {
-//     struct UploadKeysRequest *ukr;
-
-//     while (NULL != (ukr = ukr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete key signature upload #%u\n",
-//                   (unsigned int) ukr->idx);
-//       DONAU_post_management_keys_cancel (ukr->h);
-//       GNUNET_CONTAINER_DLL_remove (ukr_head,
-//                                    ukr_tail,
-//                                    ukr);
-//       GNUNET_free (ukr);
-//     }
-//   }
-//   {
-//     struct UploadExtensionsRequest *uer;
-
-//     while (NULL != (uer = uer_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete extensions signature upload #%u\n",
-//                   (unsigned int) uer->idx);
-//       DONAU_management_post_extensions_cancel (uer->h);
-//       GNUNET_CONTAINER_DLL_remove (uer_head,
-//                                    uer_tail,
-//                                    uer);
-//       GNUNET_free (uer);
-//     }
-//   }
-
-//   {
-//     struct DrainProfitsRequest *dpr;
-
-//     while (NULL != (dpr = dpr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete drain profits request #%u\n",
-//                   (unsigned int) dpr->idx);
-//       DONAU_management_drain_profits_cancel (dpr->h);
-//       GNUNET_CONTAINER_DLL_remove (dpr_head,
-//                                    dpr_tail,
-//                                    dpr);
-//       GNUNET_free (dpr);
-//     }
-//   }
-
-//   if (NULL != out)
-//   {
-//     json_dumpf (out,
-//                 stdout,
-//                 JSON_INDENT (2));
-//     json_decref (out);
-//     out = NULL;
-//   }
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-//                 "Input not consumed!\n");
-//     json_decref (in);
-//     in = NULL;
-//   }
-//   if (NULL != nxt)
-//   {
-//     GNUNET_SCHEDULER_cancel (nxt);
-//     nxt = NULL;
-//   }
-//   if (NULL != mgkh)
-//   {
-//     DONAU_get_management_keys_cancel (mgkh);
-//     mgkh = NULL;
-//   }
-//   if (NULL != ctx)
-//   {
-//     GNUNET_CURL_fini (ctx);
-//     ctx = NULL;
-//   }
-//   if (NULL != rc)
-//   {
-//     GNUNET_CURL_gnunet_rc_destroy (rc);
-//     rc = NULL;
-//   }
-// }
-
-
-// /**
-//  * Test if we should shut down because all tasks are done.
-//  */
-// static void
-// test_shutdown (void)
-// {
-//   if ( (NULL == drr_head) &&
-//        (NULL == par_head) &&
-//        (NULL == asr_head) &&
-//        (NULL == srr_head) &&
-//        (NULL == aar_head) &&
-//        (NULL == adr_head) &&
-//        (NULL == war_head) &&
-//        (NULL == wdr_head) &&
-//        (NULL == wfr_head) &&
-//        (NULL == gfr_head) &&
-//        (NULL == ukr_head) &&
-//        (NULL == uer_head) &&
-//        (NULL == dpr_head) &&
-//        (NULL == mgkh) &&
-//        (NULL == nxt) )
-//     GNUNET_SCHEDULER_shutdown ();
-// }
-
-
-// /**
-//  * Function to continue processing the next command.
-//  *
-//  * @param cls must be a `char *const*` with the array of
-//  *        command-line arguments to process next
-//  */
-// static void
-// work (void *cls);
-
-
-// /**
-//  * Function to schedule job to process the next command.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// next (char *const *args)
-// {
-//   GNUNET_assert (NULL == nxt);
-//   if (NULL == args[0])
-//   {
-//     test_shutdown ();
-//     return;
-//   }
-//   nxt = GNUNET_SCHEDULER_add_now (&work,
-//                                   (void *) args);
-// }
-
-
-// /**
-//  * Add an operation to the #out JSON array for processing later.
-//  *
-//  * @param op_name name of the operation
-//  * @param op_value values for the operation (consumed)
-//  */
-// static void
-// output_operation (const char *op_name,
-//                   json_t *op_value)
-// {
-//   json_t *action;
-
-//   GNUNET_break (NULL != op_value);
-//   if (NULL == out)
-//   {
-//     out = json_array ();
-//     GNUNET_assert (NULL != out);
-//   }
-//   action = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_string ("operation",
-//                              op_name),
-//     GNUNET_JSON_pack_object_steal ("arguments",
-//                                    op_value));
-//   GNUNET_assert (0 ==
-//                  json_array_append_new (out,
-//                                         action));
-// }
-
-
-// /**
-//  * Information about a subroutine for an upload.
-//  */
-// struct UploadHandler
-// {
-//   /**
-//    * Key to trigger this subroutine.
-//    */
-//   const char *key;
-
-//   /**
-//    * Function implementing an upload.
-//    *
-//    * @param donau_url URL of the donau
-//    * @param idx index of the operation we are performing
-//    * @param value arguments to drive the upload.
-//    */
-//   void (*cb)(const char *donau_url,
-//              size_t idx,
-//              const json_t *value);
-
-// };
-
-
-// /**
-//  * Load the offline key (if not yet done). Triggers shutdown on failure.
-//  *
-//  * @param do_create #GNUNET_YES if the key may be created
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// load_offline_key (int do_create)
-// {
-//   static bool done;
-//   int ret;
-//   char *fn;
-
-//   if (done)
-//     return GNUNET_OK;
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_filename (kcfg,
-//                                                "donau-offline",
-//                                                "MASTER_PRIV_FILE",
-//                                                &fn))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau-offline",
-//                                "MASTER_PRIV_FILE");
-//     test_shutdown ();
-//     return GNUNET_SYSERR;
-//   }
-//   if (GNUNET_YES !=
-//       GNUNET_DISK_file_test (fn))
-//     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-//                 "Donau master private key `%s' does not exist yet, creating 
it!\n",
-//                 fn);
-//   ret = GNUNET_CRYPTO_eddsa_key_from_file (fn,
-//                                            do_create,
-//                                            &master_priv.eddsa_priv);
-//   if (GNUNET_SYSERR == ret)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Failed to initialize master key from file `%s': %s\n",
-//                 fn,
-//                 "could not create file");
-//     GNUNET_free (fn);
-//     test_shutdown ();
-//     return GNUNET_SYSERR;
-//   }
-//   GNUNET_free (fn);
-//   GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv,
-//                                       &master_pub.eddsa_pub);
-//   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-//               "Using master public key %s\n",
-//               TALER_B2S (&master_pub));
-//   done = true;
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Function called with information about the post revocation operation 
result.
-//  *
-//  * @param cls closure with a `struct DenomRevocationRequest`
-//  * @param dr response data
-//  */
-// static void
-// denom_revocation_cb (
-//   void *cls,
-//   const struct DONAU_ManagementRevokeDenominationResponse *dr)
-// {
-//   struct DenomRevocationRequest *drr = cls;
-//   const struct DONAU_HttpResponse *hr = &dr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) drr->idx,
-//                 hr->http_status,
-//                 hr->hint,
-//                 TALER_JSON_get_error_hint (hr->reply));
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (drr_head,
-//                                drr_tail,
-//                                drr);
-//   GNUNET_free (drr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload denomination revocation request data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_denom_revocation (const char *donau_url,
-//                          size_t idx,
-//                          const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct TALER_DenominationHashP h_denom_pub;
-//   struct DenomRevocationRequest *drr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-//                                  &h_denom_pub),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for denomination revocation: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   drr = GNUNET_new (struct DenomRevocationRequest);
-//   drr->idx = idx;
-//   drr->h =
-//     DONAU_management_revoke_denomination_key (ctx,
-//                                               donau_url,
-//                                               &h_denom_pub,
-//                                               &master_sig,
-//                                               &denom_revocation_cb,
-//                                               drr);
-//   GNUNET_CONTAINER_DLL_insert (drr_head,
-//                                drr_tail,
-//                                drr);
-// }
-
-
-// /**
-//  * Function called with information about the post revocation operation 
result.
-//  *
-//  * @param cls closure with a `struct SignkeyRevocationRequest`
-//  * @param sr response data
-//  */
-// static void
-// signkey_revocation_cb (
-//   void *cls,
-//   const struct DONAU_ManagementRevokeSigningKeyResponse *sr)
-// {
-//   struct SignkeyRevocationRequest *srr = cls;
-//   const struct DONAU_HttpResponse *hr = &sr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) srr->idx,
-//                 hr->http_status,
-//                 hr->hint,
-//                 TALER_JSON_get_error_hint (hr->reply));
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (srr_head,
-//                                srr_tail,
-//                                srr);
-//   GNUNET_free (srr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload signkey revocation request data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_signkey_revocation (const char *donau_url,
-//                            size_t idx,
-//                            const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct DONAU_DonauPublicKeyP donau_pub;
-//   struct SignkeyRevocationRequest *srr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("donau_pub",
-//                                  &donau_pub),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for signkey revocation: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   srr = GNUNET_new (struct SignkeyRevocationRequest);
-//   srr->idx = idx;
-//   srr->h =
-//     DONAU_management_revoke_signing_key (ctx,
-//                                          donau_url,
-//                                          &donau_pub,
-//                                          &master_sig,
-//                                          &signkey_revocation_cb,
-//                                          srr);
-//   GNUNET_CONTAINER_DLL_insert (srr_head,
-//                                srr_tail,
-//                                srr);
-// }
-
-
-// /**
-//  * Function called with information about the post auditor add operation 
result.
-//  *
-//  * @param cls closure with a `struct AuditorAddRequest`
-//  * @param mer response data
-//  */
-// static void
-// auditor_add_cb (
-//   void *cls,
-//   const struct DONAU_ManagementAuditorEnableResponse *mer)
-// {
-//   struct AuditorAddRequest *aar = cls;
-//   const struct DONAU_HttpResponse *hr = &mer->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) aar->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (aar_head,
-//                                aar_tail,
-//                                aar);
-//   GNUNET_free (aar);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload auditor add data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_auditor_add (const char *donau_url,
-//                     size_t idx,
-//                     const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *auditor_url;
-//   const char *auditor_name;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct AuditorAddRequest *aar;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("auditor_url",
-//                              &auditor_url),
-//     GNUNET_JSON_spec_string ("auditor_name",
-//                              &auditor_name),
-//     GNUNET_JSON_spec_timestamp ("validity_start",
-//                                 &start_time),
-//     GNUNET_JSON_spec_fixed_auto ("auditor_pub",
-//                                  &auditor_pub),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for adding auditor: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   aar = GNUNET_new (struct AuditorAddRequest);
-//   aar->idx = idx;
-//   aar->h =
-//     DONAU_management_enable_auditor (ctx,
-//                                      donau_url,
-//                                      &auditor_pub,
-//                                      auditor_url,
-//                                      auditor_name,
-//                                      start_time,
-//                                      &master_sig,
-//                                      &auditor_add_cb,
-//                                      aar);
-//   GNUNET_CONTAINER_DLL_insert (aar_head,
-//                                aar_tail,
-//                                aar);
-// }
-
-
-// /**
-//  * Function called with information about the post auditor del operation 
result.
-//  *
-//  * @param cls closure with a `struct AuditorDelRequest`
-//  * @param mdr response data
-//  */
-// static void
-// auditor_del_cb (void *cls,
-//                 const struct
-//                 DONAU_ManagementAuditorDisableResponse *mdr)
-// {
-//   struct AuditorDelRequest *adr = cls;
-//   const struct DONAU_HttpResponse *hr = &mdr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) adr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (adr_head,
-//                                adr_tail,
-//                                adr);
-//   GNUNET_free (adr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload auditor del data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_auditor_del (const char *donau_url,
-//                     size_t idx,
-//                     const json_t *value)
-// {
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct AuditorDelRequest *adr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("auditor_pub",
-//                                  &auditor_pub),
-//     GNUNET_JSON_spec_timestamp ("validity_end",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to disable auditor: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   adr = GNUNET_new (struct AuditorDelRequest);
-//   adr->idx = idx;
-//   adr->h =
-//     DONAU_management_disable_auditor (ctx,
-//                                       donau_url,
-//                                       &auditor_pub,
-//                                       end_time,
-//                                       &master_sig,
-//                                       &auditor_del_cb,
-//                                       adr);
-//   GNUNET_CONTAINER_DLL_insert (adr_head,
-//                                adr_tail,
-//                                adr);
-// }
-
-
-// /**
-//  * Function called with information about the post wire add operation 
result.
-//  *
-//  * @param cls closure with a `struct WireAddRequest`
-//  * @param wer response data
-//  */
-// static void
-// wire_add_cb (void *cls,
-//              const struct DONAU_ManagementWireEnableResponse *wer)
-// {
-//   struct WireAddRequest *war = cls;
-//   const struct DONAU_HttpResponse *hr = &wer->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) war->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (war_head,
-//                                war_tail,
-//                                war);
-//   GNUNET_free (war);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload wire add data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_wire_add (const char *donau_url,
-//                  size_t idx,
-//                  const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig_add;
-//   struct TALER_MasterSignatureP master_sig_wire;
-//   const char *payto_uri;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct WireAddRequest *war;
-//   const char *err_name;
-//   const char *conversion_url = NULL;
-//   const json_t *debit_restrictions;
-//   const json_t *credit_restrictions;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("payto_uri",
-//                              &payto_uri),
-//     GNUNET_JSON_spec_mark_optional (
-//       GNUNET_JSON_spec_string ("conversion_url",
-//                                &conversion_url),
-//       NULL),
-//     GNUNET_JSON_spec_array_const ("debit_restrictions",
-//                                   &debit_restrictions),
-//     GNUNET_JSON_spec_array_const ("credit_restrictions",
-//                                   &credit_restrictions),
-//     GNUNET_JSON_spec_timestamp ("validity_start",
-//                                 &start_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig_add",
-//                                  &master_sig_add),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig_wire",
-//                                  &master_sig_wire),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for adding wire account: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   {
-//     char *wire_method;
-
-//     wire_method = TALER_payto_get_method (payto_uri);
-//     if (NULL == wire_method)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto:// URI `%s' is malformed\n",
-//                   payto_uri);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//     GNUNET_free (wire_method);
-//   }
-//   {
-//     char *msg = TALER_payto_validate (payto_uri);
-
-//     if (NULL != msg)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto URI is malformed: %s\n",
-//                   msg);
-//       GNUNET_free (msg);
-//       test_shutdown ();
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       return;
-//     }
-//   }
-//   war = GNUNET_new (struct WireAddRequest);
-//   war->idx = idx;
-//   war->h =
-//     DONAU_management_enable_wire (ctx,
-//                                   donau_url,
-//                                   payto_uri,
-//                                   conversion_url,
-//                                   debit_restrictions,
-//                                   credit_restrictions,
-//                                   start_time,
-//                                   &master_sig_add,
-//                                   &master_sig_wire,
-//                                   &wire_add_cb,
-//                                   war);
-//   GNUNET_CONTAINER_DLL_insert (war_head,
-//                                war_tail,
-//                                war);
-// }
-
-
-// /**
-//  * Function called with information about the post wire del operation 
result.
-//  *
-//  * @param cls closure with a `struct WireDelRequest`
-//  * @param wdres response data
-//  */
-// static void
-// wire_del_cb (void *cls,
-//              const struct DONAU_ManagementWireDisableResponse *wdres)
-// {
-//   struct WireDelRequest *wdr = cls;
-//   const struct DONAU_HttpResponse *hr = &wdres->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) wdr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (wdr_head,
-//                                wdr_tail,
-//                                wdr);
-//   GNUNET_free (wdr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload wire del data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_wire_del (const char *donau_url,
-//                  size_t idx,
-//                  const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *payto_uri;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct WireDelRequest *wdr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("payto_uri",
-//                              &payto_uri),
-//     GNUNET_JSON_spec_timestamp ("validity_end",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to disable wire account: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   wdr = GNUNET_new (struct WireDelRequest);
-//   wdr->idx = idx;
-//   wdr->h =
-//     DONAU_management_disable_wire (ctx,
-//                                    donau_url,
-//                                    payto_uri,
-//                                    end_time,
-//                                    &master_sig,
-//                                    &wire_del_cb,
-//                                    wdr);
-//   GNUNET_CONTAINER_DLL_insert (wdr_head,
-//                                wdr_tail,
-//                                wdr);
-// }
-
-
-// /**
-//  * Function called with information about the post wire fee operation 
result.
-//  *
-//  * @param cls closure with a `struct WireFeeRequest`
-//  * @param swr response data
-//  */
-// static void
-// wire_fee_cb (
-//   void *cls,
-//   const struct DONAU_ManagementSetWireFeeResponse *swr)
-// {
-//   struct WireFeeRequest *wfr = cls;
-//   const struct DONAU_HttpResponse *hr = &swr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) wfr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (wfr_head,
-//                                wfr_tail,
-//                                wfr);
-//   GNUNET_free (wfr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload wire fee.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_wire_fee (const char *donau_url,
-//                  size_t idx,
-//                  const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *wire_method;
-//   struct WireFeeRequest *wfr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct TALER_WireFeeSet fees;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("wire_method",
-//                              &wire_method),
-//     TALER_JSON_spec_amount ("wire_fee",
-//                             currency,
-//                             &fees.wire),
-//     TALER_JSON_spec_amount ("closing_fee",
-//                             currency,
-//                             &fees.closing),
-//     GNUNET_JSON_spec_timestamp ("start_time",
-//                                 &start_time),
-//     GNUNET_JSON_spec_timestamp ("end_time",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to set wire fee: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   wfr = GNUNET_new (struct WireFeeRequest);
-//   wfr->idx = idx;
-//   wfr->h =
-//     DONAU_management_set_wire_fees (ctx,
-//                                     donau_url,
-//                                     wire_method,
-//                                     start_time,
-//                                     end_time,
-//                                     &fees,
-//                                     &master_sig,
-//                                     &wire_fee_cb,
-//                                     wfr);
-//   GNUNET_CONTAINER_DLL_insert (wfr_head,
-//                                wfr_tail,
-//                                wfr);
-// }
-
-
-// /**
-//  * Function called with information about the post global fee operation 
result.
-//  *
-//  * @param cls closure with a `struct WireFeeRequest`
-//  * @param gr response data
-//  */
-// static void
-// global_fee_cb (
-//   void *cls,
-//   const struct DONAU_ManagementSetGlobalFeeResponse *gr)
-// {
-//   struct GlobalFeeRequest *gfr = cls;
-//   const struct DONAU_HttpResponse *hr = &gr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) gfr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (gfr_head,
-//                                gfr_tail,
-//                                gfr);
-//   GNUNET_free (gfr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload global fee.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_global_fee (const char *donau_url,
-//                    size_t idx,
-//                    const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GlobalFeeRequest *gfr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct TALER_GlobalFeeSet fees;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct GNUNET_TIME_Relative purse_timeout;
-//   struct GNUNET_TIME_Relative history_expiration;
-//   uint32_t purse_account_limit;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     TALER_JSON_spec_amount ("history_fee",
-//                             currency,
-//                             &fees.history),
-//     TALER_JSON_spec_amount ("account_fee",
-//                             currency,
-//                             &fees.account),
-//     TALER_JSON_spec_amount ("purse_fee",
-//                             currency,
-//                             &fees.purse),
-//     GNUNET_JSON_spec_relative_time ("purse_timeout",
-//                                     &purse_timeout),
-//     GNUNET_JSON_spec_relative_time ("history_expiration",
-//                                     &history_expiration),
-//     GNUNET_JSON_spec_uint32 ("purse_account_limit",
-//                              &purse_account_limit),
-//     GNUNET_JSON_spec_timestamp ("start_time",
-//                                 &start_time),
-//     GNUNET_JSON_spec_timestamp ("end_time",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to set wire fee: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   gfr = GNUNET_new (struct GlobalFeeRequest);
-//   gfr->idx = idx;
-//   gfr->h =
-//     DONAU_management_set_global_fees (ctx,
-//                                       donau_url,
-//                                       start_time,
-//                                       end_time,
-//                                       &fees,
-//                                       purse_timeout,
-//                                       history_expiration,
-//                                       purse_account_limit,
-//                                       &master_sig,
-//                                       &global_fee_cb,
-//                                       gfr);
-//   GNUNET_CONTAINER_DLL_insert (gfr_head,
-//                                gfr_tail,
-//                                gfr);
-// }
-
-
-// /**
-//  * Function called with information about the drain profits operation.
-//  *
-//  * @param cls closure with a `struct DrainProfitsRequest`
-//  * @param mdr response data
-//  */
-// static void
-// drain_profits_cb (
-//   void *cls,
-//   const struct DONAU_ManagementDrainResponse *mdr)
-// {
-//   struct DrainProfitsRequest *dpr = cls;
-//   const struct DONAU_HttpResponse *hr = &mdr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) dpr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (dpr_head,
-//                                dpr_tail,
-//                                dpr);
-//   GNUNET_free (dpr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload drain profit action.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for drain profits
-//  */
-// static void
-// upload_drain (const char *donau_url,
-//               size_t idx,
-//               const json_t *value)
-// {
-//   struct TALER_WireTransferIdentifierRawP wtid;
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct TALER_Amount amount;
-//   struct GNUNET_TIME_Timestamp date;
-//   const char *payto_uri;
-//   const char *account_section;
-//   struct DrainProfitsRequest *dpr;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("wtid",
-//                                  &wtid),
-//     TALER_JSON_spec_amount ("amount",
-//                             currency,
-//                             &amount),
-//     GNUNET_JSON_spec_timestamp ("date",
-//                                 &date),
-//     GNUNET_JSON_spec_string ("account_section",
-//                              &account_section),
-//     GNUNET_JSON_spec_string ("payto_uri",
-//                              &payto_uri),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to drain profits: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   dpr = GNUNET_new (struct DrainProfitsRequest);
-//   dpr->idx = idx;
-//   dpr->h =
-//     DONAU_management_drain_profits (ctx,
-//                                     donau_url,
-//                                     &wtid,
-//                                     &amount,
-//                                     date,
-//                                     account_section,
-//                                     payto_uri,
-//                                     &master_sig,
-//                                     &drain_profits_cb,
-//                                     dpr);
-//   GNUNET_CONTAINER_DLL_insert (dpr_head,
-//                                dpr_tail,
-//                                dpr);
-// }
-
-
-// /**
-//  * Function called with information about the post upload keys operation 
result.
-//  *
-//  * @param cls closure with a `struct UploadKeysRequest`
-//  * @param mr response data
-//  */
-// static void
-// keys_cb (
-//   void *cls,
-//   const struct DONAU_ManagementPostKeysResponse *mr)
-// {
-//   struct UploadKeysRequest *ukr = cls;
-//   const struct DONAU_HttpResponse *hr = &mr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) ukr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (ukr_head,
-//                                ukr_tail,
-//                                ukr);
-//   GNUNET_free (ukr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload (denomination and signing) key master signatures.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for POSTing keys
-//  */
-// static void
-// upload_keys (const char *donau_url,
-//              size_t idx,
-//              const json_t *value)
-// {
-//   struct DONAU_ManagementPostKeysData pkd;
-//   struct UploadKeysRequest *ukr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   const json_t *denom_sigs;
-//   const json_t *signkey_sigs;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_array_const ("denom_sigs",
-//                                   &denom_sigs),
-//     GNUNET_JSON_spec_array_const ("signkey_sigs",
-//                                   &signkey_sigs),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   bool ok = true;
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to 'upload': %s#%u (skipping)\n",
-//                 err_name,
-//                 err_line);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   pkd.num_sign_sigs = json_array_size (signkey_sigs);
-//   pkd.num_denom_sigs = json_array_size (denom_sigs);
-//   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-//               "Uploading %u denomination and %u signing key signatures\n",
-//               pkd.num_denom_sigs,
-//               pkd.num_sign_sigs);
-//   pkd.sign_sigs = GNUNET_new_array (
-//     pkd.num_sign_sigs,
-//     struct DONAU_SigningKeySignature);
-//   pkd.denom_sigs = GNUNET_new_array (
-//     pkd.num_denom_sigs,
-//     struct DONAU_DenominationKeySignature);
-//   for (unsigned int i = 0; i<pkd.num_sign_sigs; i++)
-//   {
-//     struct DONAU_SigningKeySignature *ss = &pkd.sign_sigs[i];
-//     json_t *val = json_array_get (signkey_sigs,
-//                                   i);
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_fixed_auto ("donau_pub",
-//                                    &ss->donau_pub),
-//       GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                    &ss->master_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (val,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for signkey validity: %s#%u at %u 
(aborting)\n",
-//                   err_name,
-//                   err_line,
-//                   i);
-//       json_dumpf (val,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       ok = false;
-//     }
-//   }
-//   for (unsigned int i = 0; i<pkd.num_denom_sigs; i++)
-//   {
-//     struct DONAU_DenominationKeySignature *ds = &pkd.denom_sigs[i];
-//     json_t *val = json_array_get (denom_sigs,
-//                                   i);
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-//                                    &ds->h_denom_pub),
-//       GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                    &ds->master_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (val,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for denomination validity: %s#%u at %u 
(aborting)\n",
-//                   err_name,
-//                   err_line,
-//                   i);
-//       json_dumpf (val,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       ok = false;
-//     }
-//   }
-
-//   if (ok)
-//   {
-//     ukr = GNUNET_new (struct UploadKeysRequest);
-//     ukr->idx = idx;
-//     ukr->h =
-//       DONAU_post_management_keys (ctx,
-//                                   donau_url,
-//                                   &pkd,
-//                                   &keys_cb,
-//                                   ukr);
-//     GNUNET_CONTAINER_DLL_insert (ukr_head,
-//                                  ukr_tail,
-//                                  ukr);
-//   }
-//   else
-//   {
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//   }
-//   GNUNET_free (pkd.sign_sigs);
-//   GNUNET_free (pkd.denom_sigs);
-// }
-
-
-// /**
-//  * Function called with information about the post upload extensions 
operation result.
-//  *
-//  * @param cls closure with a `struct UploadExtensionsRequest`
-//  * @param er response data
-//  */
-// static void
-// extensions_cb (
-//   void *cls,
-//   const struct DONAU_ManagementPostExtensionsResponse *er)
-// {
-//   struct UploadExtensionsRequest *uer = cls;
-//   const struct DONAU_HttpResponse *hr = &er->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) uer->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (uer_head,
-//                                uer_tail,
-//                                uer);
-//   GNUNET_free (uer);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload extension configuration
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for POSTing configurations of extensions
-//  */
-// static void
-// upload_extensions (const char *donau_url,
-//                    size_t idx,
-//                    const json_t *value)
-// {
-//   const json_t *extensions;
-//   struct TALER_MasterSignatureP sig;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_object_const ("extensions",
-//                                    &extensions),
-//     GNUNET_JSON_spec_fixed_auto ("extensions_sig",
-//                                  &sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   /* 1. Parse the signed extensions */
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to set extensions: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-
-//   /* 2. Verify the signature */
-//   {
-//     struct TALER_ExtensionManifestsHashP h_manifests;
-
-//     if (GNUNET_OK !=
-//         TALER_JSON_extensions_manifests_hash (extensions,
-//                                               &h_manifests))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "couldn't hash extensions' manifests\n");
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-
-//     if (GNUNET_OK !=
-//         load_offline_key (GNUNET_NO))
-//       return;
-
-//     if (GNUNET_OK != TALER_donau_offline_extension_manifests_hash_verify (
-//           &h_manifests,
-//           &master_pub,
-//           &sig))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "invalid signature for extensions\n");
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//   }
-
-//   /* 3. Upload the extensions */
-//   {
-//     struct DONAU_ManagementPostExtensionsData ped = {
-//       .extensions = extensions,
-//       .extensions_sig = sig,
-//     };
-//     struct UploadExtensionsRequest *uer
-//       = GNUNET_new (struct UploadExtensionsRequest);
-
-//     uer->idx = idx;
-//     uer->h = DONAU_management_post_extensions (
-//       ctx,
-//       donau_url,
-//       &ped,
-//       &extensions_cb,
-//       uer);
-//     GNUNET_CONTAINER_DLL_insert (uer_head,
-//                                  uer_tail,
-//                                  uer);
-//   }
-// }
-
-
-// /**
-//  * Function called with information about the add partner operation.
-//  *
-//  * @param cls closure with a `struct PartnerAddRequest`
-//  * @param apr response data
-//  */
-// static void
-// add_partner_cb (
-//   void *cls,
-//   const struct DONAU_ManagementAddPartnerResponse *apr)
-// {
-//   struct PartnerAddRequest *par = cls;
-//   const struct DONAU_HttpResponse *hr = &apr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) par->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (par_head,
-//                                par_tail,
-//                                par);
-//   GNUNET_free (par);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Add partner action.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for add partner
-//  */
-// static void
-// add_partner (const char *donau_url,
-//              size_t idx,
-//              const json_t *value)
-// {
-//   struct TALER_MasterPublicKeyP partner_pub;
-//   struct GNUNET_TIME_Timestamp start_date;
-//   struct GNUNET_TIME_Timestamp end_date;
-//   struct GNUNET_TIME_Relative wad_frequency;
-//   struct TALER_Amount wad_fee;
-//   const char *partner_base_url;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct PartnerAddRequest *par;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("partner_pub",
-//                                  &partner_pub),
-//     TALER_JSON_spec_amount ("wad_fee",
-//                             currency,
-//                             &wad_fee),
-//     GNUNET_JSON_spec_relative_time ("wad_frequency",
-//                                     &wad_frequency),
-//     GNUNET_JSON_spec_timestamp ("start_date",
-//                                 &start_date),
-//     GNUNET_JSON_spec_timestamp ("end_date",
-//                                 &end_date),
-//     GNUNET_JSON_spec_string ("partner_base_url",
-//                              &partner_base_url),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *err_name;
-//   unsigned int err_line;
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to add partner: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   par = GNUNET_new (struct PartnerAddRequest);
-//   par->idx = idx;
-//   par->h =
-//     DONAU_management_add_partner (ctx,
-//                                   donau_url,
-//                                   &partner_pub,
-//                                   start_date,
-//                                   end_date,
-//                                   wad_frequency,
-//                                   &wad_fee,
-//                                   partner_base_url,
-//                                   &master_sig,
-//                                   &add_partner_cb,
-//                                   par);
-//   GNUNET_CONTAINER_DLL_insert (par_head,
-//                                par_tail,
-//                                par);
-// }
-
-
-// /**
-//  * Function called with information about the AML officer update operation.
-//  *
-//  * @param cls closure with a `struct AmlStaffRequest`
-//  * @param ar response data
-//  */
-// static void
-// update_aml_officer_cb (
-//   void *cls,
-//   const struct DONAU_ManagementUpdateAmlOfficerResponse *ar)
-// {
-//   struct AmlStaffRequest *asr = cls;
-//   const struct DONAU_HttpResponse *hr = &ar->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) asr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (asr_head,
-//                                asr_tail,
-//                                asr);
-//   GNUNET_free (asr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload AML staff action.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for AML staff change
-//  */
-// static void
-// update_aml_staff (const char *donau_url,
-//                   size_t idx,
-//                   const json_t *value)
-// {
-//   struct TALER_AmlOfficerPublicKeyP officer_pub;
-//   const char *officer_name;
-//   struct GNUNET_TIME_Timestamp change_date;
-//   bool is_active;
-//   bool read_only;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct AmlStaffRequest *asr;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("officer_pub",
-//                                  &officer_pub),
-//     GNUNET_JSON_spec_timestamp ("change_date",
-//                                 &change_date),
-//     GNUNET_JSON_spec_bool ("is_active",
-//                            &is_active),
-//     GNUNET_JSON_spec_bool ("read_only",
-//                            &read_only),
-//     GNUNET_JSON_spec_string ("officer_name",
-//                              &officer_name),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *err_name;
-//   unsigned int err_line;
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to AML staff update: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   asr = GNUNET_new (struct AmlStaffRequest);
-//   asr->idx = idx;
-//   asr->h =
-//     DONAU_management_update_aml_officer (ctx,
-//                                          donau_url,
-//                                          &officer_pub,
-//                                          officer_name,
-//                                          change_date,
-//                                          is_active,
-//                                          read_only,
-//                                          &master_sig,
-//                                          &update_aml_officer_cb,
-//                                          asr);
-//   GNUNET_CONTAINER_DLL_insert (asr_head,
-//                                asr_tail,
-//                                asr);
-// }
-
-
-// /**
-//  * Perform uploads based on the JSON in #out.
-//  *
-//  * @param donau_url base URL of the donau to use
-//  */
-// static void
-// trigger_upload (const char *donau_url)
-// {
-//   struct UploadHandler uhs[] = {
-//     {
-//       .key = OP_REVOKE_DENOMINATION,
-//       .cb = &upload_denom_revocation
-//     },
-//     {
-//       .key = OP_REVOKE_SIGNKEY,
-//       .cb = &upload_signkey_revocation
-//     },
-//     {
-//       .key = OP_ENABLE_AUDITOR,
-//       .cb = &upload_auditor_add
-//     },
-//     {
-//       .key = OP_DISABLE_AUDITOR,
-//       .cb = &upload_auditor_del
-//     },
-//     {
-//       .key = OP_ENABLE_WIRE,
-//       .cb = &upload_wire_add
-//     },
-//     {
-//       .key = OP_DISABLE_WIRE,
-//       .cb = &upload_wire_del
-//     },
-//     {
-//       .key = OP_SET_WIRE_FEE,
-//       .cb = &upload_wire_fee
-//     },
-//     {
-//       .key = OP_SET_GLOBAL_FEE,
-//       .cb = &upload_global_fee
-//     },
-//     {
-//       .key = OP_UPLOAD_SIGS,
-//       .cb = &upload_keys
-//     },
-//     {
-//       .key = OP_DRAIN_PROFITS,
-//       .cb = &upload_drain
-//     },
-//     {
-//       .key = OP_EXTENSIONS,
-//       .cb = &upload_extensions
-//     },
-//     {
-//       .key = OP_UPDATE_AML_STAFF,
-//       .cb = &update_aml_staff
-//     },
-//     {
-//       .key = OP_ADD_PARTNER,
-//       .cb = &add_partner
-//     },
-//     /* array termination */
-//     {
-//       .key = NULL
-//     }
-//   };
-//   size_t index;
-//   json_t *obj;
-
-//   json_array_foreach (out, index, obj) {
-//     bool found = false;
-//     const char *key;
-//     const json_t *value;
-
-//     key = json_string_value (json_object_get (obj, "operation"));
-//     value = json_object_get (obj, "arguments");
-//     if (NULL == key)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Malformed JSON input\n");
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//     /* block of code that uses key and value */
-//     for (unsigned int i = 0; NULL != uhs[i].key; i++)
-//     {
-//       if (0 == strcasecmp (key,
-//                            uhs[i].key))
-//       {
-
-//         found = true;
-//         uhs[i].cb (donau_url,
-//                    index,
-//                    value);
-//         break;
-//       }
-//     }
-//     if (! found)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Upload does not know how to handle `%s'\n",
-//                   key);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//   }
-// }
-
-
-// /**
-//  * Upload operation result (signatures) to donau.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_upload (char *const *args)
-// {
-//   (void) args;
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing upload\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if (NULL == out)
-//   {
-//     json_error_t err;
-
-//     out = json_loadf (stdin,
-//                       JSON_REJECT_DUPLICATES,
-//                       &err);
-//     if (NULL == out)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to read JSON input: %s at %d:%s (offset: %d)\n",
-//                   err.text,
-//                   err.line,
-//                   err.source,
-//                   err.position);
-//       test_shutdown ();
-//       global_ret = EXIT_FAILURE;
-//       return;
-//     }
-//   }
-//   if (! json_is_array (out))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Error: expected JSON array for `upload` command\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == CFG_donau_url) &&
-//        (GNUNET_OK !=
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau",
-//                                                "BASE_URL",
-//                                                &CFG_donau_url)) )
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau",
-//                                "BASE_URL");
-//     global_ret = EXIT_NOTCONFIGURED;
-//     test_shutdown ();
-//     return;
-//   }
-//   trigger_upload (CFG_donau_url);
-//   json_decref (out);
-//   out = NULL;
-// }
-
-
-// /**
-//  * Revoke denomination key.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_revoke_denomination_key (char *const *args)
-// {
-//   struct TALER_DenominationHashP h_denom_pub;
-//   struct TALER_MasterSignatureP master_sig;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing revocation\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &h_denom_pub,
-//                                        sizeof (h_denom_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify a denomination key with this 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_denomination_revoke_sign (&h_denom_pub,
-//                                                 &master_priv,
-//                                                 &master_sig);
-//   output_operation (OP_REVOKE_DENOMINATION,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("h_denom_pub",
-//                                                   &h_denom_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Revoke signkey.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_revoke_signkey (char *const *args)
-// {
-//   struct DONAU_DonauPublicKeyP donau_pub;
-//   struct TALER_MasterSignatureP master_sig;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing revocation\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &donau_pub,
-//                                        sizeof (donau_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an donau signing key with this 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_signkey_revoke_sign (&donau_pub,
-//                                            &master_priv,
-//                                            &master_sig);
-//   output_operation (OP_REVOKE_SIGNKEY,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("donau_pub",
-//                                                   &donau_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Add auditor.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the auditor's public key, args[1] the auditor's
-//  *        API base URL, and args[2] the auditor's name.
-//  */
-// static void
-// do_add_auditor (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct GNUNET_TIME_Timestamp now;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not adding auditor\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &auditor_pub,
-//                                        sizeof (auditor_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an auditor public key as first argument 
for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-
-//   if ( (NULL == args[1]) ||
-//        (0 != strncmp ("http",
-//                       args[1],
-//                       strlen ("http"))) ||
-//        (NULL == args[2]) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an auditor URI and auditor name as 2nd 
and 3rd arguments to this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   now = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_auditor_add_sign (&auditor_pub,
-//                                         args[1],
-//                                         now,
-//                                         &master_priv,
-//                                         &master_sig);
-//   output_operation (OP_ENABLE_AUDITOR,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("auditor_url",
-//                                                args[1]),
-//                       GNUNET_JSON_pack_string ("auditor_name",
-//                                                args[2]),
-//                       GNUNET_JSON_pack_timestamp ("validity_start",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("auditor_pub",
-//                                                   &auditor_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 3);
-// }
-
-
-// /**
-//  * Disable auditor account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_del_auditor (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct GNUNET_TIME_Timestamp now;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not deleting auditor 
account\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &auditor_pub,
-//                                        sizeof (auditor_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an auditor public key as first argument 
for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   now = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_auditor_del_sign (&auditor_pub,
-//                                         now,
-//                                         &master_priv,
-//                                         &master_sig);
-//   output_operation (OP_DISABLE_AUDITOR,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("auditor_pub",
-//                                                   &auditor_pub),
-//                       GNUNET_JSON_pack_timestamp ("validity_end",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Parse account restriction.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  * @param[in,out] restrictions JSON array to update
-//  * @return -1 on error, otherwise number of arguments from @a args that 
were used
-//  */
-// static int
-// parse_restriction (char *const *args,
-//                    json_t *restrictions)
-// {
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Restriction TYPE argument missing\n");
-//     return -1;
-//   }
-//   if (0 == strcmp (args[0],
-//                    "deny"))
-//   {
-//     GNUNET_assert (0 ==
-//                    json_array_append_new (
-//                      restrictions,
-//                      GNUNET_JSON_PACK (
-//                        GNUNET_JSON_pack_string ("type",
-//                                                 "deny"))));
-//     return 1;
-//   }
-//   if (0 == strcmp (args[0],
-//                    "regex"))
-//   {
-//     json_t *i18n;
-//     json_error_t err;
-
-//     if ( (NULL == args[1]) ||
-//          (NULL == args[2]) ||
-//          (NULL == args[3]) )
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Mandatory arguments for restriction of type `regex' 
missing (REGEX, HINT, HINT-I18 required)\n");
-//       return -1;
-//     }
-//     {
-//       regex_t ex;
-
-//       if (0 != regcomp (&ex,
-//                         args[1],
-//                         REG_NOSUB | REG_EXTENDED))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "Invalid regular expression `%s'\n",
-//                     args[1]);
-//         return -1;
-//       }
-//       regfree (&ex);
-//     }
-
-//     i18n = json_loads (args[3],
-//                        JSON_REJECT_DUPLICATES,
-//                        &err);
-//     if (NULL == i18n)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid JSON for restriction of type `regex': `%s` at 
%d\n",
-//                   args[3],
-//                   err.position);
-//       return -1;
-//     }
-//     GNUNET_assert (0 ==
-//                    json_array_append_new (
-//                      restrictions,
-//                      GNUNET_JSON_PACK (
-//                        GNUNET_JSON_pack_string ("type",
-//                                                 "regex"),
-//                        GNUNET_JSON_pack_string ("regex",
-//                                                 args[1]),
-//                        GNUNET_JSON_pack_string ("human_hint",
-//                                                 args[2]),
-//                        GNUNET_JSON_pack_object_steal ("human_hint_i18n",
-//                                                       i18n)
-//                        )));
-//     return 4;
-//   }
-//   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//               "Restriction TYPE `%s' unsupported\n",
-//               args[0]);
-//   return -1;
-// }
-
-
-// /**
-//  * Add wire account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_add_wire (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig_add;
-//   struct TALER_MasterSignatureP master_sig_wire;
-//   struct GNUNET_TIME_Timestamp now;
-//   const char *conversion_url = NULL;
-//   json_t *debit_restrictions;
-//   json_t *credit_restrictions;
-//   unsigned int num_args = 1;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not adding wire 
account\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify a payto://-URI with this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   {
-//     char *msg = TALER_payto_validate (args[0]);
-
-//     if (NULL != msg)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto URI is malformed: %s\n",
-//                   msg);
-//       GNUNET_free (msg);
-//       test_shutdown ();
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       return;
-//     }
-//   }
-//   now = GNUNET_TIME_timestamp_get ();
-//   {
-//     char *wire_method;
-
-//     wire_method = TALER_payto_get_method (args[0]);
-//     if (NULL == wire_method)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto:// URI `%s' is malformed\n",
-//                   args[0]);
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       test_shutdown ();
-//       return;
-//     }
-//     GNUNET_free (wire_method);
-//   }
-//   debit_restrictions = json_array ();
-//   GNUNET_assert (NULL != debit_restrictions);
-//   credit_restrictions = json_array ();
-//   GNUNET_assert (NULL != credit_restrictions);
-//   while (NULL != args[num_args])
-//   {
-//     if (0 == strcmp (args[num_args],
-//                      "conversion-url"))
-//     {
-//       num_args++;
-//       conversion_url = args[num_args];
-//       if (NULL == conversion_url)
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "'conversion-url' requires an argument\n");
-//         global_ret = EXIT_INVALIDARGUMENT;
-//         test_shutdown ();
-//         json_decref (debit_restrictions);
-//         json_decref (credit_restrictions);
-//         return;
-//       }
-//       num_args++;
-//       continue;
-//     }
-//     if (0 == strcmp (args[num_args],
-//                      "credit-restriction"))
-//     {
-//       int iret;
-
-//       num_args++;
-//       iret = parse_restriction (&args[num_args],
-//                                 credit_restrictions);
-//       if (iret <= 0)
-//       {
-//         global_ret = EXIT_INVALIDARGUMENT;
-//         test_shutdown ();
-//         json_decref (debit_restrictions);
-//         json_decref (credit_restrictions);
-//         return;
-//       }
-//       num_args += iret;
-//       continue;
-//     }
-//     if (0 == strcmp (args[num_args],
-//                      "debit-restriction"))
-//     {
-//       int iret;
-
-//       num_args++;
-//       iret = parse_restriction (&args[num_args],
-//                                 debit_restrictions);
-//       if (iret <= 0)
-//       {
-//         global_ret = EXIT_INVALIDARGUMENT;
-//         test_shutdown ();
-//         json_decref (debit_restrictions);
-//         json_decref (credit_restrictions);
-//         return;
-//       }
-//       num_args += iret;
-//       continue;
-//     }
-//     break;
-//   }
-//   TALER_donau_offline_wire_add_sign (args[0],
-//                                      conversion_url,
-//                                      debit_restrictions,
-//                                      credit_restrictions,
-//                                      now,
-//                                      &master_priv,
-//                                      &master_sig_add);
-//   TALER_donau_wire_signature_make (args[0],
-//                                    conversion_url,
-//                                    debit_restrictions,
-//                                    credit_restrictions,
-//                                    &master_priv,
-//                                    &master_sig_wire);
-//   output_operation (OP_ENABLE_WIRE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("payto_uri",
-//                                                args[0]),
-//                       GNUNET_JSON_pack_array_steal ("debit_restrictions",
-//                                                     debit_restrictions),
-//                       GNUNET_JSON_pack_array_steal ("credit_restrictions",
-//                                                     credit_restrictions),
-//                       GNUNET_JSON_pack_allow_null (
-//                         GNUNET_JSON_pack_string ("conversion_url",
-//                                                  conversion_url)),
-//                       GNUNET_JSON_pack_timestamp ("validity_start",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("master_sig_add",
-//                                                   &master_sig_add),
-//                       GNUNET_JSON_pack_data_auto ("master_sig_wire",
-//                                                   &master_sig_wire)));
-//   next (args + num_args);
-// }
-
-
-// /**
-//  * Disable wire account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_del_wire (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GNUNET_TIME_Timestamp now;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not deleting wire 
account\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify a payto://-URI with this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   now = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_wire_del_sign (args[0],
-//                                      now,
-//                                      &master_priv,
-//                                      &master_sig);
-//   output_operation (OP_DISABLE_WIRE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("payto_uri",
-//                                                args[0]),
-//                       GNUNET_JSON_pack_timestamp ("validity_end",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Set wire fees for the given year.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the year, args[1] the wire method, args[2] the 
wire fee and args[3]
-//  *        the closing fee.
-//  */
-// static void
-// do_set_wire_fee (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   char dummy;
-//   unsigned int year;
-//   struct TALER_WireFeeSet fees;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not setting wire fee\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) ||
-//        (NULL == args[3]) ||
-//        ( (1 != sscanf (args[0],
-//                        "%u%c",
-//                        &year,
-//                        &dummy)) &&
-//          (0 != strcasecmp ("now",
-//                            args[0])) ) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[2],
-//                                 &fees.wire)) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[3],
-//                                 &fees.closing)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must use YEAR, METHOD, WIRE-FEE, and CLOSING-FEE as 
arguments for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (0 == strcasecmp ("now",
-//                        args[0]))
-//     year = GNUNET_TIME_get_current_year ();
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   start_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year));
-//   end_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year + 1));
-
-//   TALER_donau_offline_wire_fee_sign (args[1],
-//                                      start_time,
-//                                      end_time,
-//                                      &fees,
-//                                      &master_priv,
-//                                      &master_sig);
-//   output_operation (OP_SET_WIRE_FEE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("wire_method",
-//                                                args[1]),
-//                       GNUNET_JSON_pack_timestamp ("start_time",
-//                                                   start_time),
-//                       GNUNET_JSON_pack_timestamp ("end_time",
-//                                                   end_time),
-//                       TALER_JSON_pack_amount ("wire_fee",
-//                                               &fees.wire),
-//                       TALER_JSON_pack_amount ("closing_fee",
-//                                               &fees.closing),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 4);
-// }
-
-
-// /**
-//  * Set global fees for the given year.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the year, args[1] the history fee, args[2]
-//  *        the account fee and args[3] the purse fee. These are followed by 
args[4] purse timeout,
-//  *        args[5] history expiration. Last is args[6] the (free) purse 
account limit.
-//  */
-// static void
-// do_set_global_fee (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   char dummy;
-//   unsigned int year;
-//   struct TALER_GlobalFeeSet fees;
-//   struct GNUNET_TIME_Relative purse_timeout;
-//   struct GNUNET_TIME_Relative history_expiration;
-//   unsigned int purse_account_limit;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not setting global 
fee\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) ||
-//        (NULL == args[3]) ||
-//        (NULL == args[4]) ||
-//        (NULL == args[5]) ||
-//        (NULL == args[6]) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must use YEAR, HISTORY-FEE, ACCOUNT-FEE, PURSE-FEE, 
PURSE-TIMEOUT, HISTORY-EXPIRATION and PURSE-ACCOUNT-LIMIT as arguments for this 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (1 != sscanf (args[0],
-//                      "%u%c",
-//                      &year,
-//                      &dummy)) &&
-//        (0 != strcasecmp ("now",
-//                          args[0])) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid YEAR given for 'global-fee' subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (GNUNET_OK !=
-//         TALER_string_to_amount (args[1],
-//                                 &fees.history)) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[2],
-//                                 &fees.account)) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[3],
-//                                 &fees.purse)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid amount given for 'global-fee' subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (GNUNET_OK !=
-//         GNUNET_STRINGS_fancy_time_to_relative (args[4],
-//                                                &purse_timeout)) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_fancy_time_to_relative (args[5],
-//                                                &history_expiration)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid delay given for 'global-fee' subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (1 != sscanf (args[6],
-//                    "%u%c",
-//                    &purse_account_limit,
-//                    &dummy))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid purse account limit given for 'global-fee' 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (0 == strcasecmp ("now",
-//                        args[0]))
-//     year = GNUNET_TIME_get_current_year ();
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   start_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year));
-//   end_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year + 1));
-
-//   TALER_donau_offline_global_fee_sign (start_time,
-//                                        end_time,
-//                                        &fees,
-//                                        purse_timeout,
-//                                        history_expiration,
-//                                        (uint32_t) purse_account_limit,
-//                                        &master_priv,
-//                                        &master_sig);
-//   output_operation (OP_SET_GLOBAL_FEE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_timestamp ("start_time",
-//                                                   start_time),
-//                       GNUNET_JSON_pack_timestamp ("end_time",
-//                                                   end_time),
-//                       TALER_JSON_pack_amount ("history_fee",
-//                                               &fees.history),
-//                       TALER_JSON_pack_amount ("account_fee",
-//                                               &fees.account),
-//                       TALER_JSON_pack_amount ("purse_fee",
-//                                               &fees.purse),
-//                       GNUNET_JSON_pack_time_rel ("purse_timeout",
-//                                                  purse_timeout),
-//                       GNUNET_JSON_pack_time_rel ("history_expiration",
-//                                                  history_expiration),
-//                       GNUNET_JSON_pack_uint64 ("purse_account_limit",
-//                                                (uint32_t) 
purse_account_limit),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 7);
-// }
-
-
-// /**
-//  * Drain profits from donau's escrow account to
-//  * regular donau account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the amount,
-//  *        args[1] must be the section of the escrow account to drain
-//  *        args[2] must be the payto://-URI of the target account
-//  */
-// static void
-// do_drain (char *const *args)
-// {
-//   struct TALER_WireTransferIdentifierRawP wtid;
-//   struct GNUNET_TIME_Timestamp date;
-//   struct TALER_Amount amount;
-//   const char *account_section;
-//   const char *payto_uri;
-//   struct TALER_MasterSignatureP master_sig;
-//   char *err;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing drain\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[0],
-//                                 &amount)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Drain requires an amount, section name and target 
payto://-URI as arguments\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Drain requires an amount, section name and target 
payto://-URI as arguments\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       TALER_string_to_amount (args[0],
-//                               &amount))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid amount `%s' specified for drain\n",
-//                 args[0]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   account_section = args[1];
-//   payto_uri = args[2];
-//   err = TALER_payto_validate (payto_uri);
-//   if (NULL != err)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid payto://-URI `%s' specified for drain: %s\n",
-//                 payto_uri,
-//                 err);
-//     GNUNET_free (err);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
-//                               &wtid,
-//                               sizeof (wtid));
-//   date = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_profit_drain_sign (&wtid,
-//                                          date,
-//                                          &amount,
-//                                          account_section,
-//                                          payto_uri,
-//                                          &master_priv,
-//                                          &master_sig);
-//   output_operation (OP_DRAIN_PROFITS,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("wtid",
-//                                                   &wtid),
-//                       GNUNET_JSON_pack_string ("account_section",
-//                                                account_section),
-//                       GNUNET_JSON_pack_string ("payto_uri",
-//                                                payto_uri),
-//                       TALER_JSON_pack_amount ("amount",
-//                                               &amount),
-//                       GNUNET_JSON_pack_timestamp ("date",
-//                                                   date),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 3);
-// }
-
-
-// /**
-//  * Add partner.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the partner's master public key, args[1] the 
partner's
-//  *        API base URL, args[2] the wad fee, args[3] the wad frequency, and
-//  *        args[4] the year (including possibly 'now')
-//  */
-// static void
-// do_add_partner (char *const *args)
-// {
-//   struct TALER_MasterPublicKeyP partner_pub;
-//   struct GNUNET_TIME_Timestamp start_date;
-//   struct GNUNET_TIME_Timestamp end_date;
-//   struct GNUNET_TIME_Relative wad_frequency;
-//   struct TALER_Amount wad_fee;
-//   const char *partner_base_url;
-//   struct TALER_MasterSignatureP master_sig;
-//   char dummy;
-//   unsigned int year;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not adding partner\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &partner_pub,
-//                                        sizeof (partner_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the partner master public key as first 
argument for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[1]) ||
-//        (0 != strncmp ("http",
-//                       args[1],
-//                       strlen ("http"))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the partner's base URL as the 2nd 
argument to this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   partner_base_url = args[1];
-//   if ( (NULL == args[2]) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[2],
-//                                 &wad_fee)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid amount `%s' specified for wad fee of partner\n",
-//                 args[2]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[3]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_fancy_time_to_relative (args[3],
-//                                                &wad_frequency)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid wad frequency `%s' specified for add partner\n",
-//                 args[3]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[4]) ||
-//        ( (1 != sscanf (args[4],
-//                        "%u%c",
-//                        &year,
-//                        &dummy)) &&
-//          (0 != strcasecmp ("now",
-//                            args[4])) ) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid year `%s' specified for add partner\n",
-//                 args[4]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (0 == strcasecmp ("now",
-//                        args[4]))
-//     year = GNUNET_TIME_get_current_year ();
-//   start_date = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year));
-//   end_date = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year + 1));
-
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_partner_details_sign (&partner_pub,
-//                                             start_date,
-//                                             end_date,
-//                                             wad_frequency,
-//                                             &wad_fee,
-//                                             partner_base_url,
-//                                             &master_priv,
-//                                             &master_sig);
-//   output_operation (OP_ADD_PARTNER,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("partner_base_url",
-//                                                partner_base_url),
-//                       GNUNET_JSON_pack_time_rel ("wad_frequency",
-//                                                  wad_frequency),
-//                       GNUNET_JSON_pack_timestamp ("start_date",
-//                                                   start_date),
-//                       GNUNET_JSON_pack_timestamp ("end_date",
-//                                                   end_date),
-//                       GNUNET_JSON_pack_data_auto ("partner_pub",
-//                                                   &partner_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 5);
-// }
-
-
-// /**
-//  * Enable or disable AML staff.
-//  *
-//  * @param is_active true to enable, false to disable
-//  * @param args the array of command-line arguments to process next; args[0] 
must be the AML staff's public key, args[1] the AML staff's legal name, and if 
@a is_active then args[2] rw (read write) or ro (read only)
-//  */
-// static void
-// do_set_aml_staff (bool is_active,
-//                   char *const *args)
-// {
-//   struct TALER_AmlOfficerPublicKeyP officer_pub;
-//   const char *officer_name;
-//   bool read_only;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GNUNET_TIME_Timestamp now
-//     = GNUNET_TIME_timestamp_get ();
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not updating AML staff 
status\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &officer_pub,
-//                                        sizeof (officer_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the AML officer's public key as first 
argument for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (NULL == args[1])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the officer's legal name as the 2nd 
argument to this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   officer_name = args[1];
-//   if (is_active)
-//   {
-//     if ( (NULL == args[2]) ||
-//          ( (0 != strcmp (args[2],
-//                          "ro")) &&
-//            (0 != strcmp (args[2],
-//                          "rw")) ) )
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "You must specify 'ro' or 'rw' (and not `%s') for the 
access level\n",
-//                   args[2]);
-//       test_shutdown ();
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       return;
-//     }
-//     read_only = (0 == strcmp (args[2],
-//                               "ro"));
-//   }
-//   else
-//   {
-//     read_only = true;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_aml_officer_status_sign (&officer_pub,
-//                                                officer_name,
-//                                                now,
-//                                                is_active,
-//                                                read_only,
-//                                                &master_priv,
-//                                                &master_sig);
-//   output_operation (OP_UPDATE_AML_STAFF,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("officer_name",
-//                                                officer_name),
-//                       GNUNET_JSON_pack_timestamp ("change_date",
-//                                                   now),
-//                       GNUNET_JSON_pack_bool ("is_active",
-//                                              is_active),
-//                       GNUNET_JSON_pack_bool ("read_only",
-//                                              read_only),
-//                       GNUNET_JSON_pack_data_auto ("officer_pub",
-//                                                   &officer_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + (is_active ? 3 : 2));
-// }
-
-
-// /**
-//  * Disable AML staff.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the AML staff's public key, args[1] the AML 
staff's legal name, args[2] rw (read write) or ro (read only)
-//  */
-// static void
-// disable_aml_staff (char *const *args)
-// {
-//   do_set_aml_staff (false,
-//                     args);
-// }
-
-
-// /**
-//  * Enable AML staff.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the AML staff's public key, args[1] the AML 
staff's legal name, args[2] rw (read write) or ro (read only)
-//  */
-// static void
-// enable_aml_staff (char *const *args)
-// {
-//   do_set_aml_staff (true,
-//                     args);
-// }
-
-
-// /**
-//  * Function called with information about future keys.  Dumps the JSON 
output
-//  * (on success), either into an internal buffer or to stdout (depending on
-//  * whether there are subsequent commands).
-//  *
-//  * @param cls closure with the `char **` remaining args
-//  * @param mgr response data
-//  */
-// static void
-// download_cb (void *cls,
-//              const struct DONAU_ManagementGetKeysResponse *mgr)
-// {
-//   char *const *args = cls;
-//   const struct DONAU_HttpResponse *hr = &mgr->hr;
-
-//   mgkh = NULL;
-//   switch (hr->http_status)
-//   {
-//   case MHD_HTTP_OK:
-//     break;
-//   default:
-//     if (0 != hr->http_status)
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to download keys from `%s': %s (HTTP status: 
%u/%u)\n",
-//                   CFG_donau_url,
-//                   hr->hint,
-//                   hr->http_status,
-//                   (unsigned int) hr->ec);
-//     else
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to download keys from `%s' (no HTTP response)\n",
-//                   CFG_donau_url);
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   in = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_string ("operation",
-//                              OP_INPUT_KEYS),
-//     GNUNET_JSON_pack_object_incref ("arguments",
-//                                     (json_t *) hr->reply));
-//   if (NULL == args[0])
-//   {
-//     json_dumpf (in,
-//                 stdout,
-//                 JSON_INDENT (2));
-//     json_decref (in);
-//     in = NULL;
-//   }
-//   next (args);
-// }
-
-
-// /**
-//  * Download future keys.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_download (char *const *args)
-// {
-//   if ( (NULL == CFG_donau_url) &&
-//        (GNUNET_OK !=
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau",
-//                                                "BASE_URL",
-//                                                &CFG_donau_url)) )
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau",
-//                                "BASE_URL");
-//     test_shutdown ();
-//     global_ret = EXIT_NOTCONFIGURED;
-//     return;
-//   }
-//   mgkh = DONAU_get_management_keys (ctx,
-//                                     CFG_donau_url,
-//                                     &download_cb,
-//                                     (void *) args);
-// }
-
-
-// /**
-//  * Check that the security module keys are the same as before.  If we had no
-//  * keys in store before, remember them (Trust On First Use).
-//  *
-//  * @param secmset security module keys
-//  * @return #GNUNET_OK if keys match with what we have in store
-//  *         #GNUNET_NO if we had nothing in store but now do
-//  *         #GNUNET_SYSERR if keys changed from what we remember or other 
error
-//  */
-// static enum GNUNET_GenericReturnValue
-// tofu_check (const struct TALER_SecurityModulePublicKeySetP *secmset)
-// {
-//   char *fn;
-//   struct TALER_SecurityModulePublicKeySetP oldset;
-//   ssize_t ret;
-
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_filename (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_TOFU_FILE",
-//                                                &fn))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau-offline",
-//                                "SECM_TOFU_FILE");
-//     return GNUNET_SYSERR;
-//   }
-//   if (GNUNET_OK ==
-//       GNUNET_DISK_file_test (fn))
-//   {
-//     ret = GNUNET_DISK_fn_read (fn,
-//                                &oldset,
-//                                sizeof (oldset));
-//     if (GNUNET_SYSERR != ret)
-//     {
-//       if (ret != sizeof (oldset))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "File `%s' corrupt\n",
-//                     fn);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       /* TOFU check */
-//       if (0 != memcmp (&oldset,
-//                        secmset,
-//                        sizeof (*secmset)))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "Fatal: security module keys changed (file `%s')!\n",
-//                     fn);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (fn);
-//       return GNUNET_OK;
-//     }
-//   }
-
-//   {
-//     char *key;
-
-//     /* check against SECMOD-keys pinned in configuration */
-//     if (GNUNET_OK ==
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_ESIGN_PUBKEY",
-//                                                &key))
-//     {
-//       struct TALER_SecurityModulePublicKeyP k;
-
-//       if (GNUNET_OK !=
-//           GNUNET_STRINGS_string_to_data (key,
-//                                          strlen (key),
-//                                          &k,
-//                                          sizeof (k)))
-//       {
-//         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                    "donau-offline",
-//                                    "SECM_ESIGN_PUBKEY",
-//                                    "key malformed");
-//         GNUNET_free (key);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (key);
-//       if (0 !=
-//           GNUNET_memcmp (&k,
-//                          &secmset->eddsa))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "ESIGN security module key does not match 
SECM_ESIGN_PUBKEY in configuration\n");
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//     }
-//     if (GNUNET_OK ==
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_DENOM_PUBKEY",
-//                                                &key))
-//     {
-//       struct TALER_SecurityModulePublicKeyP k;
-
-//       if (GNUNET_OK !=
-//           GNUNET_STRINGS_string_to_data (key,
-//                                          strlen (key),
-//                                          &k,
-//                                          sizeof (k)))
-//       {
-//         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                    "donau-offline",
-//                                    "SECM_DENOM_PUBKEY",
-//                                    "key malformed");
-//         GNUNET_free (key);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (key);
-//       if (0 !=
-//           GNUNET_memcmp (&k,
-//                          &secmset->rsa))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "DENOM security module key does not match 
SECM_DENOM_PUBKEY in configuration\n");
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//     }
-//     if (GNUNET_OK ==
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_DENOM_CS_PUBKEY",
-//                                                &key))
-//     {
-//       struct TALER_SecurityModulePublicKeyP k;
-
-//       if (GNUNET_OK !=
-//           GNUNET_STRINGS_string_to_data (key,
-//                                          strlen (key),
-//                                          &k,
-//                                          sizeof (k)))
-//       {
-//         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                    "donau-offline",
-//                                    "SECM_DENOM_CS_PUBKEY",
-//                                    "key malformed");
-//         GNUNET_free (key);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (key);
-//       if (0 !=
-//           GNUNET_memcmp (&k,
-//                          &secmset->cs))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "DENOM security module key does not match 
SECM_DENOM_CS_PUBKEY in configuration\n");
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//     }
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_DISK_directory_create_for_file (fn))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Failed create directory to store key material in file 
`%s'\n",
-//                 fn);
-//     GNUNET_free (fn);
-//     return GNUNET_SYSERR;
-//   }
-//   /* persist keys for future runs */
-//   if (GNUNET_OK !=
-//       GNUNET_DISK_fn_write (fn,
-//                             secmset,
-//                             sizeof (oldset),
-//                             GNUNET_DISK_PERM_USER_READ))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Failed to store key material in file `%s'\n",
-//                 fn);
-//     GNUNET_free (fn);
-//     return GNUNET_SYSERR;
-//   }
-//   GNUNET_free (fn);
-//   return GNUNET_NO;
-// }
-
-
-// /**
-//  * Output @a signkeys for human consumption.
-//  *
-//  * @param secm_pub security module public key used to sign the denominations
-//  * @param signkeys keys to output
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// show_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
-//                const json_t *signkeys)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (signkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     struct DONAU_DonauPublicKeyP donau_pub;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_TIME_Timestamp start_time;
-//     struct GNUNET_TIME_Timestamp sign_end;
-//     struct GNUNET_TIME_Timestamp legal_end;
-//     struct GNUNET_TIME_Relative duration;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &start_time),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire",
-//                                   &sign_end),
-//       GNUNET_JSON_spec_timestamp ("stamp_end",
-//                                   &legal_end),
-//       GNUNET_JSON_spec_fixed_auto ("key",
-//                                    &donau_pub),
-//       GNUNET_JSON_spec_fixed_auto ("signkey_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for signing key to 'show': %s#%u at %u 
(skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     duration = GNUNET_TIME_absolute_get_difference (start_time.abs_time,
-//                                                     sign_end.abs_time);
-//     if (GNUNET_OK !=
-//         TALER_donau_secmod_eddsa_verify (&donau_pub,
-//                                          start_time,
-//                                          duration,
-//                                          secm_pub,
-//                                          &secm_sig))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid security module signature for signing key %s 
(aborting)\n",
-//                   TALER_B2S (&donau_pub));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     {
-//       char *legal_end_s;
-
-//       legal_end_s = GNUNET_strdup (
-//         GNUNET_TIME_timestamp2s (legal_end));
-//       printf ("DONAU-KEY %s starting at %s (used for: %s, legal end: %s)\n",
-//               TALER_B2S (&donau_pub),
-//               GNUNET_TIME_timestamp2s (start_time),
-//               GNUNET_TIME_relative2s (duration,
-//                                       false),
-//               legal_end_s);
-//       GNUNET_free (legal_end_s);
-//     }
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Output @a denomkeys for human consumption.
-//  *
-//  * @param secm_pub_rsa security module public key used to sign the RSA 
denominations
-//  * @param secm_pub_cs security module public key used to sign the CS 
denominations
-//  * @param denomkeys keys to output
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa,
-//                 const struct TALER_SecurityModulePublicKeyP *secm_pub_cs,
-//                 const json_t *denomkeys)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (denomkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     const char *section_name;
-//     struct TALER_DenominationPublicKey denom_pub;
-//     struct GNUNET_TIME_Timestamp stamp_start;
-//     struct GNUNET_TIME_Timestamp stamp_expire_withdraw;
-//     struct GNUNET_TIME_Timestamp stamp_expire_deposit;
-//     struct GNUNET_TIME_Timestamp stamp_expire_legal;
-//     struct TALER_Amount coin_value;
-//     struct TALER_DenomFeeSet fees;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_string ("section_name",
-//                                &section_name),
-//       TALER_JSON_spec_denom_pub ("denom_pub",
-//                                  &denom_pub),
-//       TALER_JSON_spec_amount ("value",
-//                               currency,
-//                               &coin_value),
-//       TALER_JSON_SPEC_DENOM_FEES ("fee",
-//                                   currency,
-//                                   &fees),
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &stamp_start),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw",
-//                                   &stamp_expire_withdraw),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_deposit",
-//                                   &stamp_expire_deposit),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_legal",
-//                                   &stamp_expire_legal),
-//       GNUNET_JSON_spec_fixed_auto ("denom_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-//     struct GNUNET_TIME_Relative duration;
-//     struct TALER_DenominationHashP h_denom_pub;
-//     enum GNUNET_GenericReturnValue ok;
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for denomination key to 'show': %s#%u at 
%u (skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       GNUNET_JSON_parse_free (spec);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     duration = GNUNET_TIME_absolute_get_difference (
-//       stamp_start.abs_time,
-//       stamp_expire_withdraw.abs_time);
-//     TALER_denom_pub_hash (&denom_pub,
-//                           &h_denom_pub);
-//     switch (denom_pub.cipher)
-//     {
-//     case TALER_DENOMINATION_RSA:
-//       {
-//         struct TALER_RsaPubHashP h_rsa;
-
-//         TALER_rsa_pub_hash (denom_pub.details.rsa_public_key,
-//                             &h_rsa);
-//         ok = TALER_donau_secmod_rsa_verify (&h_rsa,
-//                                             section_name,
-//                                             stamp_start,
-//                                             duration,
-//                                             secm_pub_rsa,
-//                                             &secm_sig);
-//       }
-//       break;
-//     case TALER_DENOMINATION_CS:
-//       {
-//         struct TALER_CsPubHashP h_cs;
-
-//         TALER_cs_pub_hash (&denom_pub.details.cs_public_key,
-//                            &h_cs);
-//         ok = TALER_donau_secmod_cs_verify (&h_cs,
-//                                            section_name,
-//                                            stamp_start,
-//                                            duration,
-//                                            secm_pub_cs,
-//                                            &secm_sig);
-//       }
-//       break;
-//     default:
-//       GNUNET_break (0);
-//       ok = GNUNET_SYSERR;
-//       break;
-//     }
-//     if (GNUNET_OK != ok)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid security module signature for denomination key 
%s (aborting)\n",
-//                   GNUNET_h2s (&h_denom_pub.hash));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-
-//     {
-//       char *withdraw_fee_s;
-//       char *deposit_fee_s;
-//       char *refresh_fee_s;
-//       char *refund_fee_s;
-//       char *deposit_s;
-//       char *legal_s;
-
-//       withdraw_fee_s = TALER_amount_to_string (&fees.withdraw);
-//       deposit_fee_s = TALER_amount_to_string (&fees.deposit);
-//       refresh_fee_s = TALER_amount_to_string (&fees.refresh);
-//       refund_fee_s = TALER_amount_to_string (&fees.refund);
-//       deposit_s = GNUNET_strdup (
-//         GNUNET_TIME_timestamp2s (stamp_expire_deposit));
-//       legal_s = GNUNET_strdup (
-//         GNUNET_TIME_timestamp2s (stamp_expire_legal));
-
-//       printf (
-//         "DENOMINATION-KEY(%s) %s of value %s starting at %s "
-//         "(used for: %s, deposit until: %s legal end: %s) with fees 
%s/%s/%s/%s\n",
-//         section_name,
-//         TALER_B2S (&h_denom_pub),
-//         TALER_amount2s (&coin_value),
-//         GNUNET_TIME_timestamp2s (stamp_start),
-//         GNUNET_TIME_relative2s (duration,
-//                                 false),
-//         deposit_s,
-//         legal_s,
-//         withdraw_fee_s,
-//         deposit_fee_s,
-//         refresh_fee_s,
-//         refund_fee_s);
-//       GNUNET_free (withdraw_fee_s);
-//       GNUNET_free (deposit_fee_s);
-//       GNUNET_free (refresh_fee_s);
-//       GNUNET_free (refund_fee_s);
-//       GNUNET_free (deposit_s);
-//       GNUNET_free (legal_s);
-//     }
-
-//     GNUNET_JSON_parse_free (spec);
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Parse the input of donau keys for the 'show' and 'sign' commands.
-//  *
-//  * @param command_name name of the command, for logging
-//  * @return NULL on error, otherwise the keys details to be free'd by caller
-//  */
-// static json_t *
-// parse_keys_input (const char *command_name)
-// {
-//   const char *op_str;
-//   json_t *keys;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_json ("arguments",
-//                            &keys),
-//     GNUNET_JSON_spec_string ("operation",
-//                              &op_str),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *err_name;
-//   unsigned int err_line;
-
-//   if (NULL == in)
-//   {
-//     json_error_t err;
-
-//     in = json_loadf (stdin,
-//                      JSON_REJECT_DUPLICATES,
-//                      &err);
-//     if (NULL == in)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to read JSON input: %s at %d:%s (offset: %d)\n",
-//                   err.text,
-//                   err.line,
-//                   err.source,
-//                   err.position);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return NULL;
-//     }
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (in,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to '%s': %s#%u (skipping)\n",
-//                 command_name,
-//                 err_name,
-//                 err_line);
-//     json_dumpf (in,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return NULL;
-//   }
-//   if (0 != strcmp (op_str,
-//                    OP_INPUT_KEYS))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to '%s' : operation is `%s', expected 
`%s'\n",
-//                 command_name,
-//                 op_str,
-//                 OP_INPUT_KEYS);
-//     GNUNET_JSON_parse_free (spec);
-//     return NULL;
-//   }
-//   json_decref (in);
-//   in = NULL;
-//   return keys;
-// }
-
-
-// /**
-//  * Show future keys.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_show (char *const *args)
-// {
-//   json_t *keys;
-//   const char *err_name;
-//   unsigned int err_line;
-//   const json_t *denomkeys;
-//   const json_t *signkeys;
-//   struct TALER_MasterPublicKeyP mpub;
-//   struct TALER_SecurityModulePublicKeySetP secmset;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_array_const ("future_denoms",
-//                                   &denomkeys),
-//     GNUNET_JSON_spec_array_const ("future_signkeys",
-//                                   &signkeys),
-//     GNUNET_JSON_spec_fixed_auto ("master_pub",
-//                                  &mpub),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
-//                                  &secmset.rsa),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_cs_public_key",
-//                                  &secmset.cs),
-//     GNUNET_JSON_spec_fixed_auto ("signkey_secmod_public_key",
-//                                  &secmset.eddsa),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   keys = parse_keys_input ("show");
-//   if (NULL == keys)
-//     return;
-
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (keys,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to 'show': %s #%u (skipping)\n",
-//                 err_name,
-//                 err_line);
-//     json_dumpf (in,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (0 !=
-//       GNUNET_memcmp (&master_pub,
-//                      &mpub))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Fatal: donau uses different master key!\n");
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (GNUNET_SYSERR ==
-//       tofu_check (&secmset))
-//   {
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if ( (GNUNET_OK !=
-//         show_signkeys (&secmset.eddsa,
-//                        signkeys)) ||
-//        (GNUNET_OK !=
-//         show_denomkeys (&secmset.rsa,
-//                         &secmset.cs,
-//                         denomkeys)) )
-//   {
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   json_decref (keys);
-//   next (args);
-// }
-
-
-// /**
-//  * Sign @a signkeys with offline key.
-//  *
-//  * @param secm_pub security module public key used to sign the denominations
-//  * @param signkeys keys to output
-//  * @param[in,out] result array where to output the signatures
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// sign_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
-//                const json_t *signkeys,
-//                json_t *result)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (signkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     struct DONAU_DonauPublicKeyP donau_pub;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_TIME_Timestamp start_time;
-//     struct GNUNET_TIME_Timestamp sign_end;
-//     struct GNUNET_TIME_Timestamp legal_end;
-//     struct GNUNET_TIME_Relative duration;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &start_time),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire",
-//                                   &sign_end),
-//       GNUNET_JSON_spec_timestamp ("stamp_end",
-//                                   &legal_end),
-//       GNUNET_JSON_spec_fixed_auto ("key",
-//                                    &donau_pub),
-//       GNUNET_JSON_spec_fixed_auto ("signkey_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for signing key to 'show': %s #%u at %u 
(skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-
-//     duration = GNUNET_TIME_absolute_get_difference (start_time.abs_time,
-//                                                     sign_end.abs_time);
-//     if (GNUNET_OK !=
-//         TALER_donau_secmod_eddsa_verify (&donau_pub,
-//                                          start_time,
-//                                          duration,
-//                                          secm_pub,
-//                                          &secm_sig))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid security module signature for signing key %s 
(aborting)\n",
-//                   TALER_B2S (&donau_pub));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       GNUNET_JSON_parse_free (spec);
-//       return GNUNET_SYSERR;
-//     }
-//     {
-//       struct TALER_MasterSignatureP master_sig;
-
-//       TALER_donau_offline_signkey_validity_sign (&donau_pub,
-//                                                  start_time,
-//                                                  sign_end,
-//                                                  legal_end,
-//                                                  &master_priv,
-//                                                  &master_sig);
-//       GNUNET_assert (0 ==
-//                      json_array_append_new (
-//                        result,
-//                        GNUNET_JSON_PACK (
-//                          GNUNET_JSON_pack_data_auto ("donau_pub",
-//                                                      &donau_pub),
-//                          GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                      &master_sig))));
-//     }
-//     GNUNET_JSON_parse_free (spec);
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Looks up the AGE_RESTRICTED setting for a denomination in the config and
-//  * returns the age restriction (mask) accordingly.
-//  *
-//  * @param section_name Section in the configuration for the particular
-//  *    denomination.
-//  */
-// static struct TALER_AgeMask
-// load_age_mask (const char*section_name)
-// {
-//   static const struct TALER_AgeMask null_mask = {0};
-//   enum GNUNET_GenericReturnValue ret;
-
-//   if (! ar_enabled)
-//     return null_mask;
-
-//   if (GNUNET_OK != (GNUNET_CONFIGURATION_have_value (
-//                       kcfg,
-//                       section_name,
-//                       "AGE_RESTRICTED")))
-//     return null_mask;
-
-//   ret = GNUNET_CONFIGURATION_get_value_yesno (kcfg,
-//                                               section_name,
-//                                               "AGE_RESTRICTED");
-//   if (GNUNET_SYSERR == ret)
-//     GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                section_name,
-//                                "AGE_RESTRICTED",
-//                                "Value must be YES or NO\n");
-//   if (GNUNET_YES == ret)
-//     return ar_config.mask;
-
-//   return null_mask;
-// }
-
-
-// /**
-//  * Sign @a denomkeys with offline key.
-//  *
-//  * @param secm_pub_rsa security module public key used to sign the RSA 
denominations
-//  * @param secm_pub_cs security module public key used to sign the CS 
denominations
-//  * @param denomkeys keys to output
-//  * @param[in,out] result array where to output the signatures
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa,
-//                 const struct TALER_SecurityModulePublicKeyP *secm_pub_cs,
-//                 const json_t *denomkeys,
-//                 json_t *result)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (denomkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     const char *section_name;
-//     struct TALER_DenominationPublicKey denom_pub;
-//     struct GNUNET_TIME_Timestamp stamp_start;
-//     struct GNUNET_TIME_Timestamp stamp_expire_withdraw;
-//     struct GNUNET_TIME_Timestamp stamp_expire_deposit;
-//     struct GNUNET_TIME_Timestamp stamp_expire_legal;
-//     struct TALER_Amount coin_value;
-//     struct TALER_DenomFeeSet fees;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_string ("section_name",
-//                                &section_name),
-//       TALER_JSON_spec_denom_pub ("denom_pub",
-//                                  &denom_pub),
-//       TALER_JSON_spec_amount ("value",
-//                               currency,
-//                               &coin_value),
-//       TALER_JSON_SPEC_DENOM_FEES ("fee",
-//                                   currency,
-//                                   &fees),
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &stamp_start),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw",
-//                                   &stamp_expire_withdraw),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_deposit",
-//                                   &stamp_expire_deposit),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_legal",
-//                                   &stamp_expire_legal),
-//       GNUNET_JSON_spec_fixed_auto ("denom_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-//     struct GNUNET_TIME_Relative duration;
-//     struct TALER_DenominationHashP h_denom_pub;
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for denomination key to 'sign': %s #%u at 
%u (skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       GNUNET_JSON_parse_free (spec);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     duration = GNUNET_TIME_absolute_get_difference (
-//       stamp_start.abs_time,
-//       stamp_expire_withdraw.abs_time);
-
-//     /* Load the age mask, if applicable to this denomination */
-//     denom_pub.age_mask = load_age_mask (section_name);
-
-//     TALER_denom_pub_hash (&denom_pub,
-//                           &h_denom_pub);
-//     switch (denom_pub.cipher)
-//     {
-//     case TALER_DENOMINATION_RSA:
-//       {
-//         struct TALER_RsaPubHashP h_rsa;
-
-//         TALER_rsa_pub_hash (denom_pub.details.rsa_public_key,
-//                             &h_rsa);
-//         if (GNUNET_OK !=
-//             TALER_donau_secmod_rsa_verify (&h_rsa,
-//                                            section_name,
-//                                            stamp_start,
-//                                            duration,
-//                                            secm_pub_rsa,
-//                                            &secm_sig))
-//         {
-//           GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                       "Invalid security module signature for denomination 
key %s (aborting)\n",
-//                       GNUNET_h2s (&h_denom_pub.hash));
-//           global_ret = EXIT_FAILURE;
-//           test_shutdown ();
-//           GNUNET_JSON_parse_free (spec);
-//           return GNUNET_SYSERR;
-//         }
-//       }
-//       break;
-//     case TALER_DENOMINATION_CS:
-//       {
-//         struct TALER_CsPubHashP h_cs;
-
-//         TALER_cs_pub_hash (&denom_pub.details.cs_public_key,
-//                            &h_cs);
-//         if (GNUNET_OK !=
-//             TALER_donau_secmod_cs_verify (&h_cs,
-//                                           section_name,
-//                                           stamp_start,
-//                                           duration,
-//                                           secm_pub_cs,
-//                                           &secm_sig))
-//         {
-//           GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                       "Invalid security module signature for denomination 
key %s (aborting)\n",
-//                       GNUNET_h2s (&h_denom_pub.hash));
-//           global_ret = EXIT_FAILURE;
-//           test_shutdown ();
-//           GNUNET_JSON_parse_free (spec);
-//           return GNUNET_SYSERR;
-//         }
-//       }
-//       break;
-//     default:
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       GNUNET_JSON_parse_free (spec);
-//       return GNUNET_SYSERR;
-//     }
-
-//     {
-//       struct TALER_MasterSignatureP master_sig;
-
-//       TALER_donau_offline_denom_validity_sign (&h_denom_pub,
-//                                                stamp_start,
-//                                                stamp_expire_withdraw,
-//                                                stamp_expire_deposit,
-//                                                stamp_expire_legal,
-//                                                &coin_value,
-//                                                &fees,
-//                                                &master_priv,
-//                                                &master_sig);
-//       GNUNET_assert (0 ==
-//                      json_array_append_new (
-//                        result,
-//                        GNUNET_JSON_PACK (
-//                          GNUNET_JSON_pack_data_auto ("h_denom_pub",
-//                                                      &h_denom_pub),
-//                          GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                      &master_sig))));
-//     }
-//     GNUNET_JSON_parse_free (spec);
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Sign future keys.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_sign (char *const *args)
-// {
-//   json_t *keys;
-//   const char *err_name;
-//   unsigned int err_line;
-//   const json_t *denomkeys;
-//   const json_t *signkeys;
-//   struct TALER_MasterPublicKeyP mpub;
-//   struct TALER_SecurityModulePublicKeySetP secmset;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_array_const ("future_denoms",
-//                                   &denomkeys),
-//     GNUNET_JSON_spec_array_const ("future_signkeys",
-//                                   &signkeys),
-//     GNUNET_JSON_spec_fixed_auto ("master_pub",
-//                                  &mpub),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
-//                                  &secmset.rsa),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_cs_public_key",
-//                                  &secmset.cs),
-//     GNUNET_JSON_spec_fixed_auto ("signkey_secmod_public_key",
-//                                  &secmset.eddsa),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   keys = parse_keys_input ("sign");
-//   if (NULL == keys)
-//     return;
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//   {
-//     json_decref (keys);
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (keys,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to 'sign' : %s #%u (skipping)\n",
-//                 err_name,
-//                 err_line);
-//     json_dumpf (in,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (0 !=
-//       GNUNET_memcmp (&master_pub,
-//                      &mpub))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Fatal: donau uses different master key!\n");
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (GNUNET_SYSERR ==
-//       tofu_check (&secmset))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Fatal: security module keys changed!\n");
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   {
-//     json_t *signkey_sig_array = json_array ();
-//     json_t *denomkey_sig_array = json_array ();
-
-//     GNUNET_assert (NULL != signkey_sig_array);
-//     GNUNET_assert (NULL != denomkey_sig_array);
-//     if ( (GNUNET_OK !=
-//           sign_signkeys (&secmset.eddsa,
-//                          signkeys,
-//                          signkey_sig_array)) ||
-//          (GNUNET_OK !=
-//           sign_denomkeys (&secmset.rsa,
-//                           &secmset.cs,
-//                           denomkeys,
-//                           denomkey_sig_array)) )
-//     {
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       json_decref (signkey_sig_array);
-//       json_decref (denomkey_sig_array);
-//       json_decref (keys);
-//       return;
-//     }
-
-//     output_operation (OP_UPLOAD_SIGS,
-//                       GNUNET_JSON_PACK (
-//                         GNUNET_JSON_pack_array_steal ("denom_sigs",
-//                                                       denomkey_sig_array),
-//                         GNUNET_JSON_pack_array_steal ("signkey_sigs",
-//                                                       signkey_sig_array)));
-//   }
-//   json_decref (keys);
-//   next (args);
-// }
-
-
-// /**
-//  * Setup and output offline signing key.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_setup (char *const *args)
-// {
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_YES))
-//   {
-//     global_ret = EXIT_NOPERMISSION;
-//     return;
-//   }
-//   if (NULL != *args)
-//   {
-//     output_operation (OP_SETUP,
-//                       GNUNET_JSON_PACK (
-//                         GNUNET_JSON_pack_data_auto ("donau_offline_pub",
-//                                                     &master_pub)));
-//   }
-
-//   else
-//   {
-//     char *pub_s;
-
-//     pub_s = GNUNET_STRINGS_data_to_string_alloc (&master_pub,
-//                                                  sizeof (master_pub));
-//     fprintf (stdout,
-//              "%s\n",
-//              pub_s);
-//     GNUNET_free (pub_s);
-//   }
-//   if ( (NULL != *args) &&
-//        (0 == strcmp (*args,
-//                      "-")) )
-//     args++;
-//   next (args);
-// }
-
-
-// /**
-//  * Print the current extensions as configured
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_extensions_show (char *const *args)
-// {
-//   const struct TALER_Extensions *it;
-//   json_t *exts = json_object ();
-//   json_t *obj;
-
-//   GNUNET_assert (NULL != exts);
-//   for (it = TALER_extensions_get_head ();
-//        NULL != it && NULL != it->extension;
-//        it = it->next)
-//   {
-//     const struct TALER_Extension *extension = it->extension;
-//     int ret;
-
-//     ret = json_object_set_new (exts,
-//                                extension->name,
-//                                extension->manifest (extension));
-//     GNUNET_assert (-1 != ret);
-//   }
-
-//   obj = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_object_steal ("extensions",
-//                                    exts));
-//   GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//               "%s\n",
-//               json_dumps (obj,
-//                           JSON_INDENT (2)));
-//   json_decref (obj);
-//   next (args);
-// }
-
-
-// /**
-//  * Sign the configurations of the enabled extensions
-//  */
-// static void
-// do_extensions_sign (char *const *args)
-// {
-//   json_t *extensions = json_object ();
-//   struct TALER_ExtensionManifestsHashP h_manifests;
-//   struct TALER_MasterSignatureP sig;
-//   const struct TALER_Extensions *it;
-//   bool found = false;
-//   json_t *obj;
-
-//   GNUNET_assert (NULL != extensions);
-//   for (it = TALER_extensions_get_head ();
-//        NULL != it && NULL != it->extension;
-//        it = it->next)
-//   {
-//     const struct TALER_Extension *ext = it->extension;
-//     GNUNET_assert (ext);
-
-//     found = true;
-
-//     GNUNET_assert (0 ==
-//                    json_object_set_new (extensions,
-//                                         ext->name,
-//                                         ext->manifest (ext)));
-//   }
-
-//   if (! found)
-//     return;
-
-//   if (GNUNET_OK !=
-//       TALER_JSON_extensions_manifests_hash (extensions,
-//                                             &h_manifests))
-//   {
-//     json_decref (extensions);
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "error while hashing manifest for extensions\n");
-//     return;
-//   }
-
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//   {
-//     json_decref (extensions);
-//     return;
-//   }
-
-//   TALER_donau_offline_extension_manifests_hash_sign (&h_manifests,
-//                                                      &master_priv,
-//                                                      &sig);
-//   obj = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_object_steal ("extensions",
-//                                    extensions),
-//     GNUNET_JSON_pack_data_auto (
-//       "extensions_sig",
-//       &sig));
-
-//   output_operation (OP_EXTENSIONS,
-//                     obj);
-//   next (args);
-// }
-
-
-// /**
-//  * Dispatch @a args in the @a cmds array.
-//  *
-//  * @param args arguments with subcommand to dispatch
-//  * @param cmds array of possible subcommands to call
-//  */
-// static void
-// cmd_handler (char *const *args,
-//              const struct SubCommand *cmds)
-// {
-//   nxt = NULL;
-//   for (unsigned int i = 0; NULL != cmds[i].name; i++)
-//   {
-//     if (0 == strcasecmp (cmds[i].name,
-//                          args[0]))
-//     {
-//       cmds[i].cb (&args[1]);
-//       return;
-//     }
-//   }
-
-//   if (0 != strcasecmp ("help",
-//                        args[0]))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//                 "Unexpected command `%s'\n",
-//                 args[0]);
-//     global_ret = EXIT_INVALIDARGUMENT;
-//   }
-
-//   GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//               "Supported subcommands:\n");
-//   for (unsigned int i = 0; NULL != cmds[i].name; i++)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//                 "- %s: %s\n",
-//                 cmds[i].name,
-//                 cmds[i].help);
-//   }
-//   json_decref (out);
-//   out = NULL;
-//   GNUNET_SCHEDULER_shutdown ();
-// }
-
-
-// static void
-// do_work_extensions (char *const *args)
-// {
-//   struct SubCommand cmds[] = {
-//     {
-//       .name = "show",
-//       .help =
-//         "show the extensions in the Taler-config and their configured 
parameters",
-//       .cb = &do_extensions_show
-//     },
-//     {
-//       .name = "sign",
-//       .help =
-//         "sign the configuration of the extensions and publish it with the 
donau",
-//       .cb = &do_extensions_sign
-//     },
-//     {
-//       .name = NULL,
-//     }
-//   };
-
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must provide a subcommand: `show` or `sign`.\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-
-//   cmd_handler (args, cmds);
-// }
-
-
-// static void
-// work (void *cls)
-// {
-//   char *const *args = cls;
-//   struct SubCommand cmds[] = {
-//     {
-//       .name = "setup",
-//       .help =
-//         "initialize offline key signing material and display public offline 
key",
-//       .cb = &do_setup
-//     },
-//     {
-//       .name = "download",
-//       .help =
-//         "obtain future public keys from donau (to be performed online!)",
-//       .cb = &do_download
-//     },
-//     {
-//       .name = "show",
-//       .help =
-//         "display future public keys from donau for human review (pass '-' 
as argument to disable consuming input)",
-//       .cb = &do_show
-//     },
-//     {
-//       .name = "sign",
-//       .help = "sign all future public keys from the input",
-//       .cb = &do_sign
-//     },
-//     {
-//       .name = "revoke-denomination",
-//       .help =
-//         "revoke denomination key (hash of public key must be given as 
argument)",
-//       .cb = &do_revoke_denomination_key
-//     },
-//     {
-//       .name = "revoke-signkey",
-//       .help =
-//         "revoke donau online signing key (public key must be given as 
argument)",
-//       .cb = &do_revoke_signkey
-//     },
-//     {
-//       .name = "enable-auditor",
-//       .help =
-//         "enable auditor for the donau (auditor-public key, auditor-URI and 
auditor-name must be given as arguments)",
-//       .cb = &do_add_auditor
-//     },
-//     {
-//       .name = "disable-auditor",
-//       .help =
-//         "disable auditor at the donau (auditor-public key must be given as 
argument)",
-//       .cb = &do_del_auditor
-//     },
-//     {
-//       .name = "enable-account",
-//       .help =
-//         "enable wire account of the donau (payto-URI must be given as 
argument; for optional argument see man page)",
-//       .cb = &do_add_wire
-//     },
-//     {
-//       .name = "disable-account",
-//       .help =
-//         "disable wire account of the donau (payto-URI must be given as 
argument)",
-//       .cb = &do_del_wire
-//     },
-//     {
-//       .name = "wire-fee",
-//       .help =
-//         "sign wire fees for the given year (year, wire method, wire fee, 
and closing fee must be given as arguments)",
-//       .cb = &do_set_wire_fee
-//     },
-//     {
-//       .name = "global-fee",
-//       .help =
-//         "sign global fees for the given year (year, history fee, account 
fee, purse fee, purse timeout, history expiration and the maximum number of 
free purses per account must be given as arguments)",
-//       .cb = &do_set_global_fee
-//     },
-//     {
-//       .name = "drain",
-//       .help =
-//         "drain profits from donau escrow account to regular donau operator 
account (amount, debit account configuration section and credit account 
payto://-URI must be given as arguments)",
-//       .cb = &do_drain
-//     },
-//     {
-//       .name = "add-partner",
-//       .help =
-//         "add partner donau for P2P wad transfers (partner master public 
key, partner base URL, wad fee, wad frequency and validity year must be given 
as arguments)",
-//       .cb = &do_add_partner
-//     },
-//     {
-//       .name = "aml-enable",
-//       .help =
-//         "enable AML staff member (staff member public key, legal name and 
rw (read write) or ro (read only) must be given as arguments)",
-//       .cb = &enable_aml_staff
-//     },
-//     {
-//       .name = "aml-disable",
-//       .help =
-//         "disable AML staff member (staff member public key and legal name 
must be given as arguments)",
-//       .cb = &disable_aml_staff
-//     },
-//     {
-//       .name = "upload",
-//       .help =
-//         "upload operation result to donau (to be performed online!)",
-//       .cb = &do_upload
-//     },
-//     {
-//       .name = "extensions",
-//       .help = "subcommands for extension handling",
-//       .cb = &do_work_extensions
-//     },
-//     /* list terminator */
-//     {
-//       .name = NULL,
-//     }
-//   };
-//   (void) cls;
-
-//   cmd_handler (args, cmds);
-// }
-
-
-// /**
-//  * Main function that will be run.
-//  *
-//  * @param cls closure
-//  * @param args remaining command-line arguments
-//  * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
-//  * @param cfg configuration
-//  */
-// static void
-// run (void *cls,
-//      char *const *args,
-//      const char *cfgfile,
-//      const struct GNUNET_CONFIGURATION_Handle *cfg)
-// {
-//   (void) cls;
-//   (void) cfgfile;
-//   kcfg = cfg;
-
-//   /* load extensions */
-//   GNUNET_assert (GNUNET_OK ==
-//                  TALER_extensions_init (kcfg));
-
-//   /* setup age restriction, if applicable */
-//   {
-//     const struct TALER_AgeRestrictionConfig *arc;
-
-//     if (NULL !=
-//         (arc = TALER_extensions_get_age_restriction_config ()))
-//     {
-//       ar_config  = *arc;
-//       ar_enabled = true;
-//     }
-//   }
-
-
-//   if (GNUNET_OK !=
-//       TALER_config_get_currency (kcfg,
-//                                  &currency))
-//   {
-//     global_ret = EXIT_NOTCONFIGURED;
-//     return;
-//   }
-
-//   ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
-//                           &rc);
-//   rc = GNUNET_CURL_gnunet_rc_create (ctx);
-//   GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
-//                                  NULL);
-//   next (args);
-// }
-
 
 // /**
 //  * The main function of the taler-donau-offline tool.  This tool is used to
diff --git a/src/donau-tools/taler-donau-offline.c 
b/src/donau-tools/taler-donau-offline.c
index 56e9573..c20cd7a 100644
--- a/src/donau-tools/taler-donau-offline.c
+++ b/src/donau-tools/taler-donau-offline.c
@@ -34,48 +34,6 @@
  */
 #define OP_INPUT_KEYS "donau-input-keys-0"
 
-/**
- * Name of the operation to 'disable auditor'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_DISABLE_AUDITOR "donau-disable-auditor-0"
-
-/**
- * Name of the operation to 'enable auditor'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_ENABLE_AUDITOR "donau-enable-auditor-0"
-
-/**
- * Name of the operation to 'enable wire'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_ENABLE_WIRE "donau-enable-wire-0"
-
-/**
- * Name of the operation to 'disable wire'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_DISABLE_WIRE "donau-disable-wire-0"
-
-/**
- * Name of the operation to set a 'wire-fee'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_SET_WIRE_FEE "donau-set-wire-fee-0"
-
-/**
- * Name of the operation to set a 'global-fee'
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_SET_GLOBAL_FEE "donau-set-global-fee-0"
-
 /**
  * Name of the operation to 'upload' key signatures
  * The last component --by convention-- identifies the protocol version
@@ -83,13 +41,6 @@
  */
 #define OP_UPLOAD_SIGS "donau-upload-sigs-0"
 
-/**
- * Name of the operation to 'revoke-denomination' key
- * The last component --by convention-- identifies the protocol version
- * and should be incremented whenever the JSON format of the 'argument' 
changes.
- */
-#define OP_REVOKE_DENOMINATION "donau-revoke-denomination-0"
-
 /**
  * Name of the operation to 'revoke-signkey'
  * The last component --by convention-- identifies the protocol version
@@ -104,56 +55,6 @@
  */
 #define OP_SETUP "donau-setup-0"
 
-/**
- * sign the enabled and configured extensions.
- */
-#define OP_EXTENSIONS "donau-extensions-0"
-
-/**
- * Generate message to drain profits.
- */
-#define OP_DRAIN_PROFITS "donau-drain-profits-0"
-
-/**
- * Setup AML staff.
- */
-#define OP_UPDATE_AML_STAFF "donau-add-aml-staff-0"
-
-/**
- * Setup partner donau for wad transfers.
- */
-#define OP_ADD_PARTNER "donau-add-partner-0"
-
-/**
- * Our private key, initialized in #load_offline_key().
- */
-// static struct TALER_MasterPrivateKeyP master_priv;
-
-/**
- * Our private key, initialized in #load_offline_key().
- */
-// static struct TALER_MasterPublicKeyP master_pub;
-
-/**
- * Our context for making HTTP requests.
- */
-// static struct GNUNET_CURL_Context *ctx;
-
-/**
- * Reschedule context for #ctx.
- */
-// static struct GNUNET_CURL_RescheduleContext *rc;
-
-/**
- * Handle to the donau's configuration
- */
-// static const struct GNUNET_CONFIGURATION_Handle *kcfg;
-
-/**
- * Age restriction configuration
- */
-// static bool ar_enabled = false;
-// static struct TALER_AgeRestrictionConfig ar_config = {0};
 
 /**
  * Return value from main().
@@ -205,34 +106,6 @@ struct SubCommand
 };
 
 
-/**
- * Data structure for denomination revocation requests.
- */
-struct DenomRevocationRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DenomRevocationRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DenomRevocationRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementRevokeDenominationKeyHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
 /**
  * Data structure for signkey revocation requests.
  */
@@ -261,5125 +134,6 @@ struct SignkeyRevocationRequest
 };
 
 
-/**
- * Data structure for auditor add requests.
- */
-struct AuditorAddRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorAddRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorAddRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementAuditorEnableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for auditor del requests.
- */
-struct AuditorDelRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorDelRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AuditorDelRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementAuditorDisableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for wire add requests.
- */
-struct WireAddRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireAddRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireAddRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementWireEnableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for wire del requests.
- */
-struct WireDelRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireDelRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireDelRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementWireDisableHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for announcing wire fees.
- */
-struct WireFeeRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireFeeRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct WireFeeRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementSetWireFeeHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for draining profits.
- */
-struct DrainProfitsRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DrainProfitsRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct DrainProfitsRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementDrainProfitsHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for announcing global fees.
- */
-struct GlobalFeeRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct GlobalFeeRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct GlobalFeeRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementSetGlobalFeeHandle *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Ongoing /keys request.
- */
-struct UploadKeysRequest
-{
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadKeysRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadKeysRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementPostKeysHandle *h;
-
-  /**
-   * Operation index.
-   */
-  size_t idx;
-};
-
-/**
- * Ongoing /management/extensions request.
- */
-struct UploadExtensionsRequest
-{
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadExtensionsRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct UploadExtensionsRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementPostExtensionsHandle *h;
-
-  /**
-   * Operation index.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for AML staff requests.
- */
-struct AmlStaffRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AmlStaffRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct AmlStaffRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementUpdateAmlOfficer *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Data structure for partner add requests.
- */
-struct PartnerAddRequest
-{
-
-  /**
-   * Kept in a DLL.
-   */
-  struct PartnerAddRequest *next;
-
-  /**
-   * Kept in a DLL.
-   */
-  struct PartnerAddRequest *prev;
-
-  /**
-   * Operation handle.
-   */
-  struct DONAU_ManagementAddPartner *h;
-
-  /**
-   * Array index of the associated command.
-   */
-  size_t idx;
-};
-
-
-/**
- * Next work item to perform.
- */
-// static struct GNUNET_SCHEDULER_Task *nxt;
-
-/**
- * Handle for #do_download.
- */
-// static struct DONAU_ManagementGetKeysHandle *mgkh;
-
-/**
- * Active AML staff change requests.
- */
-// static struct AmlStaffRequest *asr_head;
-
-/**
- * Active AML staff change requests.
- */
-// static struct AmlStaffRequest *asr_tail;
-
-/**
- * Active partner add requests.
- */
-//static struct PartnerAddRequest *par_head;
-
-/**
- * Active partner add requests.
- */
-// static struct PartnerAddRequest *par_tail;
-
-/**
- * Active denomiantion revocation requests.
- */
-// static struct DenomRevocationRequest *drr_head;
-
-/**
- * Active denomiantion revocation requests.
- */
-// static struct DenomRevocationRequest *drr_tail;
-
-/**
- * Active signkey revocation requests.
- */
-// static struct SignkeyRevocationRequest *srr_head;
-
-/**
- * Active signkey revocation requests.
- */
-// static struct SignkeyRevocationRequest *srr_tail;
-
-/**
- * Active auditor add requests.
- */
-// static struct AuditorAddRequest *aar_head;
-
-/**
- * Active auditor add requests.
- */
-//static struct AuditorAddRequest *aar_tail;
-
-/**
- * Active auditor del requests.
- */
-// static struct AuditorDelRequest *adr_head;
-
-/**
- * Active auditor del requests.
- */
-// static struct AuditorDelRequest *adr_tail;
-
-/**
- * Active wire add requests.
- */
-// static struct WireAddRequest *war_head;
-
-/**
- * Active wire add requests.
- */
-// static struct WireAddRequest *war_tail;
-
-/**
- * Active wire del requests.
- */
-// static struct WireDelRequest *wdr_head;
-
-/**
- * Active wire del requests.
- */
-// static struct WireDelRequest *wdr_tail;
-
-/**
- * Active wire fee requests.
- */
-// static struct WireFeeRequest *wfr_head;
-
-/**
- * Active wire fee requests.
- */
-//static struct WireFeeRequest *wfr_tail;
-
-/**
- * Active global fee requests.
- */
-//static struct GlobalFeeRequest *gfr_head;
-
-/**
- * Active global fee requests.
- */
-//static struct GlobalFeeRequest *gfr_tail;
-
-/**
- * Active keys upload requests.
- */
-//static struct UploadKeysRequest *ukr_head;
-
-/**
- * Active keys upload requests.
- */
-//static struct UploadKeysRequest *ukr_tail;
-
-/**
- * Active extensions upload requests.
- */
-//static struct UploadExtensionsRequest *uer_head;
-
-/**
- * Active extensions upload requests.
- */
-//static struct UploadExtensionsRequest *uer_tail;
-
-/**
- * Active drain profits requests.
- */
-struct DrainProfitsRequest *dpr_head;
-
-/**
- * Active drain profits requests.
- */
-//static struct DrainProfitsRequest *dpr_tail;
-
-
-/**
- * Shutdown task. Invoked when the application is being terminated.
- *
- * @param cls NULL
- */
-// static void
-// do_shutdown (void *cls)
-// {
-//   (void) cls;
-
-//   {
-//     struct AmlStaffRequest *asr;
-
-//     while (NULL != (asr = asr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete AML staff update #%u\n",
-//                   (unsigned int) asr->idx);
-//       DONAU_management_update_aml_officer_cancel (asr->h);
-//       GNUNET_CONTAINER_DLL_remove (asr_head,
-//                                    asr_tail,
-//                                    asr);
-//       GNUNET_free (asr);
-//     }
-//   }
-//   {
-//     struct PartnerAddRequest *par;
-
-//     while (NULL != (par = par_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete partner add request #%u\n",
-//                   (unsigned int) par->idx);
-//       DONAU_management_add_partner_cancel (par->h);
-//       GNUNET_CONTAINER_DLL_remove (par_head,
-//                                    par_tail,
-//                                    par);
-//       GNUNET_free (par);
-//     }
-//   }
-//   {
-//     struct DenomRevocationRequest *drr;
-
-//     while (NULL != (drr = drr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete denomination revocation #%u\n",
-//                   (unsigned int) drr->idx);
-//       DONAU_management_revoke_denomination_key_cancel (drr->h);
-//       GNUNET_CONTAINER_DLL_remove (drr_head,
-//                                    drr_tail,
-//                                    drr);
-//       GNUNET_free (drr);
-//     }
-//   }
-//   {
-//     struct SignkeyRevocationRequest *srr;
-
-//     while (NULL != (srr = srr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete signkey revocation #%u\n",
-//                   (unsigned int) srr->idx);
-//       DONAU_management_revoke_signing_key_cancel (srr->h);
-//       GNUNET_CONTAINER_DLL_remove (srr_head,
-//                                    srr_tail,
-//                                    srr);
-//       GNUNET_free (srr);
-//     }
-//   }
-
-//   {
-//     struct AuditorAddRequest *aar;
-
-//     while (NULL != (aar = aar_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete auditor add #%u\n",
-//                   (unsigned int) aar->idx);
-//       DONAU_management_enable_auditor_cancel (aar->h);
-//       GNUNET_CONTAINER_DLL_remove (aar_head,
-//                                    aar_tail,
-//                                    aar);
-//       GNUNET_free (aar);
-//     }
-//   }
-//   {
-//     struct AuditorDelRequest *adr;
-
-//     while (NULL != (adr = adr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete auditor del #%u\n",
-//                   (unsigned int) adr->idx);
-//       DONAU_management_disable_auditor_cancel (adr->h);
-//       GNUNET_CONTAINER_DLL_remove (adr_head,
-//                                    adr_tail,
-//                                    adr);
-//       GNUNET_free (adr);
-//     }
-//   }
-//   {
-//     struct WireAddRequest *war;
-
-//     while (NULL != (war = war_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete wire add #%u\n",
-//                   (unsigned int) war->idx);
-//       DONAU_management_enable_wire_cancel (war->h);
-//       GNUNET_CONTAINER_DLL_remove (war_head,
-//                                    war_tail,
-//                                    war);
-//       GNUNET_free (war);
-//     }
-//   }
-//   {
-//     struct WireDelRequest *wdr;
-
-//     while (NULL != (wdr = wdr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete wire del #%u\n",
-//                   (unsigned int) wdr->idx);
-//       DONAU_management_disable_wire_cancel (wdr->h);
-//       GNUNET_CONTAINER_DLL_remove (wdr_head,
-//                                    wdr_tail,
-//                                    wdr);
-//       GNUNET_free (wdr);
-//     }
-//   }
-//   {
-//     struct WireFeeRequest *wfr;
-
-//     while (NULL != (wfr = wfr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete wire fee #%u\n",
-//                   (unsigned int) wfr->idx);
-//       DONAU_management_set_wire_fees_cancel (wfr->h);
-//       GNUNET_CONTAINER_DLL_remove (wfr_head,
-//                                    wfr_tail,
-//                                    wfr);
-//       GNUNET_free (wfr);
-//     }
-//   }
-//   {
-//     struct GlobalFeeRequest *gfr;
-
-//     while (NULL != (gfr = gfr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete global fee #%u\n",
-//                   (unsigned int) gfr->idx);
-//       DONAU_management_set_global_fees_cancel (gfr->h);
-//       GNUNET_CONTAINER_DLL_remove (gfr_head,
-//                                    gfr_tail,
-//                                    gfr);
-//       GNUNET_free (gfr);
-//     }
-//   }
-//   {
-//     struct UploadKeysRequest *ukr;
-
-//     while (NULL != (ukr = ukr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete key signature upload #%u\n",
-//                   (unsigned int) ukr->idx);
-//       DONAU_post_management_keys_cancel (ukr->h);
-//       GNUNET_CONTAINER_DLL_remove (ukr_head,
-//                                    ukr_tail,
-//                                    ukr);
-//       GNUNET_free (ukr);
-//     }
-//   }
-//   {
-//     struct UploadExtensionsRequest *uer;
-
-//     while (NULL != (uer = uer_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete extensions signature upload #%u\n",
-//                   (unsigned int) uer->idx);
-//       DONAU_management_post_extensions_cancel (uer->h);
-//       GNUNET_CONTAINER_DLL_remove (uer_head,
-//                                    uer_tail,
-//                                    uer);
-//       GNUNET_free (uer);
-//     }
-//   }
-
-//   {
-//     struct DrainProfitsRequest *dpr;
-
-//     while (NULL != (dpr = dpr_head))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Aborting incomplete drain profits request #%u\n",
-//                   (unsigned int) dpr->idx);
-//       DONAU_management_drain_profits_cancel (dpr->h);
-//       GNUNET_CONTAINER_DLL_remove (dpr_head,
-//                                    dpr_tail,
-//                                    dpr);
-//       GNUNET_free (dpr);
-//     }
-//   }
-
-//   if (NULL != out)
-//   {
-//     json_dumpf (out,
-//                 stdout,
-//                 JSON_INDENT (2));
-//     json_decref (out);
-//     out = NULL;
-//   }
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-//                 "Input not consumed!\n");
-//     json_decref (in);
-//     in = NULL;
-//   }
-//   if (NULL != nxt)
-//   {
-//     GNUNET_SCHEDULER_cancel (nxt);
-//     nxt = NULL;
-//   }
-//   if (NULL != mgkh)
-//   {
-//     DONAU_get_management_keys_cancel (mgkh);
-//     mgkh = NULL;
-//   }
-//   if (NULL != ctx)
-//   {
-//     GNUNET_CURL_fini (ctx);
-//     ctx = NULL;
-//   }
-//   if (NULL != rc)
-//   {
-//     GNUNET_CURL_gnunet_rc_destroy (rc);
-//     rc = NULL;
-//   }
-// }
-
-
-// /**
-//  * Test if we should shut down because all tasks are done.
-//  */
-// static void
-// test_shutdown (void)
-// {
-//   if ( (NULL == drr_head) &&
-//        (NULL == par_head) &&
-//        (NULL == asr_head) &&
-//        (NULL == srr_head) &&
-//        (NULL == aar_head) &&
-//        (NULL == adr_head) &&
-//        (NULL == war_head) &&
-//        (NULL == wdr_head) &&
-//        (NULL == wfr_head) &&
-//        (NULL == gfr_head) &&
-//        (NULL == ukr_head) &&
-//        (NULL == uer_head) &&
-//        (NULL == dpr_head) &&
-//        (NULL == mgkh) &&
-//        (NULL == nxt) )
-//     GNUNET_SCHEDULER_shutdown ();
-// }
-
-
-// /**
-//  * Function to continue processing the next command.
-//  *
-//  * @param cls must be a `char *const*` with the array of
-//  *        command-line arguments to process next
-//  */
-// static void
-// work (void *cls);
-
-
-// /**
-//  * Function to schedule job to process the next command.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// next (char *const *args)
-// {
-//   GNUNET_assert (NULL == nxt);
-//   if (NULL == args[0])
-//   {
-//     test_shutdown ();
-//     return;
-//   }
-//   nxt = GNUNET_SCHEDULER_add_now (&work,
-//                                   (void *) args);
-// }
-
-
-// /**
-//  * Add an operation to the #out JSON array for processing later.
-//  *
-//  * @param op_name name of the operation
-//  * @param op_value values for the operation (consumed)
-//  */
-// static void
-// output_operation (const char *op_name,
-//                   json_t *op_value)
-// {
-//   json_t *action;
-
-//   GNUNET_break (NULL != op_value);
-//   if (NULL == out)
-//   {
-//     out = json_array ();
-//     GNUNET_assert (NULL != out);
-//   }
-//   action = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_string ("operation",
-//                              op_name),
-//     GNUNET_JSON_pack_object_steal ("arguments",
-//                                    op_value));
-//   GNUNET_assert (0 ==
-//                  json_array_append_new (out,
-//                                         action));
-// }
-
-
-// /**
-//  * Information about a subroutine for an upload.
-//  */
-// struct UploadHandler
-// {
-//   /**
-//    * Key to trigger this subroutine.
-//    */
-//   const char *key;
-
-//   /**
-//    * Function implementing an upload.
-//    *
-//    * @param donau_url URL of the donau
-//    * @param idx index of the operation we are performing
-//    * @param value arguments to drive the upload.
-//    */
-//   void (*cb)(const char *donau_url,
-//              size_t idx,
-//              const json_t *value);
-
-// };
-
-
-// /**
-//  * Load the offline key (if not yet done). Triggers shutdown on failure.
-//  *
-//  * @param do_create #GNUNET_YES if the key may be created
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// load_offline_key (int do_create)
-// {
-//   static bool done;
-//   int ret;
-//   char *fn;
-
-//   if (done)
-//     return GNUNET_OK;
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_filename (kcfg,
-//                                                "donau-offline",
-//                                                "MASTER_PRIV_FILE",
-//                                                &fn))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau-offline",
-//                                "MASTER_PRIV_FILE");
-//     test_shutdown ();
-//     return GNUNET_SYSERR;
-//   }
-//   if (GNUNET_YES !=
-//       GNUNET_DISK_file_test (fn))
-//     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-//                 "Donau master private key `%s' does not exist yet, creating 
it!\n",
-//                 fn);
-//   ret = GNUNET_CRYPTO_eddsa_key_from_file (fn,
-//                                            do_create,
-//                                            &master_priv.eddsa_priv);
-//   if (GNUNET_SYSERR == ret)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Failed to initialize master key from file `%s': %s\n",
-//                 fn,
-//                 "could not create file");
-//     GNUNET_free (fn);
-//     test_shutdown ();
-//     return GNUNET_SYSERR;
-//   }
-//   GNUNET_free (fn);
-//   GNUNET_CRYPTO_eddsa_key_get_public (&master_priv.eddsa_priv,
-//                                       &master_pub.eddsa_pub);
-//   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-//               "Using master public key %s\n",
-//               TALER_B2S (&master_pub));
-//   done = true;
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Function called with information about the post revocation operation 
result.
-//  *
-//  * @param cls closure with a `struct DenomRevocationRequest`
-//  * @param dr response data
-//  */
-// static void
-// denom_revocation_cb (
-//   void *cls,
-//   const struct DONAU_ManagementRevokeDenominationResponse *dr)
-// {
-//   struct DenomRevocationRequest *drr = cls;
-//   const struct DONAU_HttpResponse *hr = &dr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) drr->idx,
-//                 hr->http_status,
-//                 hr->hint,
-//                 TALER_JSON_get_error_hint (hr->reply));
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (drr_head,
-//                                drr_tail,
-//                                drr);
-//   GNUNET_free (drr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload denomination revocation request data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_denom_revocation (const char *donau_url,
-//                          size_t idx,
-//                          const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct TALER_DenominationHashP h_denom_pub;
-//   struct DenomRevocationRequest *drr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-//                                  &h_denom_pub),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for denomination revocation: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   drr = GNUNET_new (struct DenomRevocationRequest);
-//   drr->idx = idx;
-//   drr->h =
-//     DONAU_management_revoke_denomination_key (ctx,
-//                                               donau_url,
-//                                               &h_denom_pub,
-//                                               &master_sig,
-//                                               &denom_revocation_cb,
-//                                               drr);
-//   GNUNET_CONTAINER_DLL_insert (drr_head,
-//                                drr_tail,
-//                                drr);
-// }
-
-
-// /**
-//  * Function called with information about the post revocation operation 
result.
-//  *
-//  * @param cls closure with a `struct SignkeyRevocationRequest`
-//  * @param sr response data
-//  */
-// static void
-// signkey_revocation_cb (
-//   void *cls,
-//   const struct DONAU_ManagementRevokeSigningKeyResponse *sr)
-// {
-//   struct SignkeyRevocationRequest *srr = cls;
-//   const struct DONAU_HttpResponse *hr = &sr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) srr->idx,
-//                 hr->http_status,
-//                 hr->hint,
-//                 TALER_JSON_get_error_hint (hr->reply));
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (srr_head,
-//                                srr_tail,
-//                                srr);
-//   GNUNET_free (srr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload signkey revocation request data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_signkey_revocation (const char *donau_url,
-//                            size_t idx,
-//                            const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct DONAU_DonauPublicKeyP donau_pub;
-//   struct SignkeyRevocationRequest *srr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("donau_pub",
-//                                  &donau_pub),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for signkey revocation: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   srr = GNUNET_new (struct SignkeyRevocationRequest);
-//   srr->idx = idx;
-//   srr->h =
-//     DONAU_management_revoke_signing_key (ctx,
-//                                          donau_url,
-//                                          &donau_pub,
-//                                          &master_sig,
-//                                          &signkey_revocation_cb,
-//                                          srr);
-//   GNUNET_CONTAINER_DLL_insert (srr_head,
-//                                srr_tail,
-//                                srr);
-// }
-
-
-// /**
-//  * Function called with information about the post auditor add operation 
result.
-//  *
-//  * @param cls closure with a `struct AuditorAddRequest`
-//  * @param mer response data
-//  */
-// static void
-// auditor_add_cb (
-//   void *cls,
-//   const struct DONAU_ManagementAuditorEnableResponse *mer)
-// {
-//   struct AuditorAddRequest *aar = cls;
-//   const struct DONAU_HttpResponse *hr = &mer->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) aar->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (aar_head,
-//                                aar_tail,
-//                                aar);
-//   GNUNET_free (aar);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload auditor add data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_auditor_add (const char *donau_url,
-//                     size_t idx,
-//                     const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *auditor_url;
-//   const char *auditor_name;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct AuditorAddRequest *aar;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("auditor_url",
-//                              &auditor_url),
-//     GNUNET_JSON_spec_string ("auditor_name",
-//                              &auditor_name),
-//     GNUNET_JSON_spec_timestamp ("validity_start",
-//                                 &start_time),
-//     GNUNET_JSON_spec_fixed_auto ("auditor_pub",
-//                                  &auditor_pub),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for adding auditor: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   aar = GNUNET_new (struct AuditorAddRequest);
-//   aar->idx = idx;
-//   aar->h =
-//     DONAU_management_enable_auditor (ctx,
-//                                      donau_url,
-//                                      &auditor_pub,
-//                                      auditor_url,
-//                                      auditor_name,
-//                                      start_time,
-//                                      &master_sig,
-//                                      &auditor_add_cb,
-//                                      aar);
-//   GNUNET_CONTAINER_DLL_insert (aar_head,
-//                                aar_tail,
-//                                aar);
-// }
-
-
-// /**
-//  * Function called with information about the post auditor del operation 
result.
-//  *
-//  * @param cls closure with a `struct AuditorDelRequest`
-//  * @param mdr response data
-//  */
-// static void
-// auditor_del_cb (void *cls,
-//                 const struct
-//                 DONAU_ManagementAuditorDisableResponse *mdr)
-// {
-//   struct AuditorDelRequest *adr = cls;
-//   const struct DONAU_HttpResponse *hr = &mdr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) adr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (adr_head,
-//                                adr_tail,
-//                                adr);
-//   GNUNET_free (adr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload auditor del data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_auditor_del (const char *donau_url,
-//                     size_t idx,
-//                     const json_t *value)
-// {
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct AuditorDelRequest *adr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("auditor_pub",
-//                                  &auditor_pub),
-//     GNUNET_JSON_spec_timestamp ("validity_end",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to disable auditor: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   adr = GNUNET_new (struct AuditorDelRequest);
-//   adr->idx = idx;
-//   adr->h =
-//     DONAU_management_disable_auditor (ctx,
-//                                       donau_url,
-//                                       &auditor_pub,
-//                                       end_time,
-//                                       &master_sig,
-//                                       &auditor_del_cb,
-//                                       adr);
-//   GNUNET_CONTAINER_DLL_insert (adr_head,
-//                                adr_tail,
-//                                adr);
-// }
-
-
-// /**
-//  * Function called with information about the post wire add operation 
result.
-//  *
-//  * @param cls closure with a `struct WireAddRequest`
-//  * @param wer response data
-//  */
-// static void
-// wire_add_cb (void *cls,
-//              const struct DONAU_ManagementWireEnableResponse *wer)
-// {
-//   struct WireAddRequest *war = cls;
-//   const struct DONAU_HttpResponse *hr = &wer->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) war->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (war_head,
-//                                war_tail,
-//                                war);
-//   GNUNET_free (war);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload wire add data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_wire_add (const char *donau_url,
-//                  size_t idx,
-//                  const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig_add;
-//   struct TALER_MasterSignatureP master_sig_wire;
-//   const char *payto_uri;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct WireAddRequest *war;
-//   const char *err_name;
-//   const char *conversion_url = NULL;
-//   const json_t *debit_restrictions;
-//   const json_t *credit_restrictions;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("payto_uri",
-//                              &payto_uri),
-//     GNUNET_JSON_spec_mark_optional (
-//       GNUNET_JSON_spec_string ("conversion_url",
-//                                &conversion_url),
-//       NULL),
-//     GNUNET_JSON_spec_array_const ("debit_restrictions",
-//                                   &debit_restrictions),
-//     GNUNET_JSON_spec_array_const ("credit_restrictions",
-//                                   &credit_restrictions),
-//     GNUNET_JSON_spec_timestamp ("validity_start",
-//                                 &start_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig_add",
-//                                  &master_sig_add),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig_wire",
-//                                  &master_sig_wire),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input for adding wire account: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   {
-//     char *wire_method;
-
-//     wire_method = TALER_payto_get_method (payto_uri);
-//     if (NULL == wire_method)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto:// URI `%s' is malformed\n",
-//                   payto_uri);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//     GNUNET_free (wire_method);
-//   }
-//   {
-//     char *msg = TALER_payto_validate (payto_uri);
-
-//     if (NULL != msg)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto URI is malformed: %s\n",
-//                   msg);
-//       GNUNET_free (msg);
-//       test_shutdown ();
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       return;
-//     }
-//   }
-//   war = GNUNET_new (struct WireAddRequest);
-//   war->idx = idx;
-//   war->h =
-//     DONAU_management_enable_wire (ctx,
-//                                   donau_url,
-//                                   payto_uri,
-//                                   conversion_url,
-//                                   debit_restrictions,
-//                                   credit_restrictions,
-//                                   start_time,
-//                                   &master_sig_add,
-//                                   &master_sig_wire,
-//                                   &wire_add_cb,
-//                                   war);
-//   GNUNET_CONTAINER_DLL_insert (war_head,
-//                                war_tail,
-//                                war);
-// }
-
-
-// /**
-//  * Function called with information about the post wire del operation 
result.
-//  *
-//  * @param cls closure with a `struct WireDelRequest`
-//  * @param wdres response data
-//  */
-// static void
-// wire_del_cb (void *cls,
-//              const struct DONAU_ManagementWireDisableResponse *wdres)
-// {
-//   struct WireDelRequest *wdr = cls;
-//   const struct DONAU_HttpResponse *hr = &wdres->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) wdr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (wdr_head,
-//                                wdr_tail,
-//                                wdr);
-//   GNUNET_free (wdr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload wire del data.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_wire_del (const char *donau_url,
-//                  size_t idx,
-//                  const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *payto_uri;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct WireDelRequest *wdr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("payto_uri",
-//                              &payto_uri),
-//     GNUNET_JSON_spec_timestamp ("validity_end",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to disable wire account: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   wdr = GNUNET_new (struct WireDelRequest);
-//   wdr->idx = idx;
-//   wdr->h =
-//     DONAU_management_disable_wire (ctx,
-//                                    donau_url,
-//                                    payto_uri,
-//                                    end_time,
-//                                    &master_sig,
-//                                    &wire_del_cb,
-//                                    wdr);
-//   GNUNET_CONTAINER_DLL_insert (wdr_head,
-//                                wdr_tail,
-//                                wdr);
-// }
-
-
-// /**
-//  * Function called with information about the post wire fee operation 
result.
-//  *
-//  * @param cls closure with a `struct WireFeeRequest`
-//  * @param swr response data
-//  */
-// static void
-// wire_fee_cb (
-//   void *cls,
-//   const struct DONAU_ManagementSetWireFeeResponse *swr)
-// {
-//   struct WireFeeRequest *wfr = cls;
-//   const struct DONAU_HttpResponse *hr = &swr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) wfr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (wfr_head,
-//                                wfr_tail,
-//                                wfr);
-//   GNUNET_free (wfr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload wire fee.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_wire_fee (const char *donau_url,
-//                  size_t idx,
-//                  const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *wire_method;
-//   struct WireFeeRequest *wfr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct TALER_WireFeeSet fees;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_string ("wire_method",
-//                              &wire_method),
-//     TALER_JSON_spec_amount ("wire_fee",
-//                             currency,
-//                             &fees.wire),
-//     TALER_JSON_spec_amount ("closing_fee",
-//                             currency,
-//                             &fees.closing),
-//     GNUNET_JSON_spec_timestamp ("start_time",
-//                                 &start_time),
-//     GNUNET_JSON_spec_timestamp ("end_time",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to set wire fee: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   wfr = GNUNET_new (struct WireFeeRequest);
-//   wfr->idx = idx;
-//   wfr->h =
-//     DONAU_management_set_wire_fees (ctx,
-//                                     donau_url,
-//                                     wire_method,
-//                                     start_time,
-//                                     end_time,
-//                                     &fees,
-//                                     &master_sig,
-//                                     &wire_fee_cb,
-//                                     wfr);
-//   GNUNET_CONTAINER_DLL_insert (wfr_head,
-//                                wfr_tail,
-//                                wfr);
-// }
-
-
-// /**
-//  * Function called with information about the post global fee operation 
result.
-//  *
-//  * @param cls closure with a `struct WireFeeRequest`
-//  * @param gr response data
-//  */
-// static void
-// global_fee_cb (
-//   void *cls,
-//   const struct DONAU_ManagementSetGlobalFeeResponse *gr)
-// {
-//   struct GlobalFeeRequest *gfr = cls;
-//   const struct DONAU_HttpResponse *hr = &gr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) gfr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (gfr_head,
-//                                gfr_tail,
-//                                gfr);
-//   GNUNET_free (gfr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload global fee.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for denomination revocation
-//  */
-// static void
-// upload_global_fee (const char *donau_url,
-//                    size_t idx,
-//                    const json_t *value)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GlobalFeeRequest *gfr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct TALER_GlobalFeeSet fees;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-//   struct GNUNET_TIME_Relative purse_timeout;
-//   struct GNUNET_TIME_Relative history_expiration;
-//   uint32_t purse_account_limit;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     TALER_JSON_spec_amount ("history_fee",
-//                             currency,
-//                             &fees.history),
-//     TALER_JSON_spec_amount ("account_fee",
-//                             currency,
-//                             &fees.account),
-//     TALER_JSON_spec_amount ("purse_fee",
-//                             currency,
-//                             &fees.purse),
-//     GNUNET_JSON_spec_relative_time ("purse_timeout",
-//                                     &purse_timeout),
-//     GNUNET_JSON_spec_relative_time ("history_expiration",
-//                                     &history_expiration),
-//     GNUNET_JSON_spec_uint32 ("purse_account_limit",
-//                              &purse_account_limit),
-//     GNUNET_JSON_spec_timestamp ("start_time",
-//                                 &start_time),
-//     GNUNET_JSON_spec_timestamp ("end_time",
-//                                 &end_time),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to set wire fee: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   gfr = GNUNET_new (struct GlobalFeeRequest);
-//   gfr->idx = idx;
-//   gfr->h =
-//     DONAU_management_set_global_fees (ctx,
-//                                       donau_url,
-//                                       start_time,
-//                                       end_time,
-//                                       &fees,
-//                                       purse_timeout,
-//                                       history_expiration,
-//                                       purse_account_limit,
-//                                       &master_sig,
-//                                       &global_fee_cb,
-//                                       gfr);
-//   GNUNET_CONTAINER_DLL_insert (gfr_head,
-//                                gfr_tail,
-//                                gfr);
-// }
-
-
-// /**
-//  * Function called with information about the drain profits operation.
-//  *
-//  * @param cls closure with a `struct DrainProfitsRequest`
-//  * @param mdr response data
-//  */
-// static void
-// drain_profits_cb (
-//   void *cls,
-//   const struct DONAU_ManagementDrainResponse *mdr)
-// {
-//   struct DrainProfitsRequest *dpr = cls;
-//   const struct DONAU_HttpResponse *hr = &mdr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) dpr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (dpr_head,
-//                                dpr_tail,
-//                                dpr);
-//   GNUNET_free (dpr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload drain profit action.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for drain profits
-//  */
-// static void
-// upload_drain (const char *donau_url,
-//               size_t idx,
-//               const json_t *value)
-// {
-//   struct TALER_WireTransferIdentifierRawP wtid;
-//   struct TALER_MasterSignatureP master_sig;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct TALER_Amount amount;
-//   struct GNUNET_TIME_Timestamp date;
-//   const char *payto_uri;
-//   const char *account_section;
-//   struct DrainProfitsRequest *dpr;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("wtid",
-//                                  &wtid),
-//     TALER_JSON_spec_amount ("amount",
-//                             currency,
-//                             &amount),
-//     GNUNET_JSON_spec_timestamp ("date",
-//                                 &date),
-//     GNUNET_JSON_spec_string ("account_section",
-//                              &account_section),
-//     GNUNET_JSON_spec_string ("payto_uri",
-//                              &payto_uri),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to drain profits: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   dpr = GNUNET_new (struct DrainProfitsRequest);
-//   dpr->idx = idx;
-//   dpr->h =
-//     DONAU_management_drain_profits (ctx,
-//                                     donau_url,
-//                                     &wtid,
-//                                     &amount,
-//                                     date,
-//                                     account_section,
-//                                     payto_uri,
-//                                     &master_sig,
-//                                     &drain_profits_cb,
-//                                     dpr);
-//   GNUNET_CONTAINER_DLL_insert (dpr_head,
-//                                dpr_tail,
-//                                dpr);
-// }
-
-
-// /**
-//  * Function called with information about the post upload keys operation 
result.
-//  *
-//  * @param cls closure with a `struct UploadKeysRequest`
-//  * @param mr response data
-//  */
-// static void
-// keys_cb (
-//   void *cls,
-//   const struct DONAU_ManagementPostKeysResponse *mr)
-// {
-//   struct UploadKeysRequest *ukr = cls;
-//   const struct DONAU_HttpResponse *hr = &mr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) ukr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (ukr_head,
-//                                ukr_tail,
-//                                ukr);
-//   GNUNET_free (ukr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload (denomination and signing) key master signatures.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for POSTing keys
-//  */
-// static void
-// upload_keys (const char *donau_url,
-//              size_t idx,
-//              const json_t *value)
-// {
-//   struct DONAU_ManagementPostKeysData pkd;
-//   struct UploadKeysRequest *ukr;
-//   const char *err_name;
-//   unsigned int err_line;
-//   const json_t *denom_sigs;
-//   const json_t *signkey_sigs;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_array_const ("denom_sigs",
-//                                   &denom_sigs),
-//     GNUNET_JSON_spec_array_const ("signkey_sigs",
-//                                   &signkey_sigs),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   bool ok = true;
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to 'upload': %s#%u (skipping)\n",
-//                 err_name,
-//                 err_line);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   pkd.num_sign_sigs = json_array_size (signkey_sigs);
-//   pkd.num_denom_sigs = json_array_size (denom_sigs);
-//   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-//               "Uploading %u denomination and %u signing key signatures\n",
-//               pkd.num_denom_sigs,
-//               pkd.num_sign_sigs);
-//   pkd.sign_sigs = GNUNET_new_array (
-//     pkd.num_sign_sigs,
-//     struct DONAU_SigningKeySignature);
-//   pkd.denom_sigs = GNUNET_new_array (
-//     pkd.num_denom_sigs,
-//     struct DONAU_DenominationKeySignature);
-//   for (unsigned int i = 0; i<pkd.num_sign_sigs; i++)
-//   {
-//     struct DONAU_SigningKeySignature *ss = &pkd.sign_sigs[i];
-//     json_t *val = json_array_get (signkey_sigs,
-//                                   i);
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_fixed_auto ("donau_pub",
-//                                    &ss->donau_pub),
-//       GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                    &ss->master_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (val,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for signkey validity: %s#%u at %u 
(aborting)\n",
-//                   err_name,
-//                   err_line,
-//                   i);
-//       json_dumpf (val,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       ok = false;
-//     }
-//   }
-//   for (unsigned int i = 0; i<pkd.num_denom_sigs; i++)
-//   {
-//     struct DONAU_DenominationKeySignature *ds = &pkd.denom_sigs[i];
-//     json_t *val = json_array_get (denom_sigs,
-//                                   i);
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-//                                    &ds->h_denom_pub),
-//       GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                    &ds->master_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (val,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for denomination validity: %s#%u at %u 
(aborting)\n",
-//                   err_name,
-//                   err_line,
-//                   i);
-//       json_dumpf (val,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       ok = false;
-//     }
-//   }
-
-//   if (ok)
-//   {
-//     ukr = GNUNET_new (struct UploadKeysRequest);
-//     ukr->idx = idx;
-//     ukr->h =
-//       DONAU_post_management_keys (ctx,
-//                                   donau_url,
-//                                   &pkd,
-//                                   &keys_cb,
-//                                   ukr);
-//     GNUNET_CONTAINER_DLL_insert (ukr_head,
-//                                  ukr_tail,
-//                                  ukr);
-//   }
-//   else
-//   {
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//   }
-//   GNUNET_free (pkd.sign_sigs);
-//   GNUNET_free (pkd.denom_sigs);
-// }
-
-
-// /**
-//  * Function called with information about the post upload extensions 
operation result.
-//  *
-//  * @param cls closure with a `struct UploadExtensionsRequest`
-//  * @param er response data
-//  */
-// static void
-// extensions_cb (
-//   void *cls,
-//   const struct DONAU_ManagementPostExtensionsResponse *er)
-// {
-//   struct UploadExtensionsRequest *uer = cls;
-//   const struct DONAU_HttpResponse *hr = &er->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) uer->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (uer_head,
-//                                uer_tail,
-//                                uer);
-//   GNUNET_free (uer);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload extension configuration
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for POSTing configurations of extensions
-//  */
-// static void
-// upload_extensions (const char *donau_url,
-//                    size_t idx,
-//                    const json_t *value)
-// {
-//   const json_t *extensions;
-//   struct TALER_MasterSignatureP sig;
-//   const char *err_name;
-//   unsigned int err_line;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_object_const ("extensions",
-//                                    &extensions),
-//     GNUNET_JSON_spec_fixed_auto ("extensions_sig",
-//                                  &sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   /* 1. Parse the signed extensions */
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to set extensions: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-
-//   /* 2. Verify the signature */
-//   {
-//     struct TALER_ExtensionManifestsHashP h_manifests;
-
-//     if (GNUNET_OK !=
-//         TALER_JSON_extensions_manifests_hash (extensions,
-//                                               &h_manifests))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "couldn't hash extensions' manifests\n");
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-
-//     if (GNUNET_OK !=
-//         load_offline_key (GNUNET_NO))
-//       return;
-
-//     if (GNUNET_OK != TALER_donau_offline_extension_manifests_hash_verify (
-//           &h_manifests,
-//           &master_pub,
-//           &sig))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "invalid signature for extensions\n");
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//   }
-
-//   /* 3. Upload the extensions */
-//   {
-//     struct DONAU_ManagementPostExtensionsData ped = {
-//       .extensions = extensions,
-//       .extensions_sig = sig,
-//     };
-//     struct UploadExtensionsRequest *uer
-//       = GNUNET_new (struct UploadExtensionsRequest);
-
-//     uer->idx = idx;
-//     uer->h = DONAU_management_post_extensions (
-//       ctx,
-//       donau_url,
-//       &ped,
-//       &extensions_cb,
-//       uer);
-//     GNUNET_CONTAINER_DLL_insert (uer_head,
-//                                  uer_tail,
-//                                  uer);
-//   }
-// }
-
-
-// /**
-//  * Function called with information about the add partner operation.
-//  *
-//  * @param cls closure with a `struct PartnerAddRequest`
-//  * @param apr response data
-//  */
-// static void
-// add_partner_cb (
-//   void *cls,
-//   const struct DONAU_ManagementAddPartnerResponse *apr)
-// {
-//   struct PartnerAddRequest *par = cls;
-//   const struct DONAU_HttpResponse *hr = &apr->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) par->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (par_head,
-//                                par_tail,
-//                                par);
-//   GNUNET_free (par);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Add partner action.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for add partner
-//  */
-// static void
-// add_partner (const char *donau_url,
-//              size_t idx,
-//              const json_t *value)
-// {
-//   struct TALER_MasterPublicKeyP partner_pub;
-//   struct GNUNET_TIME_Timestamp start_date;
-//   struct GNUNET_TIME_Timestamp end_date;
-//   struct GNUNET_TIME_Relative wad_frequency;
-//   struct TALER_Amount wad_fee;
-//   const char *partner_base_url;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct PartnerAddRequest *par;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("partner_pub",
-//                                  &partner_pub),
-//     TALER_JSON_spec_amount ("wad_fee",
-//                             currency,
-//                             &wad_fee),
-//     GNUNET_JSON_spec_relative_time ("wad_frequency",
-//                                     &wad_frequency),
-//     GNUNET_JSON_spec_timestamp ("start_date",
-//                                 &start_date),
-//     GNUNET_JSON_spec_timestamp ("end_date",
-//                                 &end_date),
-//     GNUNET_JSON_spec_string ("partner_base_url",
-//                              &partner_base_url),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *err_name;
-//   unsigned int err_line;
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to add partner: %s#%u at %u (skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   par = GNUNET_new (struct PartnerAddRequest);
-//   par->idx = idx;
-//   par->h =
-//     DONAU_management_add_partner (ctx,
-//                                   donau_url,
-//                                   &partner_pub,
-//                                   start_date,
-//                                   end_date,
-//                                   wad_frequency,
-//                                   &wad_fee,
-//                                   partner_base_url,
-//                                   &master_sig,
-//                                   &add_partner_cb,
-//                                   par);
-//   GNUNET_CONTAINER_DLL_insert (par_head,
-//                                par_tail,
-//                                par);
-// }
-
-
-// /**
-//  * Function called with information about the AML officer update operation.
-//  *
-//  * @param cls closure with a `struct AmlStaffRequest`
-//  * @param ar response data
-//  */
-// static void
-// update_aml_officer_cb (
-//   void *cls,
-//   const struct DONAU_ManagementUpdateAmlOfficerResponse *ar)
-// {
-//   struct AmlStaffRequest *asr = cls;
-//   const struct DONAU_HttpResponse *hr = &ar->hr;
-
-//   if (MHD_HTTP_NO_CONTENT != hr->http_status)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Upload failed for command %u with status %u: %s (%s)\n",
-//                 (unsigned int) asr->idx,
-//                 hr->http_status,
-//                 TALER_ErrorCode_get_hint (hr->ec),
-//                 hr->hint);
-//     global_ret = EXIT_FAILURE;
-//   }
-//   GNUNET_CONTAINER_DLL_remove (asr_head,
-//                                asr_tail,
-//                                asr);
-//   GNUNET_free (asr);
-//   test_shutdown ();
-// }
-
-
-// /**
-//  * Upload AML staff action.
-//  *
-//  * @param donau_url base URL of the donau
-//  * @param idx index of the operation we are performing (for logging)
-//  * @param value arguments for AML staff change
-//  */
-// static void
-// update_aml_staff (const char *donau_url,
-//                   size_t idx,
-//                   const json_t *value)
-// {
-//   struct TALER_AmlOfficerPublicKeyP officer_pub;
-//   const char *officer_name;
-//   struct GNUNET_TIME_Timestamp change_date;
-//   bool is_active;
-//   bool read_only;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct AmlStaffRequest *asr;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto ("officer_pub",
-//                                  &officer_pub),
-//     GNUNET_JSON_spec_timestamp ("change_date",
-//                                 &change_date),
-//     GNUNET_JSON_spec_bool ("is_active",
-//                            &is_active),
-//     GNUNET_JSON_spec_bool ("read_only",
-//                            &read_only),
-//     GNUNET_JSON_spec_string ("officer_name",
-//                              &officer_name),
-//     GNUNET_JSON_spec_fixed_auto ("master_sig",
-//                                  &master_sig),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *err_name;
-//   unsigned int err_line;
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (value,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to AML staff update: %s#%u at %u 
(skipping)\n",
-//                 err_name,
-//                 err_line,
-//                 (unsigned int) idx);
-//     json_dumpf (value,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return;
-//   }
-//   asr = GNUNET_new (struct AmlStaffRequest);
-//   asr->idx = idx;
-//   asr->h =
-//     DONAU_management_update_aml_officer (ctx,
-//                                          donau_url,
-//                                          &officer_pub,
-//                                          officer_name,
-//                                          change_date,
-//                                          is_active,
-//                                          read_only,
-//                                          &master_sig,
-//                                          &update_aml_officer_cb,
-//                                          asr);
-//   GNUNET_CONTAINER_DLL_insert (asr_head,
-//                                asr_tail,
-//                                asr);
-// }
-
-
-// /**
-//  * Perform uploads based on the JSON in #out.
-//  *
-//  * @param donau_url base URL of the donau to use
-//  */
-// static void
-// trigger_upload (const char *donau_url)
-// {
-//   struct UploadHandler uhs[] = {
-//     {
-//       .key = OP_REVOKE_DENOMINATION,
-//       .cb = &upload_denom_revocation
-//     },
-//     {
-//       .key = OP_REVOKE_SIGNKEY,
-//       .cb = &upload_signkey_revocation
-//     },
-//     {
-//       .key = OP_ENABLE_AUDITOR,
-//       .cb = &upload_auditor_add
-//     },
-//     {
-//       .key = OP_DISABLE_AUDITOR,
-//       .cb = &upload_auditor_del
-//     },
-//     {
-//       .key = OP_ENABLE_WIRE,
-//       .cb = &upload_wire_add
-//     },
-//     {
-//       .key = OP_DISABLE_WIRE,
-//       .cb = &upload_wire_del
-//     },
-//     {
-//       .key = OP_SET_WIRE_FEE,
-//       .cb = &upload_wire_fee
-//     },
-//     {
-//       .key = OP_SET_GLOBAL_FEE,
-//       .cb = &upload_global_fee
-//     },
-//     {
-//       .key = OP_UPLOAD_SIGS,
-//       .cb = &upload_keys
-//     },
-//     {
-//       .key = OP_DRAIN_PROFITS,
-//       .cb = &upload_drain
-//     },
-//     {
-//       .key = OP_EXTENSIONS,
-//       .cb = &upload_extensions
-//     },
-//     {
-//       .key = OP_UPDATE_AML_STAFF,
-//       .cb = &update_aml_staff
-//     },
-//     {
-//       .key = OP_ADD_PARTNER,
-//       .cb = &add_partner
-//     },
-//     /* array termination */
-//     {
-//       .key = NULL
-//     }
-//   };
-//   size_t index;
-//   json_t *obj;
-
-//   json_array_foreach (out, index, obj) {
-//     bool found = false;
-//     const char *key;
-//     const json_t *value;
-
-//     key = json_string_value (json_object_get (obj, "operation"));
-//     value = json_object_get (obj, "arguments");
-//     if (NULL == key)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Malformed JSON input\n");
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//     /* block of code that uses key and value */
-//     for (unsigned int i = 0; NULL != uhs[i].key; i++)
-//     {
-//       if (0 == strcasecmp (key,
-//                            uhs[i].key))
-//       {
-
-//         found = true;
-//         uhs[i].cb (donau_url,
-//                    index,
-//                    value);
-//         break;
-//       }
-//     }
-//     if (! found)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Upload does not know how to handle `%s'\n",
-//                   key);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return;
-//     }
-//   }
-// }
-
-
-// /**
-//  * Upload operation result (signatures) to donau.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_upload (char *const *args)
-// {
-//   (void) args;
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing upload\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if (NULL == out)
-//   {
-//     json_error_t err;
-
-//     out = json_loadf (stdin,
-//                       JSON_REJECT_DUPLICATES,
-//                       &err);
-//     if (NULL == out)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to read JSON input: %s at %d:%s (offset: %d)\n",
-//                   err.text,
-//                   err.line,
-//                   err.source,
-//                   err.position);
-//       test_shutdown ();
-//       global_ret = EXIT_FAILURE;
-//       return;
-//     }
-//   }
-//   if (! json_is_array (out))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Error: expected JSON array for `upload` command\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == CFG_donau_url) &&
-//        (GNUNET_OK !=
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau",
-//                                                "BASE_URL",
-//                                                &CFG_donau_url)) )
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau",
-//                                "BASE_URL");
-//     global_ret = EXIT_NOTCONFIGURED;
-//     test_shutdown ();
-//     return;
-//   }
-//   trigger_upload (CFG_donau_url);
-//   json_decref (out);
-//   out = NULL;
-// }
-
-
-// /**
-//  * Revoke denomination key.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_revoke_denomination_key (char *const *args)
-// {
-//   struct TALER_DenominationHashP h_denom_pub;
-//   struct TALER_MasterSignatureP master_sig;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing revocation\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &h_denom_pub,
-//                                        sizeof (h_denom_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify a denomination key with this 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_denomination_revoke_sign (&h_denom_pub,
-//                                                 &master_priv,
-//                                                 &master_sig);
-//   output_operation (OP_REVOKE_DENOMINATION,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("h_denom_pub",
-//                                                   &h_denom_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Revoke signkey.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_revoke_signkey (char *const *args)
-// {
-//   struct DONAU_DonauPublicKeyP donau_pub;
-//   struct TALER_MasterSignatureP master_sig;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing revocation\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &donau_pub,
-//                                        sizeof (donau_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an donau signing key with this 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_signkey_revoke_sign (&donau_pub,
-//                                            &master_priv,
-//                                            &master_sig);
-//   output_operation (OP_REVOKE_SIGNKEY,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("donau_pub",
-//                                                   &donau_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Add auditor.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the auditor's public key, args[1] the auditor's
-//  *        API base URL, and args[2] the auditor's name.
-//  */
-// static void
-// do_add_auditor (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct GNUNET_TIME_Timestamp now;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not adding auditor\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &auditor_pub,
-//                                        sizeof (auditor_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an auditor public key as first argument 
for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-
-//   if ( (NULL == args[1]) ||
-//        (0 != strncmp ("http",
-//                       args[1],
-//                       strlen ("http"))) ||
-//        (NULL == args[2]) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an auditor URI and auditor name as 2nd 
and 3rd arguments to this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   now = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_auditor_add_sign (&auditor_pub,
-//                                         args[1],
-//                                         now,
-//                                         &master_priv,
-//                                         &master_sig);
-//   output_operation (OP_ENABLE_AUDITOR,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("auditor_url",
-//                                                args[1]),
-//                       GNUNET_JSON_pack_string ("auditor_name",
-//                                                args[2]),
-//                       GNUNET_JSON_pack_timestamp ("validity_start",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("auditor_pub",
-//                                                   &auditor_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 3);
-// }
-
-
-// /**
-//  * Disable auditor account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_del_auditor (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct TALER_AuditorPublicKeyP auditor_pub;
-//   struct GNUNET_TIME_Timestamp now;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not deleting auditor 
account\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &auditor_pub,
-//                                        sizeof (auditor_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify an auditor public key as first argument 
for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   now = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_auditor_del_sign (&auditor_pub,
-//                                         now,
-//                                         &master_priv,
-//                                         &master_sig);
-//   output_operation (OP_DISABLE_AUDITOR,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("auditor_pub",
-//                                                   &auditor_pub),
-//                       GNUNET_JSON_pack_timestamp ("validity_end",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Parse account restriction.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  * @param[in,out] restrictions JSON array to update
-//  * @return -1 on error, otherwise number of arguments from @a args that 
were used
-//  */
-// static int
-// parse_restriction (char *const *args,
-//                    json_t *restrictions)
-// {
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Restriction TYPE argument missing\n");
-//     return -1;
-//   }
-//   if (0 == strcmp (args[0],
-//                    "deny"))
-//   {
-//     GNUNET_assert (0 ==
-//                    json_array_append_new (
-//                      restrictions,
-//                      GNUNET_JSON_PACK (
-//                        GNUNET_JSON_pack_string ("type",
-//                                                 "deny"))));
-//     return 1;
-//   }
-//   if (0 == strcmp (args[0],
-//                    "regex"))
-//   {
-//     json_t *i18n;
-//     json_error_t err;
-
-//     if ( (NULL == args[1]) ||
-//          (NULL == args[2]) ||
-//          (NULL == args[3]) )
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Mandatory arguments for restriction of type `regex' 
missing (REGEX, HINT, HINT-I18 required)\n");
-//       return -1;
-//     }
-//     {
-//       regex_t ex;
-
-//       if (0 != regcomp (&ex,
-//                         args[1],
-//                         REG_NOSUB | REG_EXTENDED))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "Invalid regular expression `%s'\n",
-//                     args[1]);
-//         return -1;
-//       }
-//       regfree (&ex);
-//     }
-
-//     i18n = json_loads (args[3],
-//                        JSON_REJECT_DUPLICATES,
-//                        &err);
-//     if (NULL == i18n)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid JSON for restriction of type `regex': `%s` at 
%d\n",
-//                   args[3],
-//                   err.position);
-//       return -1;
-//     }
-//     GNUNET_assert (0 ==
-//                    json_array_append_new (
-//                      restrictions,
-//                      GNUNET_JSON_PACK (
-//                        GNUNET_JSON_pack_string ("type",
-//                                                 "regex"),
-//                        GNUNET_JSON_pack_string ("regex",
-//                                                 args[1]),
-//                        GNUNET_JSON_pack_string ("human_hint",
-//                                                 args[2]),
-//                        GNUNET_JSON_pack_object_steal ("human_hint_i18n",
-//                                                       i18n)
-//                        )));
-//     return 4;
-//   }
-//   GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//               "Restriction TYPE `%s' unsupported\n",
-//               args[0]);
-//   return -1;
-// }
-
-
-// /**
-//  * Add wire account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_add_wire (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig_add;
-//   struct TALER_MasterSignatureP master_sig_wire;
-//   struct GNUNET_TIME_Timestamp now;
-//   const char *conversion_url = NULL;
-//   json_t *debit_restrictions;
-//   json_t *credit_restrictions;
-//   unsigned int num_args = 1;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not adding wire 
account\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify a payto://-URI with this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   {
-//     char *msg = TALER_payto_validate (args[0]);
-
-//     if (NULL != msg)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto URI is malformed: %s\n",
-//                   msg);
-//       GNUNET_free (msg);
-//       test_shutdown ();
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       return;
-//     }
-//   }
-//   now = GNUNET_TIME_timestamp_get ();
-//   {
-//     char *wire_method;
-
-//     wire_method = TALER_payto_get_method (args[0]);
-//     if (NULL == wire_method)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "payto:// URI `%s' is malformed\n",
-//                   args[0]);
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       test_shutdown ();
-//       return;
-//     }
-//     GNUNET_free (wire_method);
-//   }
-//   debit_restrictions = json_array ();
-//   GNUNET_assert (NULL != debit_restrictions);
-//   credit_restrictions = json_array ();
-//   GNUNET_assert (NULL != credit_restrictions);
-//   while (NULL != args[num_args])
-//   {
-//     if (0 == strcmp (args[num_args],
-//                      "conversion-url"))
-//     {
-//       num_args++;
-//       conversion_url = args[num_args];
-//       if (NULL == conversion_url)
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "'conversion-url' requires an argument\n");
-//         global_ret = EXIT_INVALIDARGUMENT;
-//         test_shutdown ();
-//         json_decref (debit_restrictions);
-//         json_decref (credit_restrictions);
-//         return;
-//       }
-//       num_args++;
-//       continue;
-//     }
-//     if (0 == strcmp (args[num_args],
-//                      "credit-restriction"))
-//     {
-//       int iret;
-
-//       num_args++;
-//       iret = parse_restriction (&args[num_args],
-//                                 credit_restrictions);
-//       if (iret <= 0)
-//       {
-//         global_ret = EXIT_INVALIDARGUMENT;
-//         test_shutdown ();
-//         json_decref (debit_restrictions);
-//         json_decref (credit_restrictions);
-//         return;
-//       }
-//       num_args += iret;
-//       continue;
-//     }
-//     if (0 == strcmp (args[num_args],
-//                      "debit-restriction"))
-//     {
-//       int iret;
-
-//       num_args++;
-//       iret = parse_restriction (&args[num_args],
-//                                 debit_restrictions);
-//       if (iret <= 0)
-//       {
-//         global_ret = EXIT_INVALIDARGUMENT;
-//         test_shutdown ();
-//         json_decref (debit_restrictions);
-//         json_decref (credit_restrictions);
-//         return;
-//       }
-//       num_args += iret;
-//       continue;
-//     }
-//     break;
-//   }
-//   TALER_donau_offline_wire_add_sign (args[0],
-//                                      conversion_url,
-//                                      debit_restrictions,
-//                                      credit_restrictions,
-//                                      now,
-//                                      &master_priv,
-//                                      &master_sig_add);
-//   TALER_donau_wire_signature_make (args[0],
-//                                    conversion_url,
-//                                    debit_restrictions,
-//                                    credit_restrictions,
-//                                    &master_priv,
-//                                    &master_sig_wire);
-//   output_operation (OP_ENABLE_WIRE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("payto_uri",
-//                                                args[0]),
-//                       GNUNET_JSON_pack_array_steal ("debit_restrictions",
-//                                                     debit_restrictions),
-//                       GNUNET_JSON_pack_array_steal ("credit_restrictions",
-//                                                     credit_restrictions),
-//                       GNUNET_JSON_pack_allow_null (
-//                         GNUNET_JSON_pack_string ("conversion_url",
-//                                                  conversion_url)),
-//                       GNUNET_JSON_pack_timestamp ("validity_start",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("master_sig_add",
-//                                                   &master_sig_add),
-//                       GNUNET_JSON_pack_data_auto ("master_sig_wire",
-//                                                   &master_sig_wire)));
-//   next (args + num_args);
-// }
-
-
-// /**
-//  * Disable wire account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the hash of the denomination key to revoke
-//  */
-// static void
-// do_del_wire (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GNUNET_TIME_Timestamp now;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not deleting wire 
account\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify a payto://-URI with this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   now = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_wire_del_sign (args[0],
-//                                      now,
-//                                      &master_priv,
-//                                      &master_sig);
-//   output_operation (OP_DISABLE_WIRE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("payto_uri",
-//                                                args[0]),
-//                       GNUNET_JSON_pack_timestamp ("validity_end",
-//                                                   now),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 1);
-// }
-
-
-// /**
-//  * Set wire fees for the given year.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the year, args[1] the wire method, args[2] the 
wire fee and args[3]
-//  *        the closing fee.
-//  */
-// static void
-// do_set_wire_fee (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   char dummy;
-//   unsigned int year;
-//   struct TALER_WireFeeSet fees;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not setting wire fee\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) ||
-//        (NULL == args[3]) ||
-//        ( (1 != sscanf (args[0],
-//                        "%u%c",
-//                        &year,
-//                        &dummy)) &&
-//          (0 != strcasecmp ("now",
-//                            args[0])) ) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[2],
-//                                 &fees.wire)) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[3],
-//                                 &fees.closing)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must use YEAR, METHOD, WIRE-FEE, and CLOSING-FEE as 
arguments for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (0 == strcasecmp ("now",
-//                        args[0]))
-//     year = GNUNET_TIME_get_current_year ();
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   start_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year));
-//   end_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year + 1));
-
-//   TALER_donau_offline_wire_fee_sign (args[1],
-//                                      start_time,
-//                                      end_time,
-//                                      &fees,
-//                                      &master_priv,
-//                                      &master_sig);
-//   output_operation (OP_SET_WIRE_FEE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("wire_method",
-//                                                args[1]),
-//                       GNUNET_JSON_pack_timestamp ("start_time",
-//                                                   start_time),
-//                       GNUNET_JSON_pack_timestamp ("end_time",
-//                                                   end_time),
-//                       TALER_JSON_pack_amount ("wire_fee",
-//                                               &fees.wire),
-//                       TALER_JSON_pack_amount ("closing_fee",
-//                                               &fees.closing),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 4);
-// }
-
-
-// /**
-//  * Set global fees for the given year.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the year, args[1] the history fee, args[2]
-//  *        the account fee and args[3] the purse fee. These are followed by 
args[4] purse timeout,
-//  *        args[5] history expiration. Last is args[6] the (free) purse 
account limit.
-//  */
-// static void
-// do_set_global_fee (char *const *args)
-// {
-//   struct TALER_MasterSignatureP master_sig;
-//   char dummy;
-//   unsigned int year;
-//   struct TALER_GlobalFeeSet fees;
-//   struct GNUNET_TIME_Relative purse_timeout;
-//   struct GNUNET_TIME_Relative history_expiration;
-//   unsigned int purse_account_limit;
-//   struct GNUNET_TIME_Timestamp start_time;
-//   struct GNUNET_TIME_Timestamp end_time;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not setting global 
fee\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) ||
-//        (NULL == args[3]) ||
-//        (NULL == args[4]) ||
-//        (NULL == args[5]) ||
-//        (NULL == args[6]) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must use YEAR, HISTORY-FEE, ACCOUNT-FEE, PURSE-FEE, 
PURSE-TIMEOUT, HISTORY-EXPIRATION and PURSE-ACCOUNT-LIMIT as arguments for this 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (1 != sscanf (args[0],
-//                      "%u%c",
-//                      &year,
-//                      &dummy)) &&
-//        (0 != strcasecmp ("now",
-//                          args[0])) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid YEAR given for 'global-fee' subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (GNUNET_OK !=
-//         TALER_string_to_amount (args[1],
-//                                 &fees.history)) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[2],
-//                                 &fees.account)) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[3],
-//                                 &fees.purse)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid amount given for 'global-fee' subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (GNUNET_OK !=
-//         GNUNET_STRINGS_fancy_time_to_relative (args[4],
-//                                                &purse_timeout)) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_fancy_time_to_relative (args[5],
-//                                                &history_expiration)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid delay given for 'global-fee' subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (1 != sscanf (args[6],
-//                    "%u%c",
-//                    &purse_account_limit,
-//                    &dummy))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid purse account limit given for 'global-fee' 
subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (0 == strcasecmp ("now",
-//                        args[0]))
-//     year = GNUNET_TIME_get_current_year ();
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   start_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year));
-//   end_time = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year + 1));
-
-//   TALER_donau_offline_global_fee_sign (start_time,
-//                                        end_time,
-//                                        &fees,
-//                                        purse_timeout,
-//                                        history_expiration,
-//                                        (uint32_t) purse_account_limit,
-//                                        &master_priv,
-//                                        &master_sig);
-//   output_operation (OP_SET_GLOBAL_FEE,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_timestamp ("start_time",
-//                                                   start_time),
-//                       GNUNET_JSON_pack_timestamp ("end_time",
-//                                                   end_time),
-//                       TALER_JSON_pack_amount ("history_fee",
-//                                               &fees.history),
-//                       TALER_JSON_pack_amount ("account_fee",
-//                                               &fees.account),
-//                       TALER_JSON_pack_amount ("purse_fee",
-//                                               &fees.purse),
-//                       GNUNET_JSON_pack_time_rel ("purse_timeout",
-//                                                  purse_timeout),
-//                       GNUNET_JSON_pack_time_rel ("history_expiration",
-//                                                  history_expiration),
-//                       GNUNET_JSON_pack_uint64 ("purse_account_limit",
-//                                                (uint32_t) 
purse_account_limit),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 7);
-// }
-
-
-// /**
-//  * Drain profits from donau's escrow account to
-//  * regular donau account.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the amount,
-//  *        args[1] must be the section of the escrow account to drain
-//  *        args[2] must be the payto://-URI of the target account
-//  */
-// static void
-// do_drain (char *const *args)
-// {
-//   struct TALER_WireTransferIdentifierRawP wtid;
-//   struct GNUNET_TIME_Timestamp date;
-//   struct TALER_Amount amount;
-//   const char *account_section;
-//   const char *payto_uri;
-//   struct TALER_MasterSignatureP master_sig;
-//   char *err;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, refusing drain\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[0],
-//                                 &amount)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Drain requires an amount, section name and target 
payto://-URI as arguments\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (NULL == args[1]) ||
-//        (NULL == args[2]) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Drain requires an amount, section name and target 
payto://-URI as arguments\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       TALER_string_to_amount (args[0],
-//                               &amount))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid amount `%s' specified for drain\n",
-//                 args[0]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   account_section = args[1];
-//   payto_uri = args[2];
-//   err = TALER_payto_validate (payto_uri);
-//   if (NULL != err)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid payto://-URI `%s' specified for drain: %s\n",
-//                 payto_uri,
-//                 err);
-//     GNUNET_free (err);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
-//                               &wtid,
-//                               sizeof (wtid));
-//   date = GNUNET_TIME_timestamp_get ();
-//   TALER_donau_offline_profit_drain_sign (&wtid,
-//                                          date,
-//                                          &amount,
-//                                          account_section,
-//                                          payto_uri,
-//                                          &master_priv,
-//                                          &master_sig);
-//   output_operation (OP_DRAIN_PROFITS,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_data_auto ("wtid",
-//                                                   &wtid),
-//                       GNUNET_JSON_pack_string ("account_section",
-//                                                account_section),
-//                       GNUNET_JSON_pack_string ("payto_uri",
-//                                                payto_uri),
-//                       TALER_JSON_pack_amount ("amount",
-//                                               &amount),
-//                       GNUNET_JSON_pack_timestamp ("date",
-//                                                   date),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 3);
-// }
-
-
-// /**
-//  * Add partner.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the partner's master public key, args[1] the 
partner's
-//  *        API base URL, args[2] the wad fee, args[3] the wad frequency, and
-//  *        args[4] the year (including possibly 'now')
-//  */
-// static void
-// do_add_partner (char *const *args)
-// {
-//   struct TALER_MasterPublicKeyP partner_pub;
-//   struct GNUNET_TIME_Timestamp start_date;
-//   struct GNUNET_TIME_Timestamp end_date;
-//   struct GNUNET_TIME_Relative wad_frequency;
-//   struct TALER_Amount wad_fee;
-//   const char *partner_base_url;
-//   struct TALER_MasterSignatureP master_sig;
-//   char dummy;
-//   unsigned int year;
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not adding partner\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &partner_pub,
-//                                        sizeof (partner_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the partner master public key as first 
argument for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[1]) ||
-//        (0 != strncmp ("http",
-//                       args[1],
-//                       strlen ("http"))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the partner's base URL as the 2nd 
argument to this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   partner_base_url = args[1];
-//   if ( (NULL == args[2]) ||
-//        (GNUNET_OK !=
-//         TALER_string_to_amount (args[2],
-//                                 &wad_fee)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid amount `%s' specified for wad fee of partner\n",
-//                 args[2]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[3]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_fancy_time_to_relative (args[3],
-//                                                &wad_frequency)) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid wad frequency `%s' specified for add partner\n",
-//                 args[3]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if ( (NULL == args[4]) ||
-//        ( (1 != sscanf (args[4],
-//                        "%u%c",
-//                        &year,
-//                        &dummy)) &&
-//          (0 != strcasecmp ("now",
-//                            args[4])) ) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid year `%s' specified for add partner\n",
-//                 args[4]);
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (0 == strcasecmp ("now",
-//                        args[4]))
-//     year = GNUNET_TIME_get_current_year ();
-//   start_date = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year));
-//   end_date = GNUNET_TIME_absolute_to_timestamp (
-//     GNUNET_TIME_year_to_time (year + 1));
-
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_partner_details_sign (&partner_pub,
-//                                             start_date,
-//                                             end_date,
-//                                             wad_frequency,
-//                                             &wad_fee,
-//                                             partner_base_url,
-//                                             &master_priv,
-//                                             &master_sig);
-//   output_operation (OP_ADD_PARTNER,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("partner_base_url",
-//                                                partner_base_url),
-//                       GNUNET_JSON_pack_time_rel ("wad_frequency",
-//                                                  wad_frequency),
-//                       GNUNET_JSON_pack_timestamp ("start_date",
-//                                                   start_date),
-//                       GNUNET_JSON_pack_timestamp ("end_date",
-//                                                   end_date),
-//                       GNUNET_JSON_pack_data_auto ("partner_pub",
-//                                                   &partner_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + 5);
-// }
-
-
-// /**
-//  * Enable or disable AML staff.
-//  *
-//  * @param is_active true to enable, false to disable
-//  * @param args the array of command-line arguments to process next; args[0] 
must be the AML staff's public key, args[1] the AML staff's legal name, and if 
@a is_active then args[2] rw (read write) or ro (read only)
-//  */
-// static void
-// do_set_aml_staff (bool is_active,
-//                   char *const *args)
-// {
-//   struct TALER_AmlOfficerPublicKeyP officer_pub;
-//   const char *officer_name;
-//   bool read_only;
-//   struct TALER_MasterSignatureP master_sig;
-//   struct GNUNET_TIME_Timestamp now
-//     = GNUNET_TIME_timestamp_get ();
-
-//   if (NULL != in)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Downloaded data was not consumed, not updating AML staff 
status\n");
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   if ( (NULL == args[0]) ||
-//        (GNUNET_OK !=
-//         GNUNET_STRINGS_string_to_data (args[0],
-//                                        strlen (args[0]),
-//                                        &officer_pub,
-//                                        sizeof (officer_pub))) )
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the AML officer's public key as first 
argument for this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   if (NULL == args[1])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must specify the officer's legal name as the 2nd 
argument to this subcommand\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-//   officer_name = args[1];
-//   if (is_active)
-//   {
-//     if ( (NULL == args[2]) ||
-//          ( (0 != strcmp (args[2],
-//                          "ro")) &&
-//            (0 != strcmp (args[2],
-//                          "rw")) ) )
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "You must specify 'ro' or 'rw' (and not `%s') for the 
access level\n",
-//                   args[2]);
-//       test_shutdown ();
-//       global_ret = EXIT_INVALIDARGUMENT;
-//       return;
-//     }
-//     read_only = (0 == strcmp (args[2],
-//                               "ro"));
-//   }
-//   else
-//   {
-//     read_only = true;
-//   }
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   TALER_donau_offline_aml_officer_status_sign (&officer_pub,
-//                                                officer_name,
-//                                                now,
-//                                                is_active,
-//                                                read_only,
-//                                                &master_priv,
-//                                                &master_sig);
-//   output_operation (OP_UPDATE_AML_STAFF,
-//                     GNUNET_JSON_PACK (
-//                       GNUNET_JSON_pack_string ("officer_name",
-//                                                officer_name),
-//                       GNUNET_JSON_pack_timestamp ("change_date",
-//                                                   now),
-//                       GNUNET_JSON_pack_bool ("is_active",
-//                                              is_active),
-//                       GNUNET_JSON_pack_bool ("read_only",
-//                                              read_only),
-//                       GNUNET_JSON_pack_data_auto ("officer_pub",
-//                                                   &officer_pub),
-//                       GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                   &master_sig)));
-//   next (args + (is_active ? 3 : 2));
-// }
-
-
-// /**
-//  * Disable AML staff.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the AML staff's public key, args[1] the AML 
staff's legal name, args[2] rw (read write) or ro (read only)
-//  */
-// static void
-// disable_aml_staff (char *const *args)
-// {
-//   do_set_aml_staff (false,
-//                     args);
-// }
-
-
-// /**
-//  * Enable AML staff.
-//  *
-//  * @param args the array of command-line arguments to process next;
-//  *        args[0] must be the AML staff's public key, args[1] the AML 
staff's legal name, args[2] rw (read write) or ro (read only)
-//  */
-// static void
-// enable_aml_staff (char *const *args)
-// {
-//   do_set_aml_staff (true,
-//                     args);
-// }
-
-
-// /**
-//  * Function called with information about future keys.  Dumps the JSON 
output
-//  * (on success), either into an internal buffer or to stdout (depending on
-//  * whether there are subsequent commands).
-//  *
-//  * @param cls closure with the `char **` remaining args
-//  * @param mgr response data
-//  */
-// static void
-// download_cb (void *cls,
-//              const struct DONAU_ManagementGetKeysResponse *mgr)
-// {
-//   char *const *args = cls;
-//   const struct DONAU_HttpResponse *hr = &mgr->hr;
-
-//   mgkh = NULL;
-//   switch (hr->http_status)
-//   {
-//   case MHD_HTTP_OK:
-//     break;
-//   default:
-//     if (0 != hr->http_status)
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to download keys from `%s': %s (HTTP status: 
%u/%u)\n",
-//                   CFG_donau_url,
-//                   hr->hint,
-//                   hr->http_status,
-//                   (unsigned int) hr->ec);
-//     else
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to download keys from `%s' (no HTTP response)\n",
-//                   CFG_donau_url);
-//     test_shutdown ();
-//     global_ret = EXIT_FAILURE;
-//     return;
-//   }
-//   in = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_string ("operation",
-//                              OP_INPUT_KEYS),
-//     GNUNET_JSON_pack_object_incref ("arguments",
-//                                     (json_t *) hr->reply));
-//   if (NULL == args[0])
-//   {
-//     json_dumpf (in,
-//                 stdout,
-//                 JSON_INDENT (2));
-//     json_decref (in);
-//     in = NULL;
-//   }
-//   next (args);
-// }
-
-
-// /**
-//  * Download future keys.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_download (char *const *args)
-// {
-//   if ( (NULL == CFG_donau_url) &&
-//        (GNUNET_OK !=
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau",
-//                                                "BASE_URL",
-//                                                &CFG_donau_url)) )
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau",
-//                                "BASE_URL");
-//     test_shutdown ();
-//     global_ret = EXIT_NOTCONFIGURED;
-//     return;
-//   }
-//   mgkh = DONAU_get_management_keys (ctx,
-//                                     CFG_donau_url,
-//                                     &download_cb,
-//                                     (void *) args);
-// }
-
-
-// /**
-//  * Check that the security module keys are the same as before.  If we had no
-//  * keys in store before, remember them (Trust On First Use).
-//  *
-//  * @param secmset security module keys
-//  * @return #GNUNET_OK if keys match with what we have in store
-//  *         #GNUNET_NO if we had nothing in store but now do
-//  *         #GNUNET_SYSERR if keys changed from what we remember or other 
error
-//  */
-// static enum GNUNET_GenericReturnValue
-// tofu_check (const struct TALER_SecurityModulePublicKeySetP *secmset)
-// {
-//   char *fn;
-//   struct TALER_SecurityModulePublicKeySetP oldset;
-//   ssize_t ret;
-
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_filename (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_TOFU_FILE",
-//                                                &fn))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau-offline",
-//                                "SECM_TOFU_FILE");
-//     return GNUNET_SYSERR;
-//   }
-//   if (GNUNET_OK ==
-//       GNUNET_DISK_file_test (fn))
-//   {
-//     ret = GNUNET_DISK_fn_read (fn,
-//                                &oldset,
-//                                sizeof (oldset));
-//     if (GNUNET_SYSERR != ret)
-//     {
-//       if (ret != sizeof (oldset))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "File `%s' corrupt\n",
-//                     fn);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       /* TOFU check */
-//       if (0 != memcmp (&oldset,
-//                        secmset,
-//                        sizeof (*secmset)))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "Fatal: security module keys changed (file `%s')!\n",
-//                     fn);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (fn);
-//       return GNUNET_OK;
-//     }
-//   }
-
-//   {
-//     char *key;
-
-//     /* check against SECMOD-keys pinned in configuration */
-//     if (GNUNET_OK ==
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_ESIGN_PUBKEY",
-//                                                &key))
-//     {
-//       struct TALER_SecurityModulePublicKeyP k;
-
-//       if (GNUNET_OK !=
-//           GNUNET_STRINGS_string_to_data (key,
-//                                          strlen (key),
-//                                          &k,
-//                                          sizeof (k)))
-//       {
-//         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                    "donau-offline",
-//                                    "SECM_ESIGN_PUBKEY",
-//                                    "key malformed");
-//         GNUNET_free (key);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (key);
-//       if (0 !=
-//           GNUNET_memcmp (&k,
-//                          &secmset->eddsa))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "ESIGN security module key does not match 
SECM_ESIGN_PUBKEY in configuration\n");
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//     }
-//     if (GNUNET_OK ==
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_DENOM_PUBKEY",
-//                                                &key))
-//     {
-//       struct TALER_SecurityModulePublicKeyP k;
-
-//       if (GNUNET_OK !=
-//           GNUNET_STRINGS_string_to_data (key,
-//                                          strlen (key),
-//                                          &k,
-//                                          sizeof (k)))
-//       {
-//         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                    "donau-offline",
-//                                    "SECM_DENOM_PUBKEY",
-//                                    "key malformed");
-//         GNUNET_free (key);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (key);
-//       if (0 !=
-//           GNUNET_memcmp (&k,
-//                          &secmset->rsa))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "DENOM security module key does not match 
SECM_DENOM_PUBKEY in configuration\n");
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//     }
-//     if (GNUNET_OK ==
-//         GNUNET_CONFIGURATION_get_value_string (kcfg,
-//                                                "donau-offline",
-//                                                "SECM_DENOM_CS_PUBKEY",
-//                                                &key))
-//     {
-//       struct TALER_SecurityModulePublicKeyP k;
-
-//       if (GNUNET_OK !=
-//           GNUNET_STRINGS_string_to_data (key,
-//                                          strlen (key),
-//                                          &k,
-//                                          sizeof (k)))
-//       {
-//         GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                    "donau-offline",
-//                                    "SECM_DENOM_CS_PUBKEY",
-//                                    "key malformed");
-//         GNUNET_free (key);
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//       GNUNET_free (key);
-//       if (0 !=
-//           GNUNET_memcmp (&k,
-//                          &secmset->cs))
-//       {
-//         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                     "DENOM security module key does not match 
SECM_DENOM_CS_PUBKEY in configuration\n");
-//         GNUNET_free (fn);
-//         return GNUNET_SYSERR;
-//       }
-//     }
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_DISK_directory_create_for_file (fn))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Failed create directory to store key material in file 
`%s'\n",
-//                 fn);
-//     GNUNET_free (fn);
-//     return GNUNET_SYSERR;
-//   }
-//   /* persist keys for future runs */
-//   if (GNUNET_OK !=
-//       GNUNET_DISK_fn_write (fn,
-//                             secmset,
-//                             sizeof (oldset),
-//                             GNUNET_DISK_PERM_USER_READ))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Failed to store key material in file `%s'\n",
-//                 fn);
-//     GNUNET_free (fn);
-//     return GNUNET_SYSERR;
-//   }
-//   GNUNET_free (fn);
-//   return GNUNET_NO;
-// }
-
-
-// /**
-//  * Output @a signkeys for human consumption.
-//  *
-//  * @param secm_pub security module public key used to sign the denominations
-//  * @param signkeys keys to output
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// show_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
-//                const json_t *signkeys)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (signkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     struct DONAU_DonauPublicKeyP donau_pub;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_TIME_Timestamp start_time;
-//     struct GNUNET_TIME_Timestamp sign_end;
-//     struct GNUNET_TIME_Timestamp legal_end;
-//     struct GNUNET_TIME_Relative duration;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &start_time),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire",
-//                                   &sign_end),
-//       GNUNET_JSON_spec_timestamp ("stamp_end",
-//                                   &legal_end),
-//       GNUNET_JSON_spec_fixed_auto ("key",
-//                                    &donau_pub),
-//       GNUNET_JSON_spec_fixed_auto ("signkey_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for signing key to 'show': %s#%u at %u 
(skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     duration = GNUNET_TIME_absolute_get_difference (start_time.abs_time,
-//                                                     sign_end.abs_time);
-//     if (GNUNET_OK !=
-//         TALER_donau_secmod_eddsa_verify (&donau_pub,
-//                                          start_time,
-//                                          duration,
-//                                          secm_pub,
-//                                          &secm_sig))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid security module signature for signing key %s 
(aborting)\n",
-//                   TALER_B2S (&donau_pub));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     {
-//       char *legal_end_s;
-
-//       legal_end_s = GNUNET_strdup (
-//         GNUNET_TIME_timestamp2s (legal_end));
-//       printf ("DONAU-KEY %s starting at %s (used for: %s, legal end: %s)\n",
-//               TALER_B2S (&donau_pub),
-//               GNUNET_TIME_timestamp2s (start_time),
-//               GNUNET_TIME_relative2s (duration,
-//                                       false),
-//               legal_end_s);
-//       GNUNET_free (legal_end_s);
-//     }
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Output @a denomkeys for human consumption.
-//  *
-//  * @param secm_pub_rsa security module public key used to sign the RSA 
denominations
-//  * @param secm_pub_cs security module public key used to sign the CS 
denominations
-//  * @param denomkeys keys to output
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa,
-//                 const struct TALER_SecurityModulePublicKeyP *secm_pub_cs,
-//                 const json_t *denomkeys)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (denomkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     const char *section_name;
-//     struct TALER_DenominationPublicKey denom_pub;
-//     struct GNUNET_TIME_Timestamp stamp_start;
-//     struct GNUNET_TIME_Timestamp stamp_expire_withdraw;
-//     struct GNUNET_TIME_Timestamp stamp_expire_deposit;
-//     struct GNUNET_TIME_Timestamp stamp_expire_legal;
-//     struct TALER_Amount coin_value;
-//     struct TALER_DenomFeeSet fees;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_string ("section_name",
-//                                &section_name),
-//       TALER_JSON_spec_denom_pub ("denom_pub",
-//                                  &denom_pub),
-//       TALER_JSON_spec_amount ("value",
-//                               currency,
-//                               &coin_value),
-//       TALER_JSON_SPEC_DENOM_FEES ("fee",
-//                                   currency,
-//                                   &fees),
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &stamp_start),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw",
-//                                   &stamp_expire_withdraw),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_deposit",
-//                                   &stamp_expire_deposit),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_legal",
-//                                   &stamp_expire_legal),
-//       GNUNET_JSON_spec_fixed_auto ("denom_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-//     struct GNUNET_TIME_Relative duration;
-//     struct TALER_DenominationHashP h_denom_pub;
-//     enum GNUNET_GenericReturnValue ok;
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for denomination key to 'show': %s#%u at 
%u (skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       GNUNET_JSON_parse_free (spec);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     duration = GNUNET_TIME_absolute_get_difference (
-//       stamp_start.abs_time,
-//       stamp_expire_withdraw.abs_time);
-//     TALER_denom_pub_hash (&denom_pub,
-//                           &h_denom_pub);
-//     switch (denom_pub.cipher)
-//     {
-//     case TALER_DENOMINATION_RSA:
-//       {
-//         struct TALER_RsaPubHashP h_rsa;
-
-//         TALER_rsa_pub_hash (denom_pub.details.rsa_public_key,
-//                             &h_rsa);
-//         ok = TALER_donau_secmod_rsa_verify (&h_rsa,
-//                                             section_name,
-//                                             stamp_start,
-//                                             duration,
-//                                             secm_pub_rsa,
-//                                             &secm_sig);
-//       }
-//       break;
-//     case TALER_DENOMINATION_CS:
-//       {
-//         struct TALER_CsPubHashP h_cs;
-
-//         TALER_cs_pub_hash (&denom_pub.details.cs_public_key,
-//                            &h_cs);
-//         ok = TALER_donau_secmod_cs_verify (&h_cs,
-//                                            section_name,
-//                                            stamp_start,
-//                                            duration,
-//                                            secm_pub_cs,
-//                                            &secm_sig);
-//       }
-//       break;
-//     default:
-//       GNUNET_break (0);
-//       ok = GNUNET_SYSERR;
-//       break;
-//     }
-//     if (GNUNET_OK != ok)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid security module signature for denomination key 
%s (aborting)\n",
-//                   GNUNET_h2s (&h_denom_pub.hash));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-
-//     {
-//       char *withdraw_fee_s;
-//       char *deposit_fee_s;
-//       char *refresh_fee_s;
-//       char *refund_fee_s;
-//       char *deposit_s;
-//       char *legal_s;
-
-//       withdraw_fee_s = TALER_amount_to_string (&fees.withdraw);
-//       deposit_fee_s = TALER_amount_to_string (&fees.deposit);
-//       refresh_fee_s = TALER_amount_to_string (&fees.refresh);
-//       refund_fee_s = TALER_amount_to_string (&fees.refund);
-//       deposit_s = GNUNET_strdup (
-//         GNUNET_TIME_timestamp2s (stamp_expire_deposit));
-//       legal_s = GNUNET_strdup (
-//         GNUNET_TIME_timestamp2s (stamp_expire_legal));
-
-//       printf (
-//         "DENOMINATION-KEY(%s) %s of value %s starting at %s "
-//         "(used for: %s, deposit until: %s legal end: %s) with fees 
%s/%s/%s/%s\n",
-//         section_name,
-//         TALER_B2S (&h_denom_pub),
-//         TALER_amount2s (&coin_value),
-//         GNUNET_TIME_timestamp2s (stamp_start),
-//         GNUNET_TIME_relative2s (duration,
-//                                 false),
-//         deposit_s,
-//         legal_s,
-//         withdraw_fee_s,
-//         deposit_fee_s,
-//         refresh_fee_s,
-//         refund_fee_s);
-//       GNUNET_free (withdraw_fee_s);
-//       GNUNET_free (deposit_fee_s);
-//       GNUNET_free (refresh_fee_s);
-//       GNUNET_free (refund_fee_s);
-//       GNUNET_free (deposit_s);
-//       GNUNET_free (legal_s);
-//     }
-
-//     GNUNET_JSON_parse_free (spec);
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Parse the input of donau keys for the 'show' and 'sign' commands.
-//  *
-//  * @param command_name name of the command, for logging
-//  * @return NULL on error, otherwise the keys details to be free'd by caller
-//  */
-// static json_t *
-// parse_keys_input (const char *command_name)
-// {
-//   const char *op_str;
-//   json_t *keys;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_json ("arguments",
-//                            &keys),
-//     GNUNET_JSON_spec_string ("operation",
-//                              &op_str),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *err_name;
-//   unsigned int err_line;
-
-//   if (NULL == in)
-//   {
-//     json_error_t err;
-
-//     in = json_loadf (stdin,
-//                      JSON_REJECT_DUPLICATES,
-//                      &err);
-//     if (NULL == in)
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Failed to read JSON input: %s at %d:%s (offset: %d)\n",
-//                   err.text,
-//                   err.line,
-//                   err.source,
-//                   err.position);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return NULL;
-//     }
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (in,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to '%s': %s#%u (skipping)\n",
-//                 command_name,
-//                 err_name,
-//                 err_line);
-//     json_dumpf (in,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     return NULL;
-//   }
-//   if (0 != strcmp (op_str,
-//                    OP_INPUT_KEYS))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to '%s' : operation is `%s', expected 
`%s'\n",
-//                 command_name,
-//                 op_str,
-//                 OP_INPUT_KEYS);
-//     GNUNET_JSON_parse_free (spec);
-//     return NULL;
-//   }
-//   json_decref (in);
-//   in = NULL;
-//   return keys;
-// }
-
-
-// /**
-//  * Show future keys.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_show (char *const *args)
-// {
-//   json_t *keys;
-//   const char *err_name;
-//   unsigned int err_line;
-//   const json_t *denomkeys;
-//   const json_t *signkeys;
-//   struct TALER_MasterPublicKeyP mpub;
-//   struct TALER_SecurityModulePublicKeySetP secmset;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_array_const ("future_denoms",
-//                                   &denomkeys),
-//     GNUNET_JSON_spec_array_const ("future_signkeys",
-//                                   &signkeys),
-//     GNUNET_JSON_spec_fixed_auto ("master_pub",
-//                                  &mpub),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
-//                                  &secmset.rsa),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_cs_public_key",
-//                                  &secmset.cs),
-//     GNUNET_JSON_spec_fixed_auto ("signkey_secmod_public_key",
-//                                  &secmset.eddsa),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   keys = parse_keys_input ("show");
-//   if (NULL == keys)
-//     return;
-
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//     return;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (keys,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to 'show': %s #%u (skipping)\n",
-//                 err_name,
-//                 err_line);
-//     json_dumpf (in,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (0 !=
-//       GNUNET_memcmp (&master_pub,
-//                      &mpub))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Fatal: donau uses different master key!\n");
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (GNUNET_SYSERR ==
-//       tofu_check (&secmset))
-//   {
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if ( (GNUNET_OK !=
-//         show_signkeys (&secmset.eddsa,
-//                        signkeys)) ||
-//        (GNUNET_OK !=
-//         show_denomkeys (&secmset.rsa,
-//                         &secmset.cs,
-//                         denomkeys)) )
-//   {
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   json_decref (keys);
-//   next (args);
-// }
-
-
-// /**
-//  * Sign @a signkeys with offline key.
-//  *
-//  * @param secm_pub security module public key used to sign the denominations
-//  * @param signkeys keys to output
-//  * @param[in,out] result array where to output the signatures
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// sign_signkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub,
-//                const json_t *signkeys,
-//                json_t *result)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (signkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     struct DONAU_DonauPublicKeyP donau_pub;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_TIME_Timestamp start_time;
-//     struct GNUNET_TIME_Timestamp sign_end;
-//     struct GNUNET_TIME_Timestamp legal_end;
-//     struct GNUNET_TIME_Relative duration;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &start_time),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire",
-//                                   &sign_end),
-//       GNUNET_JSON_spec_timestamp ("stamp_end",
-//                                   &legal_end),
-//       GNUNET_JSON_spec_fixed_auto ("key",
-//                                    &donau_pub),
-//       GNUNET_JSON_spec_fixed_auto ("signkey_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for signing key to 'show': %s #%u at %u 
(skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-
-//     duration = GNUNET_TIME_absolute_get_difference (start_time.abs_time,
-//                                                     sign_end.abs_time);
-//     if (GNUNET_OK !=
-//         TALER_donau_secmod_eddsa_verify (&donau_pub,
-//                                          start_time,
-//                                          duration,
-//                                          secm_pub,
-//                                          &secm_sig))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid security module signature for signing key %s 
(aborting)\n",
-//                   TALER_B2S (&donau_pub));
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       GNUNET_JSON_parse_free (spec);
-//       return GNUNET_SYSERR;
-//     }
-//     {
-//       struct TALER_MasterSignatureP master_sig;
-
-//       TALER_donau_offline_signkey_validity_sign (&donau_pub,
-//                                                  start_time,
-//                                                  sign_end,
-//                                                  legal_end,
-//                                                  &master_priv,
-//                                                  &master_sig);
-//       GNUNET_assert (0 ==
-//                      json_array_append_new (
-//                        result,
-//                        GNUNET_JSON_PACK (
-//                          GNUNET_JSON_pack_data_auto ("donau_pub",
-//                                                      &donau_pub),
-//                          GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                      &master_sig))));
-//     }
-//     GNUNET_JSON_parse_free (spec);
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Looks up the AGE_RESTRICTED setting for a denomination in the config and
-//  * returns the age restriction (mask) accordingly.
-//  *
-//  * @param section_name Section in the configuration for the particular
-//  *    denomination.
-//  */
-// static struct TALER_AgeMask
-// load_age_mask (const char*section_name)
-// {
-//   static const struct TALER_AgeMask null_mask = {0};
-//   enum GNUNET_GenericReturnValue ret;
-
-//   if (! ar_enabled)
-//     return null_mask;
-
-//   if (GNUNET_OK != (GNUNET_CONFIGURATION_have_value (
-//                       kcfg,
-//                       section_name,
-//                       "AGE_RESTRICTED")))
-//     return null_mask;
-
-//   ret = GNUNET_CONFIGURATION_get_value_yesno (kcfg,
-//                                               section_name,
-//                                               "AGE_RESTRICTED");
-//   if (GNUNET_SYSERR == ret)
-//     GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
-//                                section_name,
-//                                "AGE_RESTRICTED",
-//                                "Value must be YES or NO\n");
-//   if (GNUNET_YES == ret)
-//     return ar_config.mask;
-
-//   return null_mask;
-// }
-
-
-// /**
-//  * Sign @a denomkeys with offline key.
-//  *
-//  * @param secm_pub_rsa security module public key used to sign the RSA 
denominations
-//  * @param secm_pub_cs security module public key used to sign the CS 
denominations
-//  * @param denomkeys keys to output
-//  * @param[in,out] result array where to output the signatures
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa,
-//                 const struct TALER_SecurityModulePublicKeyP *secm_pub_cs,
-//                 const json_t *denomkeys,
-//                 json_t *result)
-// {
-//   size_t index;
-//   json_t *value;
-
-//   json_array_foreach (denomkeys, index, value) {
-//     const char *err_name;
-//     unsigned int err_line;
-//     const char *section_name;
-//     struct TALER_DenominationPublicKey denom_pub;
-//     struct GNUNET_TIME_Timestamp stamp_start;
-//     struct GNUNET_TIME_Timestamp stamp_expire_withdraw;
-//     struct GNUNET_TIME_Timestamp stamp_expire_deposit;
-//     struct GNUNET_TIME_Timestamp stamp_expire_legal;
-//     struct TALER_Amount coin_value;
-//     struct TALER_DenomFeeSet fees;
-//     struct TALER_SecurityModuleSignatureP secm_sig;
-//     struct GNUNET_JSON_Specification spec[] = {
-//       GNUNET_JSON_spec_string ("section_name",
-//                                &section_name),
-//       TALER_JSON_spec_denom_pub ("denom_pub",
-//                                  &denom_pub),
-//       TALER_JSON_spec_amount ("value",
-//                               currency,
-//                               &coin_value),
-//       TALER_JSON_SPEC_DENOM_FEES ("fee",
-//                                   currency,
-//                                   &fees),
-//       GNUNET_JSON_spec_timestamp ("stamp_start",
-//                                   &stamp_start),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw",
-//                                   &stamp_expire_withdraw),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_deposit",
-//                                   &stamp_expire_deposit),
-//       GNUNET_JSON_spec_timestamp ("stamp_expire_legal",
-//                                   &stamp_expire_legal),
-//       GNUNET_JSON_spec_fixed_auto ("denom_secmod_sig",
-//                                    &secm_sig),
-//       GNUNET_JSON_spec_end ()
-//     };
-//     struct GNUNET_TIME_Relative duration;
-//     struct TALER_DenominationHashP h_denom_pub;
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (value,
-//                            spec,
-//                            &err_name,
-//                            &err_line))
-//     {
-//       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                   "Invalid input for denomination key to 'sign': %s #%u at 
%u (skipping)\n",
-//                   err_name,
-//                   err_line,
-//                   (unsigned int) index);
-//       json_dumpf (value,
-//                   stderr,
-//                   JSON_INDENT (2));
-//       GNUNET_JSON_parse_free (spec);
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       return GNUNET_SYSERR;
-//     }
-//     duration = GNUNET_TIME_absolute_get_difference (
-//       stamp_start.abs_time,
-//       stamp_expire_withdraw.abs_time);
-
-//     /* Load the age mask, if applicable to this denomination */
-//     denom_pub.age_mask = load_age_mask (section_name);
-
-//     TALER_denom_pub_hash (&denom_pub,
-//                           &h_denom_pub);
-//     switch (denom_pub.cipher)
-//     {
-//     case TALER_DENOMINATION_RSA:
-//       {
-//         struct TALER_RsaPubHashP h_rsa;
-
-//         TALER_rsa_pub_hash (denom_pub.details.rsa_public_key,
-//                             &h_rsa);
-//         if (GNUNET_OK !=
-//             TALER_donau_secmod_rsa_verify (&h_rsa,
-//                                            section_name,
-//                                            stamp_start,
-//                                            duration,
-//                                            secm_pub_rsa,
-//                                            &secm_sig))
-//         {
-//           GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                       "Invalid security module signature for denomination 
key %s (aborting)\n",
-//                       GNUNET_h2s (&h_denom_pub.hash));
-//           global_ret = EXIT_FAILURE;
-//           test_shutdown ();
-//           GNUNET_JSON_parse_free (spec);
-//           return GNUNET_SYSERR;
-//         }
-//       }
-//       break;
-//     case TALER_DENOMINATION_CS:
-//       {
-//         struct TALER_CsPubHashP h_cs;
-
-//         TALER_cs_pub_hash (&denom_pub.details.cs_public_key,
-//                            &h_cs);
-//         if (GNUNET_OK !=
-//             TALER_donau_secmod_cs_verify (&h_cs,
-//                                           section_name,
-//                                           stamp_start,
-//                                           duration,
-//                                           secm_pub_cs,
-//                                           &secm_sig))
-//         {
-//           GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                       "Invalid security module signature for denomination 
key %s (aborting)\n",
-//                       GNUNET_h2s (&h_denom_pub.hash));
-//           global_ret = EXIT_FAILURE;
-//           test_shutdown ();
-//           GNUNET_JSON_parse_free (spec);
-//           return GNUNET_SYSERR;
-//         }
-//       }
-//       break;
-//     default:
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       GNUNET_JSON_parse_free (spec);
-//       return GNUNET_SYSERR;
-//     }
-
-//     {
-//       struct TALER_MasterSignatureP master_sig;
-
-//       TALER_donau_offline_denom_validity_sign (&h_denom_pub,
-//                                                stamp_start,
-//                                                stamp_expire_withdraw,
-//                                                stamp_expire_deposit,
-//                                                stamp_expire_legal,
-//                                                &coin_value,
-//                                                &fees,
-//                                                &master_priv,
-//                                                &master_sig);
-//       GNUNET_assert (0 ==
-//                      json_array_append_new (
-//                        result,
-//                        GNUNET_JSON_PACK (
-//                          GNUNET_JSON_pack_data_auto ("h_denom_pub",
-//                                                      &h_denom_pub),
-//                          GNUNET_JSON_pack_data_auto ("master_sig",
-//                                                      &master_sig))));
-//     }
-//     GNUNET_JSON_parse_free (spec);
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Sign future keys.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_sign (char *const *args)
-// {
-//   json_t *keys;
-//   const char *err_name;
-//   unsigned int err_line;
-//   const json_t *denomkeys;
-//   const json_t *signkeys;
-//   struct TALER_MasterPublicKeyP mpub;
-//   struct TALER_SecurityModulePublicKeySetP secmset;
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_array_const ("future_denoms",
-//                                   &denomkeys),
-//     GNUNET_JSON_spec_array_const ("future_signkeys",
-//                                   &signkeys),
-//     GNUNET_JSON_spec_fixed_auto ("master_pub",
-//                                  &mpub),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_public_key",
-//                                  &secmset.rsa),
-//     GNUNET_JSON_spec_fixed_auto ("denom_secmod_cs_public_key",
-//                                  &secmset.cs),
-//     GNUNET_JSON_spec_fixed_auto ("signkey_secmod_public_key",
-//                                  &secmset.eddsa),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   keys = parse_keys_input ("sign");
-//   if (NULL == keys)
-//     return;
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//   {
-//     json_decref (keys);
-//     return;
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (keys,
-//                          spec,
-//                          &err_name,
-//                          &err_line))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Invalid input to 'sign' : %s #%u (skipping)\n",
-//                 err_name,
-//                 err_line);
-//     json_dumpf (in,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (0 !=
-//       GNUNET_memcmp (&master_pub,
-//                      &mpub))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Fatal: donau uses different master key!\n");
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   if (GNUNET_SYSERR ==
-//       tofu_check (&secmset))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Fatal: security module keys changed!\n");
-//     global_ret = EXIT_FAILURE;
-//     test_shutdown ();
-//     json_decref (keys);
-//     return;
-//   }
-//   {
-//     json_t *signkey_sig_array = json_array ();
-//     json_t *denomkey_sig_array = json_array ();
-
-//     GNUNET_assert (NULL != signkey_sig_array);
-//     GNUNET_assert (NULL != denomkey_sig_array);
-//     if ( (GNUNET_OK !=
-//           sign_signkeys (&secmset.eddsa,
-//                          signkeys,
-//                          signkey_sig_array)) ||
-//          (GNUNET_OK !=
-//           sign_denomkeys (&secmset.rsa,
-//                           &secmset.cs,
-//                           denomkeys,
-//                           denomkey_sig_array)) )
-//     {
-//       global_ret = EXIT_FAILURE;
-//       test_shutdown ();
-//       json_decref (signkey_sig_array);
-//       json_decref (denomkey_sig_array);
-//       json_decref (keys);
-//       return;
-//     }
-
-//     output_operation (OP_UPLOAD_SIGS,
-//                       GNUNET_JSON_PACK (
-//                         GNUNET_JSON_pack_array_steal ("denom_sigs",
-//                                                       denomkey_sig_array),
-//                         GNUNET_JSON_pack_array_steal ("signkey_sigs",
-//                                                       signkey_sig_array)));
-//   }
-//   json_decref (keys);
-//   next (args);
-// }
-
-
-// /**
-//  * Setup and output offline signing key.
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_setup (char *const *args)
-// {
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_YES))
-//   {
-//     global_ret = EXIT_NOPERMISSION;
-//     return;
-//   }
-//   if (NULL != *args)
-//   {
-//     output_operation (OP_SETUP,
-//                       GNUNET_JSON_PACK (
-//                         GNUNET_JSON_pack_data_auto ("donau_offline_pub",
-//                                                     &master_pub)));
-//   }
-
-//   else
-//   {
-//     char *pub_s;
-
-//     pub_s = GNUNET_STRINGS_data_to_string_alloc (&master_pub,
-//                                                  sizeof (master_pub));
-//     fprintf (stdout,
-//              "%s\n",
-//              pub_s);
-//     GNUNET_free (pub_s);
-//   }
-//   if ( (NULL != *args) &&
-//        (0 == strcmp (*args,
-//                      "-")) )
-//     args++;
-//   next (args);
-// }
-
-
-// /**
-//  * Print the current extensions as configured
-//  *
-//  * @param args the array of command-line arguments to process next
-//  */
-// static void
-// do_extensions_show (char *const *args)
-// {
-//   const struct TALER_Extensions *it;
-//   json_t *exts = json_object ();
-//   json_t *obj;
-
-//   GNUNET_assert (NULL != exts);
-//   for (it = TALER_extensions_get_head ();
-//        NULL != it && NULL != it->extension;
-//        it = it->next)
-//   {
-//     const struct TALER_Extension *extension = it->extension;
-//     int ret;
-
-//     ret = json_object_set_new (exts,
-//                                extension->name,
-//                                extension->manifest (extension));
-//     GNUNET_assert (-1 != ret);
-//   }
-
-//   obj = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_object_steal ("extensions",
-//                                    exts));
-//   GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//               "%s\n",
-//               json_dumps (obj,
-//                           JSON_INDENT (2)));
-//   json_decref (obj);
-//   next (args);
-// }
-
-
-// /**
-//  * Sign the configurations of the enabled extensions
-//  */
-// static void
-// do_extensions_sign (char *const *args)
-// {
-//   json_t *extensions = json_object ();
-//   struct TALER_ExtensionManifestsHashP h_manifests;
-//   struct TALER_MasterSignatureP sig;
-//   const struct TALER_Extensions *it;
-//   bool found = false;
-//   json_t *obj;
-
-//   GNUNET_assert (NULL != extensions);
-//   for (it = TALER_extensions_get_head ();
-//        NULL != it && NULL != it->extension;
-//        it = it->next)
-//   {
-//     const struct TALER_Extension *ext = it->extension;
-//     GNUNET_assert (ext);
-
-//     found = true;
-
-//     GNUNET_assert (0 ==
-//                    json_object_set_new (extensions,
-//                                         ext->name,
-//                                         ext->manifest (ext)));
-//   }
-
-//   if (! found)
-//     return;
-
-//   if (GNUNET_OK !=
-//       TALER_JSON_extensions_manifests_hash (extensions,
-//                                             &h_manifests))
-//   {
-//     json_decref (extensions);
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "error while hashing manifest for extensions\n");
-//     return;
-//   }
-
-//   if (GNUNET_OK !=
-//       load_offline_key (GNUNET_NO))
-//   {
-//     json_decref (extensions);
-//     return;
-//   }
-
-//   TALER_donau_offline_extension_manifests_hash_sign (&h_manifests,
-//                                                      &master_priv,
-//                                                      &sig);
-//   obj = GNUNET_JSON_PACK (
-//     GNUNET_JSON_pack_object_steal ("extensions",
-//                                    extensions),
-//     GNUNET_JSON_pack_data_auto (
-//       "extensions_sig",
-//       &sig));
-
-//   output_operation (OP_EXTENSIONS,
-//                     obj);
-//   next (args);
-// }
-
-
-// /**
-//  * Dispatch @a args in the @a cmds array.
-//  *
-//  * @param args arguments with subcommand to dispatch
-//  * @param cmds array of possible subcommands to call
-//  */
-// static void
-// cmd_handler (char *const *args,
-//              const struct SubCommand *cmds)
-// {
-//   nxt = NULL;
-//   for (unsigned int i = 0; NULL != cmds[i].name; i++)
-//   {
-//     if (0 == strcasecmp (cmds[i].name,
-//                          args[0]))
-//     {
-//       cmds[i].cb (&args[1]);
-//       return;
-//     }
-//   }
-
-//   if (0 != strcasecmp ("help",
-//                        args[0]))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//                 "Unexpected command `%s'\n",
-//                 args[0]);
-//     global_ret = EXIT_INVALIDARGUMENT;
-//   }
-
-//   GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//               "Supported subcommands:\n");
-//   for (unsigned int i = 0; NULL != cmds[i].name; i++)
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
-//                 "- %s: %s\n",
-//                 cmds[i].name,
-//                 cmds[i].help);
-//   }
-//   json_decref (out);
-//   out = NULL;
-//   GNUNET_SCHEDULER_shutdown ();
-// }
-
-
-// static void
-// do_work_extensions (char *const *args)
-// {
-//   struct SubCommand cmds[] = {
-//     {
-//       .name = "show",
-//       .help =
-//         "show the extensions in the Taler-config and their configured 
parameters",
-//       .cb = &do_extensions_show
-//     },
-//     {
-//       .name = "sign",
-//       .help =
-//         "sign the configuration of the extensions and publish it with the 
donau",
-//       .cb = &do_extensions_sign
-//     },
-//     {
-//       .name = NULL,
-//     }
-//   };
-
-//   if (NULL == args[0])
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "You must provide a subcommand: `show` or `sign`.\n");
-//     test_shutdown ();
-//     global_ret = EXIT_INVALIDARGUMENT;
-//     return;
-//   }
-
-//   cmd_handler (args, cmds);
-// }
-
-
-// static void
-// work (void *cls)
-// {
-//   char *const *args = cls;
-//   struct SubCommand cmds[] = {
-//     {
-//       .name = "setup",
-//       .help =
-//         "initialize offline key signing material and display public offline 
key",
-//       .cb = &do_setup
-//     },
-//     {
-//       .name = "download",
-//       .help =
-//         "obtain future public keys from donau (to be performed online!)",
-//       .cb = &do_download
-//     },
-//     {
-//       .name = "show",
-//       .help =
-//         "display future public keys from donau for human review (pass '-' 
as argument to disable consuming input)",
-//       .cb = &do_show
-//     },
-//     {
-//       .name = "sign",
-//       .help = "sign all future public keys from the input",
-//       .cb = &do_sign
-//     },
-//     {
-//       .name = "revoke-denomination",
-//       .help =
-//         "revoke denomination key (hash of public key must be given as 
argument)",
-//       .cb = &do_revoke_denomination_key
-//     },
-//     {
-//       .name = "revoke-signkey",
-//       .help =
-//         "revoke donau online signing key (public key must be given as 
argument)",
-//       .cb = &do_revoke_signkey
-//     },
-//     {
-//       .name = "enable-auditor",
-//       .help =
-//         "enable auditor for the donau (auditor-public key, auditor-URI and 
auditor-name must be given as arguments)",
-//       .cb = &do_add_auditor
-//     },
-//     {
-//       .name = "disable-auditor",
-//       .help =
-//         "disable auditor at the donau (auditor-public key must be given as 
argument)",
-//       .cb = &do_del_auditor
-//     },
-//     {
-//       .name = "enable-account",
-//       .help =
-//         "enable wire account of the donau (payto-URI must be given as 
argument; for optional argument see man page)",
-//       .cb = &do_add_wire
-//     },
-//     {
-//       .name = "disable-account",
-//       .help =
-//         "disable wire account of the donau (payto-URI must be given as 
argument)",
-//       .cb = &do_del_wire
-//     },
-//     {
-//       .name = "wire-fee",
-//       .help =
-//         "sign wire fees for the given year (year, wire method, wire fee, 
and closing fee must be given as arguments)",
-//       .cb = &do_set_wire_fee
-//     },
-//     {
-//       .name = "global-fee",
-//       .help =
-//         "sign global fees for the given year (year, history fee, account 
fee, purse fee, purse timeout, history expiration and the maximum number of 
free purses per account must be given as arguments)",
-//       .cb = &do_set_global_fee
-//     },
-//     {
-//       .name = "drain",
-//       .help =
-//         "drain profits from donau escrow account to regular donau operator 
account (amount, debit account configuration section and credit account 
payto://-URI must be given as arguments)",
-//       .cb = &do_drain
-//     },
-//     {
-//       .name = "add-partner",
-//       .help =
-//         "add partner donau for P2P wad transfers (partner master public 
key, partner base URL, wad fee, wad frequency and validity year must be given 
as arguments)",
-//       .cb = &do_add_partner
-//     },
-//     {
-//       .name = "aml-enable",
-//       .help =
-//         "enable AML staff member (staff member public key, legal name and 
rw (read write) or ro (read only) must be given as arguments)",
-//       .cb = &enable_aml_staff
-//     },
-//     {
-//       .name = "aml-disable",
-//       .help =
-//         "disable AML staff member (staff member public key and legal name 
must be given as arguments)",
-//       .cb = &disable_aml_staff
-//     },
-//     {
-//       .name = "upload",
-//       .help =
-//         "upload operation result to donau (to be performed online!)",
-//       .cb = &do_upload
-//     },
-//     {
-//       .name = "extensions",
-//       .help = "subcommands for extension handling",
-//       .cb = &do_work_extensions
-//     },
-//     /* list terminator */
-//     {
-//       .name = NULL,
-//     }
-//   };
-//   (void) cls;
-
-//   cmd_handler (args, cmds);
-// }
-
-
-// /**
-//  * Main function that will be run.
-//  *
-//  * @param cls closure
-//  * @param args remaining command-line arguments
-//  * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
-//  * @param cfg configuration
-//  */
-// static void
-// run (void *cls,
-//      char *const *args,
-//      const char *cfgfile,
-//      const struct GNUNET_CONFIGURATION_Handle *cfg)
-// {
-//   (void) cls;
-//   (void) cfgfile;
-//   kcfg = cfg;
-
-//   /* load extensions */
-//   GNUNET_assert (GNUNET_OK ==
-//                  TALER_extensions_init (kcfg));
-
-//   /* setup age restriction, if applicable */
-//   {
-//     const struct TALER_AgeRestrictionConfig *arc;
-
-//     if (NULL !=
-//         (arc = TALER_extensions_get_age_restriction_config ()))
-//     {
-//       ar_config  = *arc;
-//       ar_enabled = true;
-//     }
-//   }
-
-
-//   if (GNUNET_OK !=
-//       TALER_config_get_currency (kcfg,
-//                                  &currency))
-//   {
-//     global_ret = EXIT_NOTCONFIGURED;
-//     return;
-//   }
-
-//   ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
-//                           &rc);
-//   rc = GNUNET_CURL_gnunet_rc_create (ctx);
-//   GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
-//                                  NULL);
-//   next (args);
-// }
-
-
 // /**
 //  * The main function of the taler-donau-offline tool.  This tool is used to
 //  * create the signing and denomination keys for the donau.  It uses the
@@ -5393,13 +147,12 @@ struct DrainProfitsRequest *dpr_head;
 //  * @return 0 ok, 1 on error
 //  */
 int
-main (int argc,
-      char *const *argv)
+main (int argc, char *const *argv)
 {
   struct GNUNET_GETOPT_CommandLineOption options[] = {
     GNUNET_GETOPT_OPTION_END
   };
-  (void)options; // delete me
+  (void) options; // delete me
   enum GNUNET_GenericReturnValue ret;
 
   /* force linker to link against libtalerutil; if we do
diff --git a/src/donaudb/Makefile.am b/src/donaudb/Makefile.am
index 6abc016..f940b21 100644
--- a/src/donaudb/Makefile.am
+++ b/src/donaudb/Makefile.am
@@ -16,20 +16,15 @@ sqldir = $(prefix)/share/taler/sql/donau/
 
 sqlinputs = \
   donau_do_*.sql \
-  procedures.sql.in \
-  0002-*.sql \
-  donau-0002.sql.in
+  procedures.sql.in
 
 sql_DATA = \
-  benchmark-0001.sql \
   versioning.sql \
   donau-0001.sql \
-  donau-0002.sql \
   drop.sql \
   procedures.sql
 
 BUILT_SOURCES = \
-  benchmark-0001.sql \
   drop.sql \
   donau-0001.sql \
   procedures.sql
@@ -42,11 +37,6 @@ procedures.sql: procedures.sql.in donau_do_*.sql
        gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" 
| awk 'NF' - >$@
        chmod ugo-w $@
 
-donau-0002.sql: donau-0002.sql.in 0002-*.sql
-       chmod +w $@ || true
-       gcc -E -P -undef - < donau-0002.sql.in 2>/dev/null | sed -e "s/--.*//" 
| awk 'NF' - >$@
-       chmod ugo-w $@
-
 check_SCRIPTS = \
   test_idempotency.sh
 
diff --git a/src/donaudb/bench-db-postgres.conf 
b/src/donaudb/bench-db-postgres.conf
deleted file mode 100644
index 870c5c4..0000000
--- a/src/donaudb/bench-db-postgres.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is in the public domain.
-#
-# Database-backend independent specification for the donaudb module.
-#
-[bench-db-postgres]
-CONFIG = postgres:///talercheck
-
-# Where are the SQL files to setup our tables?
-# Important: this MUST end with a "/"!
-SQL_DIR = $DATADIR/sql/donau/
-
-[donaudb]
-# Number of purses per account by default.
-DEFAULT_PURSE_LIMIT = 1
\ No newline at end of file
diff --git a/src/donaudb/benchmark-0001.sql b/src/donaudb/benchmark-0001.sql
deleted file mode 100644
index aaa0d5c..0000000
--- a/src/donaudb/benchmark-0001.sql
+++ /dev/null
@@ -1,55 +0,0 @@
---
--- This file is part of TALER
--- Copyright (C) 2014--2021 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 CHARITYABILITY 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('benchmark-0001', NULL, NULL);
-
--- Naive, btree version
-CREATE TABLE IF NOT EXISTS benchmap
-  (uuid BIGSERIAL PRIMARY KEY
-  ,hc BYTEA UNIQUE CHECK(LENGTH(hc)=64)
-  ,expiration_date INT8 NOT NULL
-  );
-
--- Replace btree with hash-based index
-CREATE TABLE IF NOT EXISTS benchhmap
-  (uuid BIGSERIAL PRIMARY KEY
-  ,hc BYTEA NOT NULL CHECK(LENGTH(hc)=64)
-  ,expiration_date INT8 NOT NULL
-  );
-CREATE INDEX IF NOT EXISTS benchhmap_index
-  ON benchhmap
-  USING HASH (hc);
-ALTER TABLE benchhmap
-  ADD CONSTRAINT pk
-  EXCLUDE USING HASH (hc with =);
-
--- Keep btree, also add 32-bit hash-based index on top
-CREATE TABLE IF NOT EXISTS benchemap
-  (uuid BIGSERIAL PRIMARY KEY
-  ,ihc INT4 NOT NULL
-  ,hc BYTEA UNIQUE CHECK(LENGTH(hc)=64)
-  ,expiration_date INT8 NOT NULL
-  );
-CREATE INDEX IF NOT EXISTS benchemap_index
-  ON benchemap
-  USING HASH (ihc);
-
--- Complete transaction
-COMMIT;
diff --git a/src/donaudb/donau-0002.sql.in b/src/donaudb/donau-0002.sql.in
deleted file mode 100644
index ac63edb..0000000
--- a/src/donaudb/donau-0002.sql.in
+++ /dev/null
@@ -1,45 +0,0 @@
---
--- 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 CHARITYABILITY 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('donau-0002', NULL, NULL);
-SET search_path TO donau;
-
-CREATE TYPE taler_amount
-  AS
-  (val INT8
-  ,frac INT4
-  );
-COMMENT ON TYPE taler_amount
-  IS 'Stores an amount, fraction is in units of 1/100000000 of the base value';
-
-CREATE TYPE donau_do_array_reserve_insert_return_type
-  AS
-  (transaction_duplicate BOOLEAN
-  ,ruuid INT8
-  );
-COMMENT ON TYPE donau_do_array_reserve_insert_return_type
-  IS 'Return type for donau_do_array_reserves_insert() stored procedure';
-
-#include "0002-denominations.sql"
-#include "0002-denomination_revocations.sql"
-#include "0002-donau_sign_keys.sql"
-#include "0002-signkey_revocations.sql"
-#include "0002-known_coins.sql"
-#include "0002-history_requests.sql"
-
-COMMIT;
diff --git a/src/donaudb/pg_add_donation_unit_key.h 
b/src/donaudb/pg_add_donation_unit_key.h
index 96a1278..a0670db 100644
--- a/src/donaudb/pg_add_donation_unit_key.h
+++ b/src/donaudb/pg_add_donation_unit_key.h
@@ -1,6 +1,6 @@
 /*
    This file is part of TALER
-   Copyright (C) 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
@@ -27,10 +27,10 @@
 
 /**
  * Activate donation unit key, turning it into a "current" or "valid"
- * denomination key by adding the master signature.
+ * donation_unit key by adding the master signature.
  *
  * @param cls closure
- * @param denom_pub the actual denomination key
+ * @param donation_unit_pub the actual donation_unit key
  * @param meta meta information about the donation unit key
  * @return transaction status code
  */
diff --git a/src/donaudb/pg_get_donation_unit_info.c 
b/src/donaudb/pg_get_donation_unit_info.c
index d62188e..688db01 100644
--- a/src/donaudb/pg_get_donation_unit_info.c
+++ b/src/donaudb/pg_get_donation_unit_info.c
@@ -14,8 +14,8 @@
    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 /**
- * @file donaudb/pg_get_denomination_info.c
- * @brief Implementation of the get_denomination_info function for Postgres
+ * @file donaudb/pg_get_donation_unit_info.c
+ * @brief Implementation of the get_donation_unit_info function for Postgres
  * @author Johannes Casaburi
  */
 #include "taler/platform.h"
@@ -54,8 +54,8 @@ DH_PG_get_donation_unit_info (
            ",donation_unit_pub"
            ",validity_year"
            ",value"
-           " FROM denominations"
-           " WHERE denom_pub_hash=$1;");
+           " FROM donation_units"
+           " WHERE donation_unit_pub_hash=$1;");
   qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
                                                  "donation_unit_get",
                                                  params,
diff --git a/src/donaudb/pg_get_donation_unit_info.h 
b/src/donaudb/pg_get_donation_unit_info.h
index 244c0c8..842ac1b 100644
--- a/src/donaudb/pg_get_donation_unit_info.h
+++ b/src/donaudb/pg_get_donation_unit_info.h
@@ -14,8 +14,8 @@
    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 /**
- * @file donaudb/pg_get_denomination_info.h
- * @brief implementation of the get_denomination_info function for Postgres
+ * @file donaudb/pg_get_donation_unit_info.h
+ * @brief implementation of the get_donation_unit_info function for Postgres
  * @author Johannes Casaburi
  */
 #ifndef PG_GET_DONATION_UNIT_INFO_H
@@ -29,7 +29,7 @@
  *
  * @param cls the @e cls of this struct with the plugin-specific state
  * @param donation_unit_pub_hash hash of the public key
- * @param[out] info information with value, fees and other info about the coin
+ * @param[out] info information with value and other info about the coin
  * @return transaction status code
  */
 enum GNUNET_DB_QueryStatus
diff --git a/src/donaudb/pg_insert_charity.c b/src/donaudb/pg_insert_charity.c
index 30495c2..404d4ac 100644
--- a/src/donaudb/pg_insert_charity.c
+++ b/src/donaudb/pg_insert_charity.c
@@ -14,7 +14,7 @@
    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 /**
- * @file exchangedb/pg_insert_charity.c
+ * @file donaudb/pg_insert_charity.c
  * @brief Implementation of the insert_charity function for Postgres
  * @author Johannes Casaburi
  */
@@ -27,11 +27,11 @@
 
 enum GNUNET_DB_QueryStatus
 DH_PG_insert_charity (void *cls,
-                       const struct DONAU_CharityPublicKeyP *charity_pub,
-                       const char *charity_url,
-                       const char *charity_name,
-                       struct TALER_Amount *receipts_to_date,
-                       uint64_t current_year)
+                      const struct DONAU_CharityPublicKeyP *charity_pub,
+                      const char *charity_url,
+                      const char *charity_name,
+                      struct TALER_Amount *receipts_to_date,
+                      uint64_t current_year)
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
diff --git a/src/donaudb/pg_insert_charity.h b/src/donaudb/pg_insert_charity.h
index 9b8ac19..e1b1e56 100644
--- a/src/donaudb/pg_insert_charity.h
+++ b/src/donaudb/pg_insert_charity.h
@@ -15,7 +15,7 @@
  */
 /**
  * @file donaudb/pg_insert_charity.h
- * @brief implementation of the add_denomination_key function for Postgres
+ * @brief implementation of the add_donation_unit_key function for Postgres
  * @author Johannes Casaburi
  */
 #ifndef PG_INSERT_CHARITY_H
diff --git a/src/donaudb/pg_insert_history_entry.c 
b/src/donaudb/pg_insert_history_entry.c
index 249282c..035d345 100644
--- a/src/donaudb/pg_insert_history_entry.c
+++ b/src/donaudb/pg_insert_history_entry.c
@@ -14,7 +14,7 @@
    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 /**
- * @file exchangedb/pg_insert_history_entry.c
+ * @file donaudb/pg_insert_history_entry.c
  * @brief Implementation of the insert_history_entry function for Postgres
  * @author Johannes Casaburi
  */
@@ -27,9 +27,9 @@
 
 enum GNUNET_DB_QueryStatus
 DH_PG_insert_history_entry (void *cls,
-                             const uint64_t charity_id,
-                             const struct TALER_Amount *final_amount,
-                             const uint64_t donation_year)
+                            const uint64_t charity_id,
+                            const struct TALER_Amount *final_amount,
+                            const uint64_t donation_year)
 {
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
diff --git a/src/donaudb/pg_insert_history_entry.h 
b/src/donaudb/pg_insert_history_entry.h
index 247736a..10e1fbd 100644
--- a/src/donaudb/pg_insert_history_entry.h
+++ b/src/donaudb/pg_insert_history_entry.h
@@ -14,7 +14,7 @@
    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 /**
- * @file exchangedb/pg_insert_history_entry.h
+ * @file donaudb/pg_insert_history_entry.h
  * @brief implementation of the insert_history_entry function for Postgres
  * @author Johannes Casaburi
  */
@@ -36,8 +36,8 @@
  */
 enum GNUNET_DB_QueryStatus
 DH_PG_insert_history_entry (void *cls,
-                             const uint64_t charity_id,
-                             const struct TALER_Amount *final_amount,
-                             const uint64_t donation_year);
+                            const uint64_t charity_id,
+                            const struct TALER_Amount *final_amount,
+                            const uint64_t donation_year);
 
 #endif
diff --git a/src/donaudb/pg_insert_issued_receipt.h 
b/src/donaudb/pg_insert_issued_receipt.h
index c1c0c81..15a2437 100644
--- a/src/donaudb/pg_insert_issued_receipt.h
+++ b/src/donaudb/pg_insert_issued_receipt.h
@@ -14,7 +14,7 @@
    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 /**
- * @file exchangedb/pg_insert_issued_receipt.h
+ * @file donaudb/pg_insert_issued_receipt.h
  * @brief implementation of the insert_issued_receipt function for Postgres
  * @author Johannes Casaburi
  */
@@ -37,10 +37,10 @@
  */
 enum GNUNET_DB_QueryStatus
 DH_PG_insert_issued_receipt (void *cls,
-                              const struct DONAU_CharitySignatureP 
*charity_sig,
-                              const uint64_t charity_id,
-                              const struct
-                              DONAU_DonationReceiptHashP *h_receipt,
-                              const struct TALER_Amount *amount);
+                             const struct DONAU_CharitySignatureP *charity_sig,
+                             const uint64_t charity_id,
+                             const struct
+                             DONAU_DonationReceiptHashP *h_receipt,
+                             const struct TALER_Amount *amount);
 
 #endif
diff --git a/src/donaudb/pg_insert_submitted_receipt.h 
b/src/donaudb/pg_insert_submitted_receipt.h
index 9256c8b..a39c40c 100644
--- a/src/donaudb/pg_insert_submitted_receipt.h
+++ b/src/donaudb/pg_insert_submitted_receipt.h
@@ -14,7 +14,7 @@
    TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 /**
- * @file exchangedb/pg_insert_submitted_receipt.h
+ * @file donaudb/pg_insert_submitted_receipt.h
  * @brief implementation of the insert_submitted_receipt function for Postgres
  * @author Johannes Casaburi
  */
@@ -38,12 +38,12 @@
  */
 enum GNUNET_DB_QueryStatus
 DH_PG_insert_submitted_receipt (void *cls,
-                                 const struct
-                                 TALER_TaxNumberHashP *h_tax_number,
-                                 const struct TALER_CsNonce *nonce,
-                                 const struct
-                                 DONAU_DonationUnitPublicKey 
*donation_unit_pub,
-                                 const struct TALER_DonauSignatureP *donau_sig,
-                                 const uint64_t donation_year);
+                                const struct
+                                TALER_TaxNumberHashP *h_tax_number,
+                                const struct TALER_CsNonce *nonce,
+                                const struct
+                                DONAU_DonationUnitPublicKey *donation_unit_pub,
+                                const struct TALER_DonauSignatureP *donau_sig,
+                                const uint64_t donation_year);
 
 #endif
diff --git a/src/donaudb/pg_lookup_donation_unit_key.h 
b/src/donaudb/pg_lookup_donation_unit_key.h
index 61d4c5e..195259b 100644
--- a/src/donaudb/pg_lookup_donation_unit_key.h
+++ b/src/donaudb/pg_lookup_donation_unit_key.h
@@ -28,14 +28,14 @@
  * Lookup information about current donation unit key.
  *
  * @param cls closure
- * @param h_denom_pub hash of the donation_unit public key
+ * @param h_donation_unit_pub hash of the donation_unit public key
  * @param[out] meta set to various meta data about the key
  * @return transaction status code
  */
 enum GNUNET_DB_QueryStatus
 DH_PG_lookup_donation_unit_key (
   void *cls,
-  const struct DONAU_DonationUnitHashP *h_denom_pub,
+  const struct DONAU_DonationUnitHashP *h_donation_unit_pub,
   struct DONAUDB_DonationUnitKeyMetaData *meta);
 
 #endif
diff --git a/src/donaudb/plugin_donaudb_postgres.c 
b/src/donaudb/plugin_donaudb_postgres.c
index cb6cc3a..16cde5a 100644
--- a/src/donaudb/plugin_donaudb_postgres.c
+++ b/src/donaudb/plugin_donaudb_postgres.c
@@ -28,7 +28,7 @@
 #include <pthread.h>
 #include <libpq-fe.h>
 #include "taler/taler_error_codes.h"
-#include "taler/taler_dbevents.h"
+// #include "taler/taler_dbevents.h"
 #include "taler/taler_pq_lib.h"
 #include "taler/taler_util.h"
 #include "taler/taler_json_lib.h"
@@ -38,233 +38,181 @@
 // #include "pg_get_link_data.h"
 #include "pg_helper.h"
 
-// /**
-//  * Set to 1 to enable Postgres auto_explain module. This will
-//  * slow down things a _lot_, but also provide extensive logging
-//  * in the Postgres database logger for performance analysis.
-//  */
-// #define AUTO_EXPLAIN 1
-
-
-// /**
-//  * Log a really unexpected PQ error with all the details we can get hold of.
-//  *
-//  * @param result PQ result object of the PQ operation that failed
-//  * @param conn SQL connection that was used
-//  */
-/*#define BREAK_DB_ERR(result,conn) do {                                  \
-    GNUNET_break (0);                                                   \
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,                                \
-                "Database failure: %s/%s/%s/%s/%s",                     \
-                PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY),   \
-                PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL),    \
-                PQresultErrorMessage (result),                          \
-                PQresStatus (PQresultStatus (result)),                  \
-                PQerrorMessage (conn));                                 \
- } while (0)
-*/
-
-// /**
-//  * Connect to the database if the connection does not exist yet.
-//  *
-//  * @param pg the plugin-specific state
-//  * @return #GNUNET_OK on success
-//  */
-// enum GNUNET_GenericReturnValue
-// DH_PG_internal_setup (struct PostgresClosure *pg)
-// {
-//   if (NULL == pg->conn)
-//   {
-// #if AUTO_EXPLAIN
-//     /* Enable verbose logging to see where queries do not
-//        properly use indices */
-//     struct GNUNET_PQ_ExecuteStatement es[] = {
-//       GNUNET_PQ_make_try_execute ("LOAD 'auto_explain';"),
-//       GNUNET_PQ_make_try_execute ("SET auto_explain.log_min_duration=50;"),
-//       GNUNET_PQ_make_try_execute ("SET auto_explain.log_timing=TRUE;"),
-//       GNUNET_PQ_make_try_execute ("SET auto_explain.log_analyze=TRUE;"),
-//       /* https://wiki.postgresql.org/wiki/Serializable suggests to really
-//          force the default to 'serializable' if SSI is to be used. */
-//       GNUNET_PQ_make_try_execute (
-//         "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL 
SERIALIZABLE;"),
-//       GNUNET_PQ_make_try_execute ("SET enable_sort=OFF;"),
-//       GNUNET_PQ_make_try_execute ("SET enable_seqscan=OFF;"),
-//       GNUNET_PQ_make_try_execute ("SET search_path TO donau;"),
-//       GNUNET_PQ_EXECUTE_STATEMENT_END
-//     };
-// #else
-//     struct GNUNET_PQ_ExecuteStatement es[] = {
-//       GNUNET_PQ_make_try_execute (
-//         "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL 
SERIALIZABLE;"),
-//       GNUNET_PQ_make_try_execute ("SET enable_sort=OFF;"),
-//       GNUNET_PQ_make_try_execute ("SET enable_seqscan=OFF;"),
-//       GNUNET_PQ_make_try_execute ("SET autocommit=OFF;"),
-//       GNUNET_PQ_make_try_execute ("SET search_path TO donau;"),
-//       GNUNET_PQ_EXECUTE_STATEMENT_END
-//     };
-// #endif
-//     struct GNUNET_PQ_Context *db_conn;
-
-//     db_conn = GNUNET_PQ_connect_with_cfg (pg->cfg,
-//                                           "donaudb-postgres",
-//                                           NULL,
-//                                           es,
-//                                           NULL);
-//     if (NULL == db_conn)
-//       return GNUNET_SYSERR;
-
-//     pg->prep_gen++;
-//     pg->conn = db_conn;
-//   }
-//   if (NULL == pg->transaction_name)
-//     GNUNET_PQ_reconnect_if_down (pg->conn);
-//   return GNUNET_OK;
-// }
+/**
+ * Set to 1 to enable Postgres auto_explain module. This will
+ * slow down things a _lot_, but also provide extensive logging
+ * in the Postgres database logger for performance analysis.
+ */
+#define AUTO_EXPLAIN 1
 
 
-// /**
-//  * Initialize Postgres database subsystem.
-//  *
-//  * @param cls a configuration instance
-//  * @return NULL on error, otherwise a `struct
-//  *         DONAUDB_Plugin`
-//  */
-// void *
-// libtaler_plugin_donaudb_postgres_init (void *cls)
-// {
-//   const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
-//   struct PostgresClosure *pg;
-//   struct DONAUDB_Plugin *plugin;
-//   unsigned long long dpl;
+/**
+ * Log a really unexpected PQ error with all the details we can get hold of.
+ *
+ * @param result PQ result object of the PQ operation that failed
+ * @param conn SQL connection that was used
+ */
+#define BREAK_DB_ERR(result,conn) do {                                  \
+          GNUNET_break (0);                                                   \
+          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,                                \
+                      "Database failure: %s/%s/%s/%s/%s",                     \
+                      PQresultErrorField (result, PG_DIAG_MESSAGE_PRIMARY),   \
+                      PQresultErrorField (result, PG_DIAG_MESSAGE_DETAIL),    \
+                      PQresultErrorMessage (result),                          \
+                      PQresStatus (PQresultStatus (result)),                  \
+                      PQerrorMessage (conn));                                 \
+} while (0)
 
-//   pg = GNUNET_new (struct PostgresClosure);
-//   pg->cfg = cfg;
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_filename (cfg,
-//                                                "donaudb-postgres",
-//                                                "SQL_DIR",
-//                                                &pg->sql_dir))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donaudb-postgres",
-//                                "SQL_DIR");
-//     GNUNET_free (pg);
-//     return NULL;
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_string (cfg,
-//                                              "donau",
-//                                              "BASE_URL",
-//                                              &pg->donau_url))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donau",
-//                                "BASE_URL");
-//     GNUNET_free (pg->sql_dir);
-//     GNUNET_free (pg);
-//     return NULL;
-//   }
-//   if ( (GNUNET_OK !=
-//         GNUNET_CONFIGURATION_get_value_time (cfg,
-//                                              "donaudb",
-//                                              "IDLE_RESERVE_EXPIRATION_TIME",
-//                                              
&pg->idle_reserve_expiration_time))
-//        ||
-//        (GNUNET_OK !=
-//         GNUNET_CONFIGURATION_get_value_time (cfg,
-//                                              "donaudb",
-//                                              
"LEGAL_RESERVE_EXPIRATION_TIME",
-//                                              
&pg->legal_reserve_expiration_time)) )
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-//                                "donaudb",
-//                                "LEGAL/IDLE_RESERVE_EXPIRATION_TIME");
-//     GNUNET_free (pg->donau_url);
-//     GNUNET_free (pg->sql_dir);
-//     GNUNET_free (pg);
-//     return NULL;
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_time (cfg,
-//                                            "donaudb",
-//                                            "AGGREGATOR_SHIFT",
-//                                            &pg->aggregator_shift))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
-//                                "donaudb",
-//                                "AGGREGATOR_SHIFT");
-//   }
-//   if (GNUNET_OK !=
-//       GNUNET_CONFIGURATION_get_value_number (cfg,
-//                                              "donaudb",
-//                                              "DEFAULT_PURSE_LIMIT",
-//                                              &dpl))
-//   {
-//     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
-//                                "donaudb",
-//                                "DEFAULT_PURSE_LIMIT");
-//     pg->def_purse_limit = 1;
-//   }
-//   else
-//   {
-//     pg->def_purse_limit = (uint32_t) dpl;
-//   }
 
-//   if (GNUNET_OK !=
-//       TALER_config_get_currency (cfg,
-//                                  &pg->currency))
-//   {
-//     GNUNET_free (pg->donau_url);
-//     GNUNET_free (pg->sql_dir);
-//     GNUNET_free (pg);
-//     return NULL;
-//   }
-//   if (GNUNET_OK !=
-//       DH_PG_internal_setup (pg))
-//   {
-//     GNUNET_free (pg->donau_url);
-//     GNUNET_free (pg->currency);
-//     GNUNET_free (pg->sql_dir);
-//     GNUNET_free (pg);
-//     return NULL;
-//   }
-//   plugin = GNUNET_new (struct DONAUDB_Plugin);
-//   plugin->cls = pg;
-//   plugin->do_reserve_open
-//     = &DH_PG_do_reserve_open;
-//   plugin->drop_tables
-//     = &DH_PG_drop_tables;
-//   plugin->do_withdraw
-//     = &DH_PG_do_withdraw;
+/**
+ * Connect to the database if the connection does not exist yet.
+ *
+ * @param pg the plugin-specific state
+ * @return #GNUNET_OK on success
+ */
+enum GNUNET_GenericReturnValue
+DH_PG_internal_setup (struct PostgresClosure *pg)
+{
+  if (NULL == pg->conn)
+  {
+#if AUTO_EXPLAIN
+    /* Enable verbose logging to see where queries do not
+       properly use indices */
+    struct GNUNET_PQ_ExecuteStatement es[] = {
+      GNUNET_PQ_make_try_execute ("LOAD 'auto_explain';"),
+      GNUNET_PQ_make_try_execute ("SET auto_explain.log_min_duration=50;"),
+      GNUNET_PQ_make_try_execute ("SET auto_explain.log_timing=TRUE;"),
+      GNUNET_PQ_make_try_execute ("SET auto_explain.log_analyze=TRUE;"),
+      /* https://wiki.postgresql.org/wiki/Serializable suggests to really
+         force the default to 'serializable' if SSI is to be used. */
+      GNUNET_PQ_make_try_execute (
+        "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL 
SERIALIZABLE;")
+      ,
+      GNUNET_PQ_make_try_execute ("SET enable_sort=OFF;"),
+      GNUNET_PQ_make_try_execute ("SET enable_seqscan=OFF;"),
+      GNUNET_PQ_make_try_execute ("SET search_path TO donau;"),
+      GNUNET_PQ_EXECUTE_STATEMENT_END
+    };
+#else
+    struct GNUNET_PQ_ExecuteStatement es[] = {
+      GNUNET_PQ_make_try_execute (
+        "SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL 
SERIALIZABLE;")
+      ,
+      GNUNET_PQ_make_try_execute ("SET enable_sort=OFF;"),
+      GNUNET_PQ_make_try_execute ("SET enable_seqscan=OFF;"),
+      GNUNET_PQ_make_try_execute ("SET autocommit=OFF;"),
+      GNUNET_PQ_make_try_execute ("SET search_path TO donau;"),
+      GNUNET_PQ_EXECUTE_STATEMENT_END
+    };
+#endif
+    struct GNUNET_PQ_Context *db_conn;
+
+    db_conn = GNUNET_PQ_connect_with_cfg (pg->cfg,
+                                          "donaudb-postgres",
+                                          NULL,
+                                          es,
+                                          NULL);
+    if (NULL == db_conn)
+      return GNUNET_SYSERR;
+
+    pg->prep_gen++;
+    pg->conn = db_conn;
+  }
+  // if (NULL == pg->transaction_name)
+  //  GNUNET_PQ_reconnect_if_down (pg->conn);
+  return GNUNET_OK;
+}
 
-//   return plugin;
-// }
 
+/**
+ * Initialize Postgres database subsystem.
+ *
+ * @param cls a configuration instance
+ * @return NULL on error, otherwise a `struct
+ *         DONAUDB_Plugin`
+ */
+void *
+libtaler_plugin_donaudb_postgres_init (void *cls)
+{
+  const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+  struct PostgresClosure *pg;
+  struct DONAUDB_Plugin *plugin;
+
+  pg = GNUNET_new (struct PostgresClosure);
+  pg->cfg = cfg;
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_filename (cfg,
+                                               "donaudb-postgres",
+                                               "SQL_DIR",
+                                               &pg->sql_dir))
+  {
+    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+                               "donaudb-postgres",
+                               "SQL_DIR");
+    GNUNET_free (pg);
+    return NULL;
+  }
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_string (cfg,
+                                             "donau",
+                                             "BASE_URL",
+                                             &pg->donau_url))
+  {
+    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+                               "donau",
+                               "BASE_URL");
+    GNUNET_free (pg->sql_dir);
+    GNUNET_free (pg);
+    return NULL;
+  }
+  if (GNUNET_OK !=
+      TALER_config_get_currency (cfg,
+                                 &pg->currency))
+  {
+    GNUNET_free (pg->donau_url);
+    GNUNET_free (pg->sql_dir);
+    GNUNET_free (pg);
+    return NULL;
+  }
+  if (GNUNET_OK !=
+      DH_PG_internal_setup (pg))
+  {
+    GNUNET_free (pg->donau_url);
+    GNUNET_free (pg->currency);
+    GNUNET_free (pg->sql_dir);
+    GNUNET_free (pg);
+    return NULL;
+  }
+  plugin = GNUNET_new (struct DONAUDB_Plugin);
+  plugin->cls = pg;
+  return plugin;
+}
 
-// /**
-//  * Shutdown Postgres database subsystem.
-//  *
-//  * @param cls a `struct DONAUDB_Plugin`
-//  * @return NULL (always)
-//  */
-// void *
-// libtaler_plugin_donaudb_postgres_done (void *cls)
-// {
-//   struct DONAUDB_Plugin *plugin = cls;
-//   struct PostgresClosure *pg = plugin->cls;
 
-//   if (NULL != pg->conn)
-//   {
-//     GNUNET_PQ_disconnect (pg->conn);
-//     pg->conn = NULL;
-//   }
-//   GNUNET_free (pg->donau_url);
-//   GNUNET_free (pg->sql_dir);
-//   GNUNET_free (pg->currency);
-//   GNUNET_free (pg);
-//   GNUNET_free (plugin);
-//   return NULL;
-// }
+/**
+ * Shutdown Postgres database subsystem.
+ *
+ * @param cls a `struct DONAUDB_Plugin`
+ * @return NULL (always)
+ */
+void *
+libtaler_plugin_donaudb_postgres_done (void *cls)
+{
+  struct DONAUDB_Plugin *plugin = cls;
+  struct PostgresClosure *pg = plugin->cls;
+
+  if (NULL != pg->conn)
+  {
+    GNUNET_PQ_disconnect (pg->conn);
+    pg->conn = NULL;
+  }
+  GNUNET_free (pg->donau_url);
+  GNUNET_free (pg->sql_dir);
+  GNUNET_free (pg->currency);
+  GNUNET_free (pg);
+  GNUNET_free (plugin);
+  return NULL;
+}
 
 
 /* end of plugin_donaudb_postgres.c */
diff --git a/src/include/donau_crypto_lib.h b/src/include/donau_crypto_lib.h
index c12fddd..9958774 100644
--- a/src/include/donau_crypto_lib.h
+++ b/src/include/donau_crypto_lib.h
@@ -194,7 +194,7 @@ struct DONAU_BlindedUniqueDonationIdentifierKeyPair
   struct DONAU_DonationUnitHashP h_donation_unit_pub;
 
   /**
-   * Donor's blinded donation identifier. It must be blindly signed  
+   * Donor's blinded donation identifier. It must be blindly signed
    * to become donation receipt.
    */
   struct GNUNET_CRYPTO_BlindedMessage blinded_udi;
@@ -287,10 +287,6 @@ DONAU_donation_statement_verify (
 /**
  * Group of donation units. These are the common fields of an array of
  * donation units.
- *
- * The corresponding JSON-blob will also contain an array of particular
- * denominations with only the cipher-specific public key and the 
- * corresponding year.
  */
 struct DONAU_DonationUnitGroup
 {
@@ -330,5 +326,4 @@ TALER_donation_unit_group_get_key (
   struct GNUNET_HashCode *key);
 
 
-
 #endif
diff --git a/src/json/Makefile.am b/src/json/Makefile.am
index f35b3df..d952331 100644
--- a/src/json/Makefile.am
+++ b/src/json/Makefile.am
@@ -10,9 +10,7 @@ lib_LTLIBRARIES = \
   libtalerjson.la
 
 libtalerjson_la_SOURCES = \
-  json.c \
-  json_helper.c \
-  json_pack.c 
+  json.c 
 libtalerjson_la_LDFLAGS = \
   -version-info 1:0:1 \
   -no-undefined
@@ -25,17 +23,3 @@ libtalerjson_la_LIBADD = \
   -lm \
   $(XLIB)
 
-TESTS = \
-  test_json
-
-check_PROGRAMS= \
-  test_json
-
-test_json_SOURCES = \
-  test_json.c
-test_json_LDADD = \
-  $(top_builddir)/src/json/libtalerjson.la \
-  -lgnunetjson \
-  $(top_builddir)/src/util/libdonauutil.la \
-  -lgnunetutil \
-  -ljansson
diff --git a/src/json/json.c b/src/json/json.c
index 7f824fc..e71577b 100644
--- a/src/json/json.c
+++ b/src/json/json.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2014, 2015, 2016, 2020, 2021 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
@@ -26,861 +26,4 @@
 #include <unistr.h>
 
 
-/**
- * Check if @a json contains a 'real' value anywhere.
- *
- * @param json json to check
- * @return true if a real is in it somewhere
- */
-static bool
-contains_real (const json_t *json)
-{
-  if (json_is_real (json))
-    return true;
-  if (json_is_object (json))
-  {
-    json_t *member;
-    const char *name;
-
-    json_object_foreach ((json_t *) json, name, member)
-    if (contains_real (member))
-      return true;
-    return false;
-  }
-  if (json_is_array (json))
-  {
-    json_t *member;
-    size_t index;
-
-    json_array_foreach ((json_t *) json, index, member)
-    if (contains_real (member))
-      return true;
-    return false;
-  }
-  return false;
-}
-
-
-/**
- * Dump the @a json to a string and hash it.
- *
- * @param json value to hash
- * @param salt salt value to include when using HKDF,
- *        NULL to not use any salt and to use SHA512
- * @param[out] hc where to store the hash
- * @return #GNUNET_OK on success,
- *         #GNUNET_NO if @a json was not hash-able
- *         #GNUNET_SYSERR on failure
- */
-static enum GNUNET_GenericReturnValue
-dump_and_hash (const json_t *json,
-               const char *salt,
-               struct GNUNET_HashCode *hc)
-{
-  char *wire_enc;
-  size_t len;
-
-  if (NULL == json)
-  {
-    GNUNET_break_op (0);
-    return GNUNET_NO;
-  }
-  if (contains_real (json))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_NO;
-  }
-  if (NULL == (wire_enc = json_dumps (json,
-                                      JSON_ENCODE_ANY
-                                      | JSON_COMPACT
-                                      | JSON_SORT_KEYS)))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  len = TALER_rfc8785encode (&wire_enc);
-  if (NULL == salt)
-  {
-    GNUNET_CRYPTO_hash (wire_enc,
-                        len,
-                        hc);
-  }
-  else
-  {
-    if (GNUNET_YES !=
-        GNUNET_CRYPTO_kdf (hc,
-                           sizeof (*hc),
-                           salt,
-                           strlen (salt) + 1,
-                           wire_enc,
-                           len,
-                           NULL,
-                           0))
-    {
-      GNUNET_break (0);
-      free (wire_enc);
-      return GNUNET_SYSERR;
-    }
-  }
-  free (wire_enc);
-  return GNUNET_OK;
-}
-
-
-/**
- * Replace "forgettable" parts of a JSON object with their salted hash.
- *
- * @param[in] in some JSON value
- * @param[out] out resulting JSON value
- * @return #GNUNET_OK on success,
- *         #GNUNET_NO if @a json was not hash-able
- *         #GNUNET_SYSERR on failure
- */
-static enum GNUNET_GenericReturnValue
-forget (const json_t *in,
-        json_t **out)
-{
-  if (json_is_real (in))
-  {
-    /* floating point is not allowed! */
-    GNUNET_break_op (0);
-    return GNUNET_NO;
-  }
-  if (json_is_array (in))
-  {
-    /* array is a JSON array */
-    size_t index;
-    json_t *value;
-    json_t *ret;
-
-    ret = json_array ();
-    if (NULL == ret)
-    {
-      GNUNET_break (0);
-      return GNUNET_SYSERR;
-    }
-    json_array_foreach (in, index, value) {
-      enum GNUNET_GenericReturnValue iret;
-      json_t *t;
-
-      iret = forget (value,
-                     &t);
-      if (GNUNET_OK != iret)
-      {
-        json_decref (ret);
-        return iret;
-      }
-      if (0 != json_array_append_new (ret,
-                                      t))
-      {
-        GNUNET_break (0);
-        json_decref (ret);
-        return GNUNET_SYSERR;
-      }
-    }
-    *out = ret;
-    return GNUNET_OK;
-  }
-  if (json_is_object (in))
-  {
-    json_t *ret;
-    const char *key;
-    json_t *value;
-    json_t *fg;
-    json_t *rx;
-
-    fg = json_object_get (in,
-                          "$forgettable");
-    rx = json_object_get (in,
-                          "$forgotten");
-    if (NULL != rx)
-    {
-      rx = json_deep_copy (rx); /* should be shallow
-                                   by structure, but
-                                   deep copy is safer */
-      if (NULL == rx)
-      {
-        GNUNET_break (0);
-        return GNUNET_SYSERR;
-      }
-    }
-    ret = json_object ();
-    if (NULL == ret)
-    {
-      GNUNET_break (0);
-      return GNUNET_SYSERR;
-    }
-    json_object_foreach ((json_t*) in, key, value) {
-      json_t *t;
-      json_t *salt;
-      enum GNUNET_GenericReturnValue iret;
-
-      if (fg == value)
-        continue; /* skip! */
-      if (rx == value)
-        continue; /* skip! */
-      if ( (NULL != rx) &&
-           (NULL !=
-            json_object_get (rx,
-                             key)) )
-      {
-        (void) json_object_del (ret,
-                                key);
-        continue; /* already forgotten earlier */
-      }
-      iret = forget (value,
-                     &t);
-      if (GNUNET_OK != iret)
-      {
-        json_decref (ret);
-        json_decref (rx);
-        return iret;
-      }
-      if ( (NULL != fg) &&
-           (NULL != (salt = json_object_get (fg,
-                                             key))) )
-      {
-        /* 't' is to be forgotten! */
-        struct GNUNET_HashCode hc;
-
-        if (! json_is_string (salt))
-        {
-          GNUNET_break_op (0);
-          json_decref (ret);
-          json_decref (rx);
-          json_decref (t);
-          return GNUNET_NO;
-        }
-        iret = dump_and_hash (t,
-                              json_string_value (salt),
-                              &hc);
-        if (GNUNET_OK != iret)
-        {
-          json_decref (ret);
-          json_decref (rx);
-          json_decref (t);
-          return iret;
-        }
-        json_decref (t);
-        /* scrub salt */
-        if (0 !=
-            json_object_del (fg,
-                             key))
-        {
-          GNUNET_break_op (0);
-          json_decref (ret);
-          json_decref (rx);
-          return GNUNET_NO;
-        }
-        if (NULL == rx)
-          rx = json_object ();
-        if (NULL == rx)
-        {
-          GNUNET_break (0);
-          json_decref (ret);
-          return GNUNET_SYSERR;
-        }
-        if (0 !=
-            json_object_set_new (rx,
-                                 key,
-                                 GNUNET_JSON_from_data_auto (&hc)))
-        {
-          GNUNET_break (0);
-          json_decref (ret);
-          json_decref (rx);
-          return GNUNET_SYSERR;
-        }
-      }
-      else
-      {
-        /* 't' to be used without 'forgetting' */
-        if (0 !=
-            json_object_set_new (ret,
-                                 key,
-                                 t))
-        {
-          GNUNET_break (0);
-          json_decref (ret);
-          json_decref (rx);
-          return GNUNET_SYSERR;
-        }
-      }
-    } /* json_object_foreach */
-    if ( (NULL != rx) &&
-         (0 !=
-          json_object_set_new (ret,
-                               "$forgotten",
-                               rx)) )
-    {
-      GNUNET_break (0);
-      json_decref (ret);
-      return GNUNET_SYSERR;
-    }
-    *out = ret;
-    return GNUNET_OK;
-  }
-  *out = json_incref ((json_t *) in);
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-TALER_JSON_contract_hash (const json_t *json,
-                          struct TALER_PrivateContractHashP *hc)
-{
-  enum GNUNET_GenericReturnValue ret;
-  json_t *cjson;
-  json_t *dc;
-
-  dc = json_deep_copy (json);
-  ret = forget (dc,
-                &cjson);
-  json_decref (dc);
-  if (GNUNET_OK != ret)
-    return ret;
-  ret = dump_and_hash (cjson,
-                       NULL,
-                       &hc->hash);
-  json_decref (cjson);
-  return ret;
-}
-
-
-enum GNUNET_GenericReturnValue
-TALER_JSON_contract_mark_forgettable (json_t *json,
-                                      const char *field)
-{
-  json_t *fg;
-  struct GNUNET_ShortHashCode salt;
-
-  if (! json_is_object (json))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  /* check field name is legal for forgettable field */
-  for (const char *f = field; '\0' != *f; f++)
-  {
-    char c = *f;
-
-    if ( (c >= 'a') && (c <= 'z') )
-      continue;
-    if ( (c >= 'A') && (c <= 'Z') )
-      continue;
-    if ( (c >= '0') && (c <= '9') )
-      continue;
-    if ('_' == c)
-      continue;
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  if (NULL == json_object_get (json,
-                               field))
-  {
-    /* field must exist */
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  fg = json_object_get (json,
-                        "$forgettable");
-  if (NULL == fg)
-  {
-    fg = json_object ();
-    if (0 !=
-        json_object_set_new (json,
-                             "$forgettable",
-                             fg))
-    {
-      GNUNET_break (0);
-      return GNUNET_SYSERR;
-    }
-  }
-
-  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
-                              &salt,
-                              sizeof (salt));
-  if (0 !=
-      json_object_set_new (fg,
-                           field,
-                           GNUNET_JSON_from_data_auto (&salt)))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-TALER_JSON_contract_part_forget (json_t *json,
-                                 const char *field)
-{
-  json_t *fg;
-  const json_t *part;
-  json_t *fp;
-  json_t *rx;
-  struct GNUNET_HashCode hc;
-  const char *salt;
-  enum GNUNET_GenericReturnValue ret;
-
-  if (! json_is_object (json))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  if (NULL == (part = json_object_get (json,
-                                       field)))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Did not find field `%s' we were asked to forget\n",
-                field);
-    return GNUNET_SYSERR;
-  }
-  fg = json_object_get (json,
-                        "$forgettable");
-  if (NULL == fg)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Did not find '$forgettable' attribute trying to forget field 
`%s'\n",
-                field);
-    return GNUNET_SYSERR;
-  }
-  rx = json_object_get (json,
-                        "$forgotten");
-  if (NULL == rx)
-  {
-    rx = json_object ();
-    if (0 !=
-        json_object_set_new (json,
-                             "$forgotten",
-                             rx))
-    {
-      GNUNET_break (0);
-      return GNUNET_SYSERR;
-    }
-  }
-  if (NULL !=
-      json_object_get (rx,
-                       field))
-  {
-    if (! json_is_null (json_object_get (json,
-                                         field)))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "Field `%s' market as forgotten, but still exists!\n",
-                  field);
-      return GNUNET_SYSERR;
-    }
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Already forgot field `%s'\n",
-                field);
-    return GNUNET_NO;
-  }
-  salt = json_string_value (json_object_get (fg,
-                                             field));
-  if (NULL == salt)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Did not find required salt to forget field `%s'\n",
-                field);
-    return GNUNET_SYSERR;
-  }
-
-  /* need to recursively forget to compute 'hc' */
-  ret = forget (part,
-                &fp);
-  if (GNUNET_OK != ret)
-    return ret;
-  if (GNUNET_OK !=
-      dump_and_hash (fp,
-                     salt,
-                     &hc))
-  {
-    json_decref (fp);
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  json_decref (fp);
-  /* drop salt */
-  if (0 !=
-      json_object_del (fg,
-                       field))
-  {
-    json_decref (fp);
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-
-  /* remember field as 'forgotten' */
-  if (0 !=
-      json_object_set_new (rx,
-                           field,
-                           GNUNET_JSON_from_data_auto (&hc)))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  /* finally, set 'forgotten' field to null */
-  if (0 !=
-      json_object_del (json,
-                       field))
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Look over all of the values of a '$forgettable' object.  Replace 'True'
- * values with proper random salts.  Fails if any forgettable values are
- * neither 'True' nor valid salts (strings).
- *
- * @param[in,out] f JSON to transform
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-seed_forgettable (json_t *f)
-{
-  const char *key;
-  json_t *val;
-
-  json_object_foreach (f,
-                       key,
-                       val)
-  {
-    if (json_is_string (val))
-      continue;
-    if (json_is_true (val))
-    {
-      struct GNUNET_ShortHashCode sh;
-
-      GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE,
-                                  &sh,
-                                  sizeof (sh));
-      if (0 !=
-          json_object_set_new (f,
-                               key,
-                               GNUNET_JSON_from_data_auto (&sh)))
-      {
-        GNUNET_break (0);
-        return GNUNET_SYSERR;
-      }
-      continue;
-    }
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Forgettable field `%s' has invalid value\n",
-                key);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Take a given contract with "forgettable" fields marked
- * but with 'True' instead of a real salt. Replaces all
- * 'True' values with proper random salts.  Fails if any
- * forgettable markers are neither 'True' nor valid salts.
- *
- * @param[in,out] json JSON to transform
- * @return #GNUNET_OK on success
- */
-enum GNUNET_GenericReturnValue
-TALER_JSON_contract_seed_forgettable (json_t *json)
-{
-  if (json_is_object (json))
-  {
-    const char *key;
-    json_t *val;
-
-    json_object_foreach (json,
-                         key,
-                         val)
-    {
-      if (0 == strcmp ("$forgettable",
-                       key))
-      {
-        if (GNUNET_OK !=
-            seed_forgettable (val))
-          return GNUNET_SYSERR;
-        continue;
-      }
-      if (GNUNET_OK !=
-          TALER_JSON_contract_seed_forgettable (val))
-        return GNUNET_SYSERR;
-    }
-  }
-  if (json_is_array (json))
-  {
-    size_t index;
-    json_t *val;
-
-    json_array_foreach (json,
-                        index,
-                        val)
-    {
-      if (GNUNET_OK !=
-          TALER_JSON_contract_seed_forgettable (val))
-        return GNUNET_SYSERR;
-    }
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse a json path.
- *
- * @param obj the object that the path is relative to.
- * @param prev the parent of @e obj.
- * @param path the path to parse.
- * @param cb the callback to call, if we get to the end of @e path.
- * @param cb_cls the closure for the callback.
- * @return #GNUNET_OK on success, #GNUNET_SYSERR if @e path is malformed.
- */
-static enum GNUNET_GenericReturnValue
-parse_path (json_t *obj,
-            json_t *prev,
-            const char *path,
-            TALER_JSON_ExpandPathCallback cb,
-            void *cb_cls)
-{
-  char *id = GNUNET_strdup (path);
-  char *next_id = strchr (id,
-                          '.');
-  char *next_path;
-  char *bracket;
-  json_t *next_obj = NULL;
-  char *next_dot;
-
-  GNUNET_assert (NULL != id); /* make stupid compiler happy */
-  if (NULL == next_id)
-  {
-    cb (cb_cls,
-        id,
-        prev);
-    GNUNET_free (id);
-    return GNUNET_OK;
-  }
-  bracket = strchr (next_id,
-                    '[');
-  *next_id = '\0';
-  next_id++;
-  next_path = GNUNET_strdup (next_id);
-  next_dot = strchr (next_id,
-                     '.');
-  if (NULL != next_dot)
-    *next_dot = '\0';
-  /* If this is the first time this is called, make sure id is "$" */
-  if ( (NULL == prev) &&
-       (0 != strcmp (id,
-                     "$")))
-  {
-    GNUNET_free (id);
-    GNUNET_free (next_path);
-    return GNUNET_SYSERR;
-  }
-
-  /* Check for bracketed indices */
-  if (NULL != bracket)
-  {
-    char *end_bracket = strchr (bracket,
-                                ']');
-    if (NULL == end_bracket)
-    {
-      GNUNET_free (id);
-      GNUNET_free (next_path);
-      return GNUNET_SYSERR;
-    }
-    *end_bracket = '\0';
-
-    *bracket = '\0';
-    bracket++;
-
-    json_t *array = json_object_get (obj,
-                                     next_id);
-    if (0 == strcmp (bracket,
-                     "*"))
-    {
-      size_t index;
-      json_t *value;
-      int ret = GNUNET_OK;
-
-      json_array_foreach (array, index, value) {
-        ret = parse_path (value,
-                          obj,
-                          next_path,
-                          cb,
-                          cb_cls);
-        if (GNUNET_OK != ret)
-        {
-          GNUNET_free (id);
-          GNUNET_free (next_path);
-          return ret;
-        }
-      }
-    }
-    else
-    {
-      unsigned int index;
-      char dummy;
-
-      if (1 != sscanf (bracket,
-                       "%u%c",
-                       &index,
-                       &dummy))
-      {
-        GNUNET_free (id);
-        GNUNET_free (next_path);
-        return GNUNET_SYSERR;
-      }
-      next_obj = json_array_get (array,
-                                 index);
-    }
-  }
-  else
-  {
-    /* No brackets, so just fetch the object by name */
-    next_obj = json_object_get (obj,
-                                next_id);
-  }
-
-  if (NULL != next_obj)
-  {
-    int ret = parse_path (next_obj,
-                          obj,
-                          next_path,
-                          cb,
-                          cb_cls);
-    GNUNET_free (id);
-    GNUNET_free (next_path);
-    return ret;
-  }
-  GNUNET_free (id);
-  GNUNET_free (next_path);
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-TALER_JSON_expand_path (json_t *json,
-                        const char *path,
-                        TALER_JSON_ExpandPathCallback cb,
-                        void *cb_cls)
-{
-  return parse_path (json,
-                     NULL,
-                     path,
-                     cb,
-                     cb_cls);
-}
-
-
-enum TALER_ErrorCode
-TALER_JSON_get_error_code (const json_t *json)
-{
-  const json_t *jc;
-
-  if (NULL == json)
-    return TALER_EC_GENERIC_INVALID_RESPONSE;
-  jc = json_object_get (json, "code");
-  /* The caller already knows that the JSON represents an error,
-     so we are dealing with a missing error code here.  */
-  if (NULL == jc)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Expected Taler error code `code' in JSON, but field does not 
exist!\n");
-    return TALER_EC_INVALID;
-  }
-  if (json_is_integer (jc))
-    return (enum TALER_ErrorCode) json_integer_value (jc);
-  GNUNET_break_op (0);
-  return TALER_EC_INVALID;
-}
-
-
-const char *
-TALER_JSON_get_error_hint (const json_t *json)
-{
-  const json_t *jc;
-
-  if (NULL == json)
-    return NULL;
-  jc = json_object_get (json,
-                        "hint");
-  if (NULL == jc)
-    return NULL; /* no hint, is allowed */
-  if (! json_is_string (jc))
-  {
-    /* Hints must be strings */
-    GNUNET_break_op (0);
-    return NULL;
-  }
-  return json_string_value (jc);
-}
-
-
-enum TALER_ErrorCode
-TALER_JSON_get_error_code2 (const void *data,
-                            size_t data_size)
-{
-  json_t *json;
-  enum TALER_ErrorCode ec;
-  json_error_t err;
-
-  json = json_loadb (data,
-                     data_size,
-                     JSON_REJECT_DUPLICATES,
-                     &err);
-  if (NULL == json)
-    return TALER_EC_INVALID;
-  ec = TALER_JSON_get_error_code (json);
-  json_decref (json);
-  if (ec == TALER_EC_NONE)
-    return TALER_EC_INVALID;
-  return ec;
-}
-
-
-void
-TALER_deposit_policy_hash (const json_t *policy,
-                           struct TALER_ExtensionPolicyHashP *ech)
-{
-  GNUNET_assert (GNUNET_OK ==
-                 dump_and_hash (policy,
-                                "taler-extensions-policy",
-                                &ech->hash));
-}
-
-
-char *
-TALER_JSON_canonicalize (const json_t *input)
-{
-  char *wire_enc;
-
-  if (NULL == (wire_enc = json_dumps (input,
-                                      JSON_ENCODE_ANY
-                                      | JSON_COMPACT
-                                      | JSON_SORT_KEYS)))
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
-  TALER_rfc8785encode (&wire_enc);
-  return wire_enc;
-}
-
-
-enum GNUNET_GenericReturnValue
-TALER_JSON_extensions_manifests_hash (const json_t *manifests,
-                                      struct TALER_ExtensionManifestsHashP 
*ech)
-{
-  return dump_and_hash (manifests,
-                        "taler-extensions-manifests",
-                        &ech->hash);
-}
-
-
 /* End of json/json.c */
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
deleted file mode 100644
index 6b93e48..0000000
--- a/src/json/json_helper.c
+++ /dev/null
@@ -1,1366 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2014-2021 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/>
-*/
-/**
- * @file json/json_helper.c
- * @brief helper functions to generate specifications to parse
- *        Taler-specific JSON objects with libgnunetjson
- * @author Sree Harsha Totakura <sreeharsha@totakura.in>
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include <gnunet/gnunet_util_lib.h>
-#include <taler/taler_util.h>
-#include "taler/taler_json_lib.h"
-
-
-/**
- * Convert string value to numeric cipher value.
- *
- * @param cipher_s input string
- * @return numeric cipher value
- */
-// static enum TALER_DenominationCipher
-// string_to_cipher (const char *cipher_s)
-// {
-//   if ((0 == strcasecmp (cipher_s,
-//                         "RSA")) ||
-//       (0 == strcasecmp (cipher_s,
-//                         "RSA+age_restricted")))
-//     return TALER_DENOMINATION_RSA;
-//   if ((0 == strcasecmp (cipher_s,
-//                         "CS")) ||
-//       (0 == strcasecmp (cipher_s,
-//                         "CS+age_restricted")))
-//     return TALER_DENOMINATION_CS;
-//   return TALER_DENOMINATION_INVALID;
-// }
-
-
-// json_t *
-// TALER_JSON_from_amount (const struct TALER_Amount *amount)
-// {
-//   char *amount_str = TALER_amount_to_string (amount);
-
-//   GNUNET_assert (NULL != amount_str);
-//   {
-//     json_t *j = json_string (amount_str);
-
-//     GNUNET_free (amount_str);
-//     return j;
-//   }
-// }
-
-
-// /**
-//  * Parse given JSON object to Amount
-//  *
-//  * @param cls closure, expected currency, or NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_amount (void *cls,
-//               json_t *root,
-//               struct GNUNET_JSON_Specification *spec)
-// {
-//   const char *currency = cls;
-//   struct TALER_Amount *r_amount = spec->ptr;
-
-//   (void) cls;
-//   if (! json_is_string (root))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   if (GNUNET_OK !=
-//       TALER_string_to_amount (json_string_value (root),
-//                               r_amount))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   if ( (NULL != currency) &&
-//        (0 !=
-//         strcasecmp (currency,
-//                     r_amount->currency)) )
-//   {
-//     GNUNET_break_op (0);
-//     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-//                 "Expected currency `%s', but amount used currency `%s' in 
field `%s'\n",
-//                 currency,
-//                 r_amount->currency,
-//                 spec->field);
-//     return GNUNET_SYSERR;
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_amount (const char *name,
-//                         const char *currency,
-//                         struct TALER_Amount *r_amount)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_amount,
-//     .cleaner = NULL,
-//     .cls = (void *) currency,
-//     .field = name,
-//     .ptr = r_amount,
-//     .ptr_size = 0,
-//     .size_ptr = NULL
-//   };
-
-//   GNUNET_assert (NULL != currency);
-//   return ret;
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_amount_any (const char *name,
-//                             struct TALER_Amount *r_amount)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_amount,
-//     .cleaner = NULL,
-//     .cls = NULL,
-//     .field = name,
-//     .ptr = r_amount,
-//     .ptr_size = 0,
-//     .size_ptr = NULL
-//   };
-
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to currency spec.
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_cspec (void *cls,
-//              json_t *root,
-//              struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_CurrencySpecification *r_cspec = spec->ptr;
-//   const char *name;
-//   const char *currency;
-//   const char *decimal_separator;
-//   uint32_t fid;
-//   uint32_t fnd;
-//   uint32_t ftzd;
-//   const json_t *map;
-//   struct GNUNET_JSON_Specification gspec[] = {
-//     GNUNET_JSON_spec_string ("currency",
-//                              &currency),
-//     GNUNET_JSON_spec_string ("name",
-//                              &name),
-//     GNUNET_JSON_spec_string ("decimal_separator",
-//                              &decimal_separator),
-//     GNUNET_JSON_spec_uint32 ("num_fractional_input_digits",
-//                              &fid),
-//     GNUNET_JSON_spec_uint32 ("num_fractional_normal_digits",
-//                              &fnd),
-//     GNUNET_JSON_spec_uint32 ("num_fractional_trailing_zero_digits",
-//                              &ftzd),
-//     GNUNET_JSON_spec_bool ("is_currency_name_leading",
-//                            &r_cspec->is_currency_name_leading),
-//     GNUNET_JSON_spec_object_const ("alt_unit_names",
-//                                    &map),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   (void) cls;
-//   memset (r_cspec->currency,
-//           0,
-//           sizeof (r_cspec->currency));
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          gspec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-//                 "Failed to parse %s at %u: %s\n",
-//                 spec[eline].field,
-//                 eline,
-//                 emsg);
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   if (strlen (currency) >= TALER_CURRENCY_LEN)
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   if ( (fid > TALER_AMOUNT_FRAC_LEN) ||
-//        (fnd > TALER_AMOUNT_FRAC_LEN) ||
-//        (ftzd > TALER_AMOUNT_FRAC_LEN) )
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   if (GNUNET_OK !=
-//       TALER_check_currency (currency))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   strcpy (r_cspec->currency,
-//           currency);
-//   if (GNUNET_OK !=
-//       TALER_check_currency_scale_map (map))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   r_cspec->name = GNUNET_strdup (name);
-//   r_cspec->decimal_separator = GNUNET_strdup (decimal_separator);
-//   r_cspec->map_alt_unit_names = json_incref ((json_t *) map);
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Cleanup data left from parsing encrypted contract.
-//  *
-//  * @param cls closure, NULL
-//  * @param[out] spec where to free the data
-//  */
-// static void
-// clean_cspec (void *cls,
-//              struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_CurrencySpecification *cspec = spec->ptr;
-
-//   (void) cls;
-//   GNUNET_free (cspec->name);
-//   GNUNET_free (cspec->decimal_separator);
-//   json_decref (cspec->map_alt_unit_names);
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_currency_specification (
-//   const char *name,
-//   struct TALER_CurrencySpecification *r_cspec)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_cspec,
-//     .cleaner = &clean_cspec,
-//     .cls = NULL,
-//     .field = name,
-//     .ptr = r_cspec,
-//     .ptr_size = 0,
-//     .size_ptr = NULL
-//   };
-
-//   return ret;
-// }
-
-
-// static enum GNUNET_GenericReturnValue
-// parse_denomination_group (void *cls,
-//                           json_t *root,
-//                           struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_DenominationGroup *group = spec->ptr;
-//   const char *cipher;
-//   const char *currency = cls;
-//   bool age_mask_missing = false;
-//   bool has_age_restricted_suffix = false;
-//   struct GNUNET_JSON_Specification gspec[] = {
-//     GNUNET_JSON_spec_string ("cipher",
-//                              &cipher),
-//     TALER_JSON_spec_amount ("value",
-//                             currency,
-//                             &group->value),
-//     TALER_JSON_SPEC_DENOM_FEES ("fee",
-//                                 currency,
-//                                 &group->fees),
-//     GNUNET_JSON_spec_mark_optional (
-//       GNUNET_JSON_spec_uint32 ("age_mask",
-//                                &group->age_mask.bits),
-//       &age_mask_missing),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          gspec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-//                 "Failed to parse %s at %u: %s\n",
-//                 spec[eline].field,
-//                 eline,
-//                 emsg);
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-
-//   group->cipher = string_to_cipher (cipher);
-//   if (TALER_DENOMINATION_INVALID == group->cipher)
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-
-//   /* age_mask and suffix must be consistent */
-//   has_age_restricted_suffix =
-//     (NULL != strstr (cipher, "+age_restricted"));
-//   if (has_age_restricted_suffix && age_mask_missing)
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-
-//   if (age_mask_missing)
-//     group->age_mask.bits = 0;
-
-//   return GNUNET_OK;
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_denomination_group (const char *name,
-//                                     const char *currency,
-//                                     struct TALER_DenominationGroup *group)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .cls = (void *) currency,
-//     .parser = &parse_denomination_group,
-//     .cleaner = NULL,
-//     .field = name,
-//     .ptr = group,
-//     .ptr_size = sizeof(*group),
-//     .size_ptr = NULL,
-//   };
-
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to an encrypted contract.
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_econtract (void *cls,
-//                  json_t *root,
-//                  struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_EncryptedContract *econtract = spec->ptr;
-//   struct GNUNET_JSON_Specification ispec[] = {
-//     GNUNET_JSON_spec_varsize ("econtract",
-//                               &econtract->econtract,
-//                               &econtract->econtract_size),
-//     GNUNET_JSON_spec_fixed_auto ("econtract_sig",
-//                                  &econtract->econtract_sig),
-//     GNUNET_JSON_spec_fixed_auto ("contract_pub",
-//                                  &econtract->contract_pub),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   (void) cls;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          ispec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Cleanup data left from parsing encrypted contract.
-//  *
-//  * @param cls closure, NULL
-//  * @param[out] spec where to free the data
-//  */
-// static void
-// clean_econtract (void *cls,
-//                  struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_EncryptedContract *econtract = spec->ptr;
-
-//   (void) cls;
-//   GNUNET_free (econtract->econtract);
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_econtract (const char *name,
-//                            struct TALER_EncryptedContract *econtract)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_econtract,
-//     .cleaner = &clean_econtract,
-//     .cls = NULL,
-//     .field = name,
-//     .ptr = econtract,
-//     .ptr_size = 0,
-//     .size_ptr = NULL
-//   };
-
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to an age commitmnet
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_age_commitment (void *cls,
-//                       json_t *root,
-//                       struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_AgeCommitment *age_commitment = spec->ptr;
-//   json_t *pk;
-//   unsigned int idx;
-//   size_t num;
-
-//   (void) cls;
-//   if ( (NULL == root) ||
-//        (! json_is_array (root)))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-
-//   num = json_array_size (root);
-//   if (32 <= num || 0 == num)
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-
-//   age_commitment->num = num;
-//   age_commitment->keys =
-//     GNUNET_new_array (num,
-//                       struct TALER_AgeCommitmentPublicKeyP);
-
-//   json_array_foreach (root, idx, pk) {
-//     const char *emsg;
-//     unsigned int eline;
-//     struct GNUNET_JSON_Specification pkspec[] = {
-//       GNUNET_JSON_spec_fixed_auto (
-//         NULL,
-//         &age_commitment->keys[idx].pub),
-//       GNUNET_JSON_spec_end ()
-//     };
-
-//     if (GNUNET_OK !=
-//         GNUNET_JSON_parse (pk,
-//                            pkspec,
-//                            &emsg,
-//                            &eline))
-//     {
-//       GNUNET_break_op (0);
-//       GNUNET_JSON_parse_free (spec);
-//       return GNUNET_SYSERR;
-//     }
-//   };
-
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Cleanup data left fom parsing age commitment
-//  *
-//  * @param cls closure, NULL
-//  * @param[out] spec where to free the data
-//  */
-// static void
-// clean_age_commitment (void *cls,
-//                       struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_AgeCommitment *age_commitment = spec->ptr;
-
-//   (void) cls;
-
-//   if (NULL == age_commitment ||
-//       NULL == age_commitment->keys)
-//     return;
-
-//   age_commitment->num = 0;
-//   GNUNET_free (age_commitment->keys);
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_age_commitment (const char *name,
-//                                 struct TALER_AgeCommitment *age_commitment)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_age_commitment,
-//     .cleaner = &clean_age_commitment,
-//     .cls = NULL,
-//     .field = name,
-//     .ptr = age_commitment,
-//     .ptr_size = 0,
-//     .size_ptr = NULL
-//   };
-
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to denomination public key.
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_denom_pub (void *cls,
-//                  json_t *root,
-//                  struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_DenominationPublicKey *denom_pub = spec->ptr;
-//   const char *cipher;
-//   bool age_mask_missing = false;
-//   struct GNUNET_JSON_Specification dspec[] = {
-//     GNUNET_JSON_spec_string ("cipher",
-//                              &cipher),
-//     GNUNET_JSON_spec_mark_optional (
-//       GNUNET_JSON_spec_uint32 ("age_mask",
-//                                &denom_pub->age_mask.bits),
-//       &age_mask_missing),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   (void) cls;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          dspec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-
-//   if (age_mask_missing)
-//     denom_pub->age_mask.bits = 0;
-
-//   denom_pub->cipher = string_to_cipher (cipher);
-//   switch (denom_pub->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_rsa_public_key (
-//           "rsa_public_key",
-//           &denom_pub->details.rsa_public_key),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//   case TALER_DENOMINATION_CS:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_fixed ("cs_public_key",
-//                                 &denom_pub->details.cs_public_key,
-//                                 sizeof (denom_pub->details.cs_public_key)),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//   default:
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-// }
-
-
-// /**
-//  * Cleanup data left from parsing denomination public key.
-//  *
-//  * @param cls closure, NULL
-//  * @param[out] spec where to free the data
-//  */
-// static void
-// clean_denom_pub (void *cls,
-//                  struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_DenominationPublicKey *denom_pub = spec->ptr;
-
-//   (void) cls;
-//   TALER_denom_pub_free (denom_pub);
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_denom_pub (const char *field,
-//                            struct TALER_DenominationPublicKey *pk)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_denom_pub,
-//     .cleaner = &clean_denom_pub,
-//     .field = field,
-//     .ptr = pk
-//   };
-
-//   pk->cipher = TALER_DENOMINATION_INVALID;
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object partially into a denomination public key.
-//  *
-//  * Depending on the cipher in cls, it parses the corresponding public key 
type.
-//  *
-//  * @param cls closure, enum TALER_DenominationCipher
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_denom_pub_cipher (void *cls,
-//                         json_t *root,
-//                         struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_DenominationPublicKey *denom_pub = spec->ptr;
-//   enum TALER_DenominationCipher cipher =
-//     (enum TALER_DenominationCipher) (long) cls;
-//   const char *emsg;
-//   unsigned int eline;
-
-//   switch (cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_rsa_public_key (
-//           "rsa_pub",
-//           &denom_pub->details.rsa_public_key),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       denom_pub->cipher = cipher;
-//       return GNUNET_OK;
-//     }
-//   case TALER_DENOMINATION_CS:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_fixed ("cs_pub",
-//                                 &denom_pub->details.cs_public_key,
-//                                 sizeof (denom_pub->details.cs_public_key)),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       denom_pub->cipher = cipher;
-//       return GNUNET_OK;
-//     }
-//   default:
-//     GNUNET_break_op (0);
-//     denom_pub->cipher = 0;
-//     return GNUNET_SYSERR;
-//   }
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_denom_pub_cipher (const char *field,
-//                                   enum TALER_DenominationCipher cipher,
-//                                   struct TALER_DenominationPublicKey *pk)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_denom_pub_cipher,
-//     .cleaner = &clean_denom_pub,
-//     .field = field,
-//     .cls = (void *) cipher,
-//     .ptr = pk
-//   };
-
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to denomination signature.
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_denom_sig (void *cls,
-//                  json_t *root,
-//                  struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_DenominationSignature *denom_sig = spec->ptr;
-//   const char *cipher;
-//   struct GNUNET_JSON_Specification dspec[] = {
-//     GNUNET_JSON_spec_string ("cipher",
-//                              &cipher),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   (void) cls;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          dspec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   denom_sig->cipher = string_to_cipher (cipher);
-//   switch (denom_sig->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_rsa_signature (
-//           "rsa_signature",
-//           &denom_sig->details.rsa_signature),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//   case TALER_DENOMINATION_CS:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_fixed_auto ("cs_signature_r",
-//                                      
&denom_sig->details.cs_signature.r_point),
-//         GNUNET_JSON_spec_fixed_auto ("cs_signature_s",
-//                                      
&denom_sig->details.cs_signature.s_scalar),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//   default:
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-// }
-
-
-// /**
-//  * Cleanup data left from parsing denomination public key.
-//  *
-//  * @param cls closure, NULL
-//  * @param[out] spec where to free the data
-//  */
-// static void
-// clean_denom_sig (void *cls,
-//                  struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_DenominationSignature *denom_sig = spec->ptr;
-
-//   (void) cls;
-//   TALER_denom_sig_free (denom_sig);
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_denom_sig (const char *field,
-//                            struct TALER_DenominationSignature *sig)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_denom_sig,
-//     .cleaner = &clean_denom_sig,
-//     .field = field,
-//     .ptr = sig
-//   };
-
-//   sig->cipher = TALER_DENOMINATION_INVALID;
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to blinded denomination signature.
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_blinded_denom_sig (void *cls,
-//                          json_t *root,
-//                          struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_BlindedDenominationSignature *denom_sig = spec->ptr;
-//   const char *cipher;
-//   struct GNUNET_JSON_Specification dspec[] = {
-//     GNUNET_JSON_spec_string ("cipher",
-//                              &cipher),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   (void) cls;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          dspec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   denom_sig->cipher = string_to_cipher (cipher);
-//   switch (denom_sig->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_rsa_signature (
-//           "blinded_rsa_signature",
-//           &denom_sig->details.blinded_rsa_signature),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//   case TALER_DENOMINATION_CS:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_uint32 ("b",
-//                                  &denom_sig->details.blinded_cs_answer.b),
-//         GNUNET_JSON_spec_fixed_auto ("s",
-//                                      &denom_sig->details.blinded_cs_answer.
-//                                      s_scalar),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//     break;
-//   default:
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-// }
-
-
-// /**
-//  * Cleanup data left from parsing denomination public key.
-//  *
-//  * @param cls closure, NULL
-//  * @param[out] spec where to free the data
-//  */
-// static void
-// clean_blinded_denom_sig (void *cls,
-//                          struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_BlindedDenominationSignature *denom_sig = spec->ptr;
-
-//   (void) cls;
-//   TALER_blinded_denom_sig_free (denom_sig);
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_blinded_denom_sig (
-//   const char *field,
-//   struct TALER_BlindedDenominationSignature *sig)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_blinded_denom_sig,
-//     .cleaner = &clean_blinded_denom_sig,
-//     .field = field,
-//     .ptr = sig
-//   };
-
-//   sig->cipher = TALER_DENOMINATION_INVALID;
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to blinded planchet.
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_blinded_planchet (void *cls,
-//                         json_t *root,
-//                         struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_BlindedPlanchet *blinded_planchet = spec->ptr;
-//   const char *cipher;
-//   struct GNUNET_JSON_Specification dspec[] = {
-//     GNUNET_JSON_spec_string ("cipher",
-//                              &cipher),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   (void) cls;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          dspec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   blinded_planchet->cipher = string_to_cipher (cipher);
-//   switch (blinded_planchet->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_varsize (
-//           "rsa_blinded_planchet",
-//           &blinded_planchet->details.rsa_blinded_planchet.blinded_msg,
-//           &blinded_planchet->details.rsa_blinded_planchet.blinded_msg_size),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//   case TALER_DENOMINATION_CS:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_fixed_auto (
-//           "cs_nonce",
-//           &blinded_planchet->details.cs_blinded_planchet.nonce),
-//         GNUNET_JSON_spec_fixed_auto (
-//           "cs_blinded_c0",
-//           &blinded_planchet->details.cs_blinded_planchet.c[0]),
-//         GNUNET_JSON_spec_fixed_auto (
-//           "cs_blinded_c1",
-//           &blinded_planchet->details.cs_blinded_planchet.c[1]),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//     break;
-//   default:
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-// }
-
-
-// /**
-//  * Cleanup data left from parsing blinded planchet.
-//  *
-//  * @param cls closure, NULL
-//  * @param[out] spec where to free the data
-//  */
-// static void
-// clean_blinded_planchet (void *cls,
-//                         struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_BlindedPlanchet *blinded_planchet = spec->ptr;
-
-//   (void) cls;
-//   TALER_blinded_planchet_free (blinded_planchet);
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_blinded_planchet (const char *field,
-//                                   struct TALER_BlindedPlanchet 
*blinded_planchet)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_blinded_planchet,
-//     .cleaner = &clean_blinded_planchet,
-//     .field = field,
-//     .ptr = blinded_planchet
-//   };
-
-//   blinded_planchet->cipher = TALER_DENOMINATION_INVALID;
-//   return ret;
-// }
-
-
-// /**
-//  * Parse given JSON object to exchange withdraw values (/csr).
-//  *
-//  * @param cls closure, NULL
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_exchange_withdraw_values (void *cls,
-//                                 json_t *root,
-//                                 struct GNUNET_JSON_Specification *spec)
-// {
-//   struct TALER_ExchangeWithdrawValues *ewv = spec->ptr;
-//   const char *cipher;
-//   struct GNUNET_JSON_Specification dspec[] = {
-//     GNUNET_JSON_spec_string ("cipher",
-//                              &cipher),
-//     GNUNET_JSON_spec_end ()
-//   };
-//   const char *emsg;
-//   unsigned int eline;
-
-//   (void) cls;
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (root,
-//                          dspec,
-//                          &emsg,
-//                          &eline))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   ewv->cipher = string_to_cipher (cipher);
-//   switch (ewv->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     return GNUNET_OK;
-//   case TALER_DENOMINATION_CS:
-//     {
-//       struct GNUNET_JSON_Specification ispec[] = {
-//         GNUNET_JSON_spec_fixed (
-//           "r_pub_0",
-//           &ewv->details.cs_values.r_pub[0],
-//           sizeof (struct GNUNET_CRYPTO_CsRPublic)),
-//         GNUNET_JSON_spec_fixed (
-//           "r_pub_1",
-//           &ewv->details.cs_values.r_pub[1],
-//           sizeof (struct GNUNET_CRYPTO_CsRPublic)),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (root,
-//                              ispec,
-//                              &emsg,
-//                              &eline))
-//       {
-//         GNUNET_break_op (0);
-//         return GNUNET_SYSERR;
-//       }
-//       return GNUNET_OK;
-//     }
-//   default:
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_exchange_withdraw_values (
-//   const char *field,
-//   struct TALER_ExchangeWithdrawValues *ewv)
-// {
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_exchange_withdraw_values,
-//     .field = field,
-//     .ptr = ewv
-//   };
-
-//   ewv->cipher = TALER_DENOMINATION_INVALID;
-//   return ret;
-// }
-
-
-// /**
-//  * Closure for #parse_i18n_string.
-//  */
-// struct I18nContext
-// {
-//   /**
-//    * Language pattern to match.
-//    */
-//   char *lp;
-
-//   /**
-//    * Name of the field to match.
-//    */
-//   const char *field;
-// };
-
-
-// /**
-//  * Parse given JSON object to internationalized string.
-//  *
-//  * @param cls closure, our `struct I18nContext *`
-//  * @param root the json object representing data
-//  * @param[out] spec where to write the data
-//  * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
-//  */
-// static enum GNUNET_GenericReturnValue
-// parse_i18n_string (void *cls,
-//                    json_t *root,
-//                    struct GNUNET_JSON_Specification *spec)
-// {
-//   struct I18nContext *ctx = cls;
-//   json_t *i18n;
-//   json_t *val;
-
-//   {
-//     char *i18nf;
-
-//     GNUNET_asprintf (&i18nf,
-//                      "%s_i18n",
-//                      ctx->field);
-//     i18n = json_object_get (root,
-//                             i18nf);
-//     GNUNET_free (i18nf);
-//   }
-
-//   val = json_object_get (root,
-//                          ctx->field);
-//   if ( (NULL != i18n) &&
-//        (NULL != ctx->lp) )
-//   {
-//     double best = 0.0;
-//     json_t *pos;
-//     const char *lang;
-
-//     json_object_foreach (i18n, lang, pos)
-//     {
-//       double score;
-
-//       score = TALER_language_matches (ctx->lp,
-//                                       lang);
-//       if (score > best)
-//       {
-//         best = score;
-//         val = pos;
-//       }
-//     }
-//   }
-
-//   {
-//     const char *str;
-
-//     str = json_string_value (val);
-//     *(const char **) spec->ptr = str;
-//   }
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Function called to clean up data from earlier parsing.
-//  *
-//  * @param cls closure
-//  * @param spec our specification entry with data to clean.
-//  */
-// static void
-// i18n_cleaner (void *cls,
-//               struct GNUNET_JSON_Specification *spec)
-// {
-//   struct I18nContext *ctx = cls;
-
-//   (void) spec;
-//   if (NULL != ctx)
-//   {
-//     GNUNET_free (ctx->lp);
-//     GNUNET_free (ctx);
-//   }
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_i18n_string (const char *name,
-//                              const char *language_pattern,
-//                              const char **strptr)
-// {
-//   struct I18nContext *ctx = GNUNET_new (struct I18nContext);
-//   struct GNUNET_JSON_Specification ret = {
-//     .parser = &parse_i18n_string,
-//     .cleaner = &i18n_cleaner,
-//     .cls = ctx,
-//     .field = NULL, /* we want the main object */
-//     .ptr = strptr,
-//     .ptr_size = 0,
-//     .size_ptr = NULL
-//   };
-
-//   ctx->lp = (NULL != language_pattern)
-//     ? GNUNET_strdup (language_pattern)
-//     : NULL;
-//   ctx->field = name;
-//   *strptr = NULL;
-//   return ret;
-// }
-
-
-// struct GNUNET_JSON_Specification
-// TALER_JSON_spec_i18n_str (const char *name,
-//                           const char **strptr)
-// {
-//   const char *lang = getenv ("LANG");
-//   char *dot;
-//   char *l;
-//   struct GNUNET_JSON_Specification ret;
-
-//   if (NULL != lang)
-//   {
-//     dot = strchr (lang,
-//                   '.');
-//     if (NULL == dot)
-//       l = GNUNET_strdup (lang);
-//     else
-//       l = GNUNET_strndup (lang,
-//                           dot - lang);
-//   }
-//   else
-//   {
-//     l = NULL;
-//   }
-//   ret = TALER_JSON_spec_i18n_string (name,
-//                                      l,
-//                                      strptr);
-//   GNUNET_free (l);
-//   return ret;
-// }
-
-
-/* end of json/json_helper.c */
diff --git a/src/json/json_pack.c b/src/json/json_pack.c
deleted file mode 100644
index e7b8a24..0000000
--- a/src/json/json_pack.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2021, 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/>
-*/
-/**
- * @file json/json_pack.c
- * @brief helper functions for JSON object packing
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include <gnunet/gnunet_util_lib.h>
-#include <taler/taler_util.h>
-#include "taler/taler_json_lib.h"
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_time_abs_human (const char *name,
-//                                 struct GNUNET_TIME_Absolute at)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//     .object = json_string (
-//       GNUNET_STRINGS_absolute_time_to_string (at))
-//   };
-
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_econtract (
-//   const char *name,
-//   const struct TALER_EncryptedContract *econtract)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//   };
-
-//   if (NULL == econtract)
-//     return ps;
-//   ps.object
-//     = GNUNET_JSON_PACK (
-//         GNUNET_JSON_pack_data_varsize ("econtract",
-//                                        econtract->econtract,
-//                                        econtract->econtract_size),
-//         GNUNET_JSON_pack_data_auto ("econtract_sig",
-//                                     &econtract->econtract_sig),
-//         GNUNET_JSON_pack_data_auto ("contract_pub",
-//                                     &econtract->contract_pub));
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_age_commitment (
-//   const char *name,
-//   const struct TALER_AgeCommitment *age_commitment)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//   };
-//   json_t *keys;
-
-//   if (NULL == age_commitment ||
-//       0 == age_commitment->num)
-//     return ps;
-
-//   GNUNET_assert (NULL !=
-//                  (keys = json_array ()));
-
-//   for (size_t i = 0;
-//        i < age_commitment->num;
-//        i++)
-//   {
-//     json_t *val;
-//     val = GNUNET_JSON_from_data (&age_commitment->keys[i],
-//                                  sizeof(age_commitment->keys[i]));
-//     GNUNET_assert (NULL != val);
-//     GNUNET_assert (0 ==
-//                    json_array_append_new (keys, val));
-//   }
-
-//   ps.object = keys;
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_denom_pub (
-//   const char *name,
-//   const struct TALER_DenominationPublicKey *pk)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//   };
-
-//   if (NULL == pk)
-//     return ps;
-//   switch (pk->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     ps.object
-//       = GNUNET_JSON_PACK (
-//           GNUNET_JSON_pack_string ("cipher", "RSA"),
-//           GNUNET_JSON_pack_uint64 ("age_mask",
-//                                    pk->age_mask.bits),
-//           GNUNET_JSON_pack_rsa_public_key ("rsa_public_key",
-//                                            pk->details.rsa_public_key));
-//     break;
-//   case TALER_DENOMINATION_CS:
-//     ps.object
-//       = GNUNET_JSON_PACK (
-//           GNUNET_JSON_pack_string ("cipher", "CS"),
-//           GNUNET_JSON_pack_uint64 ("age_mask",
-//                                    pk->age_mask.bits),
-//           GNUNET_JSON_pack_data_varsize ("cs_public_key",
-//                                          &pk->details.cs_public_key,
-//                                          sizeof 
(pk->details.cs_public_key)));
-//     break;
-//   default:
-//     GNUNET_assert (0);
-//   }
-
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_denom_sig (
-//   const char *name,
-//   const struct TALER_DenominationSignature *sig)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//   };
-
-//   if (NULL == sig)
-//     return ps;
-//   switch (sig->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "RSA"),
-//       GNUNET_JSON_pack_rsa_signature ("rsa_signature",
-//                                       sig->details.rsa_signature));
-//     break;
-//   case TALER_DENOMINATION_CS:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "CS"),
-//       GNUNET_JSON_pack_data_auto ("cs_signature_r",
-//                                   &sig->details.cs_signature.r_point),
-//       GNUNET_JSON_pack_data_auto ("cs_signature_s",
-//                                   &sig->details.cs_signature.s_scalar));
-//     break;
-//   default:
-//     GNUNET_assert (0);
-//   }
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_exchange_withdraw_values (
-//   const char *name,
-//   const struct TALER_ExchangeWithdrawValues *ewv)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//   };
-
-//   if (NULL == ewv)
-//     return ps;
-//   switch (ewv->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "RSA"));
-//     break;
-//   case TALER_DENOMINATION_CS:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "CS"),
-//       GNUNET_JSON_pack_data_varsize (
-//         "r_pub_0",
-//         &ewv->details.cs_values.r_pub[0],
-//         sizeof(struct GNUNET_CRYPTO_CsRPublic)),
-//       GNUNET_JSON_pack_data_varsize (
-//         "r_pub_1",
-//         &ewv->details.cs_values.r_pub[1],
-//         sizeof(struct GNUNET_CRYPTO_CsRPublic))
-//       );
-//     break;
-//   default:
-//     GNUNET_assert (0);
-//   }
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_blinded_denom_sig (
-//   const char *name,
-//   const struct TALER_BlindedDenominationSignature *sig)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//   };
-
-//   if (NULL == sig)
-//     return ps;
-//   switch (sig->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "RSA"),
-//       GNUNET_JSON_pack_rsa_signature ("blinded_rsa_signature",
-//                                       sig->details.blinded_rsa_signature));
-//     break;
-//   case TALER_DENOMINATION_CS:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "CS"),
-//       GNUNET_JSON_pack_uint64 ("b",
-//                                sig->details.blinded_cs_answer.b),
-//       GNUNET_JSON_pack_data_auto ("s",
-//                                   
&sig->details.blinded_cs_answer.s_scalar));
-//     break;
-//   default:
-//     GNUNET_assert (0);
-//   }
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_blinded_planchet (
-//   const char *name,
-//   const struct TALER_BlindedPlanchet *blinded_planchet)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//   };
-
-//   if (NULL == blinded_planchet)
-//     return ps;
-//   switch (blinded_planchet->cipher)
-//   {
-//   case TALER_DENOMINATION_RSA:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "RSA"),
-//       GNUNET_JSON_pack_data_varsize (
-//         "rsa_blinded_planchet",
-//         blinded_planchet->details.rsa_blinded_planchet.blinded_msg,
-//         blinded_planchet->details.rsa_blinded_planchet.blinded_msg_size));
-//     break;
-//   case TALER_DENOMINATION_CS:
-//     ps.object = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_string ("cipher",
-//                                "CS"),
-//       GNUNET_JSON_pack_data_auto (
-//         "cs_nonce",
-//         &blinded_planchet->details.cs_blinded_planchet.nonce),
-//       GNUNET_JSON_pack_data_auto (
-//         "cs_blinded_c0",
-//         &blinded_planchet->details.cs_blinded_planchet.c[0]),
-//       GNUNET_JSON_pack_data_auto (
-//         "cs_blinded_c1",
-//         &blinded_planchet->details.cs_blinded_planchet.c[1]));
-//     break;
-//   default:
-//     GNUNET_assert (0);
-//   }
-//   return ps;
-// }
-
-
-// struct GNUNET_JSON_PackSpec
-// TALER_JSON_pack_amount (const char *name,
-//                         const struct TALER_Amount *amount)
-// {
-//   struct GNUNET_JSON_PackSpec ps = {
-//     .field_name = name,
-//     .object = (NULL != amount)
-//               ? TALER_JSON_from_amount (amount)
-//               : NULL
-//   };
-
-//   return ps;
-// }
-
-
-/* End of json/json_pack.c */
diff --git a/src/json/test_json.c b/src/json/test_json.c
deleted file mode 100644
index aecbe36..0000000
--- a/src/json/test_json.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
-  This file is part of TALER
-  (C) 2015, 2016, 2020 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/>
-*/
-
-/**
- * @file json/test_json.c
- * @brief Tests for Taler-specific crypto logic
- * @author Christian Grothoff <christian@grothoff.org>
- */
-#include "taler/platform.h"
-#include <taler/taler_util.h>
-#include "taler/taler_json_lib.h"
-
-
-/**
- * Test amount conversion from/to JSON.
- *
- * @return 0 on success
- */
-static int
-test_amount (void)
-{
-  json_t *j;
-  struct TALER_Amount a1;
-  struct TALER_Amount a2;
-  struct GNUNET_JSON_Specification spec[] = {
-    TALER_JSON_spec_amount ("amount",
-                            "EUR",
-                            &a2),
-    GNUNET_JSON_spec_end ()
-  };
-
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount ("EUR:4.3",
-                                         &a1));
-  j = json_pack ("{s:o}", "amount", TALER_JSON_from_amount (&a1));
-  GNUNET_assert (NULL != j);
-  GNUNET_assert (GNUNET_OK ==
-                 GNUNET_JSON_parse (j, spec,
-                                    NULL, NULL));
-  GNUNET_assert (0 ==
-                 TALER_amount_cmp (&a1,
-                                   &a2));
-  json_decref (j);
-  return 0;
-}
-
-
-struct TestPath_Closure
-{
-  const char **object_ids;
-
-  const json_t **parents;
-
-  unsigned int results_length;
-
-  int cmp_result;
-};
-
-
-static void
-path_cb (void *cls,
-         const char *object_id,
-         json_t *parent)
-{
-  struct TestPath_Closure *cmp = cls;
-  if (NULL == cmp)
-    return;
-  unsigned int i = cmp->results_length;
-  if ((0 != strcmp (cmp->object_ids[i],
-                    object_id)) ||
-      (1 != json_equal (cmp->parents[i],
-                        parent)))
-    cmp->cmp_result = 1;
-  cmp->results_length += 1;
-}
-
-
-static int
-test_contract (void)
-{
-  struct TALER_PrivateContractHashP h1;
-  struct TALER_PrivateContractHashP h2;
-  json_t *c1;
-  json_t *c2;
-  json_t *c3;
-  json_t *c4;
-
-  c1 = json_pack ("{s:s, s:{s:s, s:{s:b}}}",
-                  "k1", "v1",
-                  "k2", "n1", "n2",
-                  /***/ "$forgettable", "n1", true);
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_seed_forgettable (c1));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c1,
-                                           &h1));
-  json_decref (c1);
-
-  c1 = json_pack ("{s:s, s:{s:s, s:{s:s}}}",
-                  "k1", "v1",
-                  "k2", "n1", "n2",
-                  /***/ "$forgettable", "n1", "salt");
-  GNUNET_assert (NULL != c1);
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_mark_forgettable (c1,
-                                                       "k1"));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_mark_forgettable (c1,
-                                                       "k2"));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c1,
-                                           &h1));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_part_forget (c1,
-                                                  "k1"));
-  /* check salt was forgotten */
-  GNUNET_assert (NULL ==
-                 json_object_get (json_object_get (c1,
-                                                   "$forgettable"),
-                                  "k1"));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c1,
-                                           &h2));
-  if (0 !=
-      GNUNET_memcmp (&h1,
-                     &h2))
-  {
-    GNUNET_break (0);
-    json_decref (c1);
-    return 1;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_part_forget (json_object_get (c1,
-                                                                   "k2"),
-                                                  "n1"));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c1,
-                                           &h2));
-  if (0 !=
-      GNUNET_memcmp (&h1,
-                     &h2))
-  {
-    GNUNET_break (0);
-    json_decref (c1);
-    return 1;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_part_forget (c1,
-                                                  "k2"));
-  // json_dumpf (c1, stderr, JSON_INDENT (2));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c1,
-                                           &h2));
-  json_decref (c1);
-  if (0 !=
-      GNUNET_memcmp (&h1,
-                     &h2))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
-
-  c1 = json_pack ("{s:I, s:{s:s}, s:{s:b, s:{s:s}}, s:{s:s}}",
-                  "k1", 1,
-                  "$forgettable", "k1", "SALT",
-                  "k2", "n1", true,
-                  /***/ "$forgettable", "n1", "salt",
-                  "k3", "n1", "string");
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c1,
-                                           &h1));
-  // json_dumpf (c1, stderr, JSON_INDENT (2));
-  json_decref (c1);
-  {
-    char *s;
-
-    s = GNUNET_STRINGS_data_to_string_alloc (&h1,
-                                             sizeof (h1));
-    if (0 !=
-        strcmp (s,
-                
"VDE8JPX0AEEE3EX1K8E11RYEWSZQKGGZCV6BWTE4ST1C8711P7H850Z7F2Q2HSSYETX87ERC2JNHWB7GTDWTDWMM716VKPSRBXD7SRR"))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Invalid reference hash: %s\n",
-                  s);
-      GNUNET_free (s);
-      return 1;
-    }
-    GNUNET_free (s);
-  }
-
-
-  c2 = json_pack ("{s:s}",
-                  "n1", "n2");
-  GNUNET_assert (NULL != c2);
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_mark_forgettable (c2,
-                                                       "n1"));
-  c3 = json_pack ("{s:s, s:o}",
-                  "k1", "v1",
-                  "k2", c2);
-  GNUNET_assert (NULL != c3);
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_mark_forgettable (c3,
-                                                       "k1"));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c3,
-                                           &h1));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_part_forget (c2,
-                                                  "n1"));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c3,
-                                           &h2));
-  json_decref (c3);
-  c4 = json_pack ("{s:{s:s}, s:[{s:s}, {s:s}, {s:s}]}",
-                  "abc1",
-                  "xyz", "value",
-                  "fruit",
-                  "name", "banana",
-                  "name", "apple",
-                  "name", "orange");
-  GNUNET_assert (NULL != c4);
-  GNUNET_assert (GNUNET_SYSERR ==
-                 TALER_JSON_expand_path (c4,
-                                         "%.xyz",
-                                         &path_cb,
-                                         NULL));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_expand_path (c4,
-                                         "$.nonexistent_id",
-                                         &path_cb,
-                                         NULL));
-  GNUNET_assert (GNUNET_SYSERR ==
-                 TALER_JSON_expand_path (c4,
-                                         "$.fruit[n]",
-                                         &path_cb,
-                                         NULL));
-
-  {
-    const char *object_ids[] = { "xyz" };
-    const json_t *parents[] = {
-      json_object_get (c4,
-                       "abc1")
-    };
-    struct TestPath_Closure tp = {
-      .object_ids = object_ids,
-      .parents = parents,
-      .results_length = 0,
-      .cmp_result = 0
-    };
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_JSON_expand_path (c4,
-                                           "$.abc1.xyz",
-                                           &path_cb,
-                                           &tp));
-    GNUNET_assert (1 == tp.results_length);
-    GNUNET_assert (0 == tp.cmp_result);
-  }
-  {
-    const char *object_ids[] = { "name" };
-    const json_t *parents[] = {
-      json_array_get (json_object_get (c4,
-                                       "fruit"),
-                      0)
-    };
-    struct TestPath_Closure tp = {
-      .object_ids = object_ids,
-      .parents = parents,
-      .results_length = 0,
-      .cmp_result = 0
-    };
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_JSON_expand_path (c4,
-                                           "$.fruit[0].name",
-                                           &path_cb,
-                                           &tp));
-    GNUNET_assert (1 == tp.results_length);
-    GNUNET_assert (0 == tp.cmp_result);
-  }
-  {
-    const char *object_ids[] = { "name", "name", "name" };
-    const json_t *parents[] = {
-      json_array_get (json_object_get (c4,
-                                       "fruit"),
-                      0),
-      json_array_get (json_object_get (c4,
-                                       "fruit"),
-                      1),
-      json_array_get (json_object_get (c4,
-                                       "fruit"),
-                      2)
-    };
-    struct TestPath_Closure tp = {
-      .object_ids = object_ids,
-      .parents = parents,
-      .results_length = 0,
-      .cmp_result = 0
-    };
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_JSON_expand_path (c4,
-                                           "$.fruit[*].name",
-                                           &path_cb,
-                                           &tp));
-    GNUNET_assert (3 == tp.results_length);
-    GNUNET_assert (0 == tp.cmp_result);
-  }
-  json_decref (c4);
-  if (0 !=
-      GNUNET_memcmp (&h1,
-                     &h2))
-  {
-    GNUNET_break (0);
-    return 1;
-  }
-  return 0;
-}
-
-
-static int
-test_json_canon (void)
-{
-  {
-    json_t *c1;
-    char *canon;
-    c1 = json_pack ("{s:s}",
-                    "k1", "Hello\nWorld");
-
-    canon = TALER_JSON_canonicalize (c1);
-    GNUNET_assert (NULL != canon);
-
-    printf ("canon: '%s'\n", canon);
-
-    GNUNET_assert (0 == strcmp (canon,
-                                "{\"k1\":\"Hello\\nWorld\"}"));
-  }
-  {
-    json_t *c1;
-    char *canon;
-    c1 = json_pack ("{s:s}",
-                    "k1", "Testing “unicode” characters");
-
-    canon = TALER_JSON_canonicalize (c1);
-    GNUNET_assert (NULL != canon);
-
-    printf ("canon: '%s'\n", canon);
-
-    GNUNET_assert (0 == strcmp (canon,
-                                "{\"k1\":\"Testing “unicode” characters\"}"));
-  }
-  {
-    json_t *c1;
-    char *canon;
-    c1 = json_pack ("{s:s}",
-                    "k1", "low range \x05 chars");
-
-    canon = TALER_JSON_canonicalize (c1);
-    GNUNET_assert (NULL != canon);
-
-    printf ("canon: '%s'\n", canon);
-
-    GNUNET_assert (0 == strcmp (canon,
-                                "{\"k1\":\"low range \\u0005 chars\"}"));
-  }
-
-
-  return 0;
-}
-
-
-static int
-test_rfc8785 (void)
-{
-  struct TALER_PrivateContractHashP h1;
-  json_t *c1;
-
-  c1 = json_pack ("{s:s}",
-                  "k1", "\x08\x0B\t\1\\\x0d");
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_contract_hash (c1,
-                                           &h1));
-  {
-    char *s;
-
-    s = GNUNET_STRINGS_data_to_string_alloc (&h1,
-                                             sizeof (h1));
-    if (0 !=
-        strcmp (s,
-                
"531S33T8ZRGW6548G7T67PMDNGS4Z1D8A2GMB87G3PNKYTW6KGF7Q99XVCGXBKVA2HX6PR5ENJ1PQ5ZTYMMXQB6RM7S82VP7ZG2X5G8"))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Invalid reference hash: %s\n",
-                  s);
-      GNUNET_free (s);
-      json_decref (c1);
-      return 1;
-    }
-    GNUNET_free (s);
-  }
-  json_decref (c1);
-  return 0;
-}
-
-
-int
-main (int argc,
-      const char *const argv[])
-{
-  (void) argc;
-  (void) argv;
-  GNUNET_log_setup ("test-json",
-                    "WARNING",
-                    NULL);
-  if (0 != test_amount ())
-    return 1;
-  if (0 != test_contract ())
-    return 2;
-  if (0 != test_json_canon ())
-    return 2;
-  if (0 != test_rfc8785 ())
-    return 2;
-  return 0;
-}
-
-
-/* end of test_json.c */
diff --git a/src/lib/donau_api_charities_close.c 
b/src/lib/donau_api_charities_close.c
index 40c4715..3f76ee1 100644
--- a/src/lib/donau_api_charities_close.c
+++ b/src/lib/donau_api_charities_close.c
@@ -81,293 +81,4 @@ struct DONAU_ReservesCloseHandle
 
 };
 
-
-/**
- * We received an #MHD_HTTP_OK close code. Handle the JSON
- * response.
- *
- * @param rch handle of the request
- * @param j JSON response
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-handle_reserves_close_ok (struct DONAU_ReservesCloseHandle *rch,
-                          const json_t *j)
-{
-  struct DONAU_ReserveCloseResult rs = {
-    .hr.reply = j,
-    .hr.http_status = MHD_HTTP_OK,
-  };
-  struct GNUNET_JSON_Specification spec[] = {
-    TALER_JSON_spec_amount_any ("wire_amount",
-                                &rs.details.ok.wire_amount),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (j,
-                         spec,
-                         NULL,
-                         NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  rch->cb (rch->cb_cls,
-           &rs);
-  rch->cb = NULL;
-  GNUNET_JSON_parse_free (spec);
-  return GNUNET_OK;
-}
-
-
-/**
- * We received an #MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS close code. Handle 
the JSON
- * response.
- *
- * @param rch handle of the request
- * @param j JSON response
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-handle_reserves_close_kyc (struct DONAU_ReservesCloseHandle *rch,
-                           const json_t *j)
-{
-  struct DONAU_ReserveCloseResult rs = {
-    .hr.reply = j,
-    .hr.http_status = MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS,
-  };
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto (
-      "h_payto",
-      &rs.details.unavailable_for_legal_reasons.h_payto),
-    GNUNET_JSON_spec_uint64 (
-      "requirement_row",
-      &rs.details.unavailable_for_legal_reasons.requirement_row),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (j,
-                         spec,
-                         NULL,
-                         NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  rch->cb (rch->cb_cls,
-           &rs);
-  rch->cb = NULL;
-  GNUNET_JSON_parse_free (spec);
-  return GNUNET_OK;
-}
-
-
-/**
- * Function called when we're done processing the
- * HTTP /reserves/$RID/close request.
- *
- * @param cls the `struct DONAU_ReservesCloseHandle`
- * @param response_code HTTP response code, 0 on error
- * @param response parsed JSON result, NULL on error
- */
-static void
-handle_reserves_close_finished (void *cls,
-                                long response_code,
-                                const void *response)
-{
-  struct DONAU_ReservesCloseHandle *rch = cls;
-  const json_t *j = response;
-  struct DONAU_ReserveCloseResult rs = {
-    .hr.reply = j,
-    .hr.http_status = (unsigned int) response_code
-  };
-
-  rch->job = NULL;
-  switch (response_code)
-  {
-  case 0:
-    rs.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
-    break;
-  case MHD_HTTP_OK:
-    if (GNUNET_OK !=
-        handle_reserves_close_ok (rch,
-                                  j))
-    {
-      GNUNET_break_op (0);
-      rs.hr.http_status = 0;
-      rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-    }
-    break;
-  case MHD_HTTP_BAD_REQUEST:
-    /* This should never happen, either us or the donau is buggy
-       (or API version conflict); just pass JSON reply to the application */
-    GNUNET_break (0);
-    rs.hr.ec = TALER_JSON_get_error_code (j);
-    rs.hr.hint = TALER_JSON_get_error_hint (j);
-    break;
-  case MHD_HTTP_FORBIDDEN:
-    /* This should never happen, either us or the donau is buggy
-       (or API version conflict); just pass JSON reply to the application */
-    GNUNET_break (0);
-    rs.hr.ec = TALER_JSON_get_error_code (j);
-    rs.hr.hint = TALER_JSON_get_error_hint (j);
-    break;
-  case MHD_HTTP_NOT_FOUND:
-    /* Nothing really to verify, this should never
-       happen, we should pass the JSON reply to the application */
-    rs.hr.ec = TALER_JSON_get_error_code (j);
-    rs.hr.hint = TALER_JSON_get_error_hint (j);
-    break;
-  case MHD_HTTP_CONFLICT:
-    /* Insufficient balance to inquire for reserve close */
-    rs.hr.ec = TALER_JSON_get_error_code (j);
-    rs.hr.hint = TALER_JSON_get_error_hint (j);
-    break;
-  case MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS:
-    if (GNUNET_OK !=
-        handle_reserves_close_kyc (rch,
-                                   j))
-    {
-      GNUNET_break_op (0);
-      rs.hr.http_status = 0;
-      rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-    }
-    break;
-  case MHD_HTTP_INTERNAL_SERVER_ERROR:
-    /* Server had an internal issue; we should retry, but this API
-       leaves this to the application */
-    rs.hr.ec = TALER_JSON_get_error_code (j);
-    rs.hr.hint = TALER_JSON_get_error_hint (j);
-    break;
-  default:
-    /* unexpected response code */
-    GNUNET_break_op (0);
-    rs.hr.ec = TALER_JSON_get_error_code (j);
-    rs.hr.hint = TALER_JSON_get_error_hint (j);
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected response code %u/%d for reserves close\n",
-                (unsigned int) response_code,
-                (int) rs.hr.ec);
-    break;
-  }
-  if (NULL != rch->cb)
-  {
-    rch->cb (rch->cb_cls,
-             &rs);
-    rch->cb = NULL;
-  }
-  DONAU_reserves_close_cancel (rch);
-}
-
-
-struct DONAU_ReservesCloseHandle *
-DONAU_reserves_close (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  const struct TALER_ReservePrivateKeyP *reserve_priv,
-  const char *target_payto_uri,
-  DONAU_ReservesCloseCallback cb,
-  void *cb_cls)
-{
-  struct DONAU_ReservesCloseHandle *rch;
-  CURL *eh;
-  char arg_str[sizeof (struct TALER_ReservePublicKeyP) * 2 + 32];
-  struct TALER_PaytoHashP h_payto;
-
-  rch = GNUNET_new (struct DONAU_ReservesCloseHandle);
-  rch->cb = cb;
-  rch->cb_cls = cb_cls;
-  rch->ts = GNUNET_TIME_timestamp_get ();
-  GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
-                                      &rch->reserve_pub.eddsa_pub);
-  {
-    char pub_str[sizeof (struct TALER_ReservePublicKeyP) * 2];
-    char *end;
-
-    end = GNUNET_STRINGS_data_to_string (
-      &rch->reserve_pub,
-      sizeof (rch->reserve_pub),
-      pub_str,
-      sizeof (pub_str));
-    *end = '\0';
-    GNUNET_snprintf (arg_str,
-                     sizeof (arg_str),
-                     "reserves/%s/close",
-                     pub_str);
-  }
-  rch->url = TALER_url_join (url,
-                             arg_str,
-                             NULL);
-  if (NULL == rch->url)
-  {
-    GNUNET_free (rch);
-    return NULL;
-  }
-  eh = DONAU_curl_easy_get_ (rch->url);
-  if (NULL == eh)
-  {
-    GNUNET_break (0);
-    GNUNET_free (rch->url);
-    GNUNET_free (rch);
-    return NULL;
-  }
-  if (NULL != target_payto_uri)
-    TALER_payto_hash (target_payto_uri,
-                      &h_payto);
-  TALER_wallet_reserve_close_sign (rch->ts,
-                                   (NULL != target_payto_uri)
-                                   ? &h_payto
-                                   : NULL,
-                                   reserve_priv,
-                                   &rch->reserve_sig);
-  {
-    json_t *close_obj = GNUNET_JSON_PACK (
-      GNUNET_JSON_pack_allow_null (
-        GNUNET_JSON_pack_string ("payto_uri",
-                                 target_payto_uri)),
-      GNUNET_JSON_pack_timestamp ("request_timestamp",
-                                  rch->ts),
-      GNUNET_JSON_pack_data_auto ("reserve_sig",
-                                  &rch->reserve_sig));
-
-    if (GNUNET_OK !=
-        TALER_curl_easy_post (&rch->post_ctx,
-                              eh,
-                              close_obj))
-    {
-      GNUNET_break (0);
-      curl_easy_cleanup (eh);
-      json_decref (close_obj);
-      GNUNET_free (rch->url);
-      GNUNET_free (rch);
-      return NULL;
-    }
-    json_decref (close_obj);
-  }
-  rch->job = GNUNET_CURL_job_add2 (ctx,
-                                   eh,
-                                   rch->post_ctx.headers,
-                                   &handle_reserves_close_finished,
-                                   rch);
-  return rch;
-}
-
-
-void
-DONAU_reserves_close_cancel (
-  struct DONAU_ReservesCloseHandle *rch)
-{
-  if (NULL != rch->job)
-  {
-    GNUNET_CURL_job_cancel (rch->job);
-    rch->job = NULL;
-  }
-  TALER_curl_easy_post_finished (&rch->post_ctx);
-  GNUNET_free (rch->url);
-  GNUNET_free (rch);
-}
-
-
 /* end of donau_api_reserves_close.c */
diff --git a/src/lib/donau_api_charities_open.c 
b/src/lib/donau_api_charities_open.c
index e6261fc..8ea830f 100644
--- a/src/lib/donau_api_charities_open.c
+++ b/src/lib/donau_api_charities_open.c
@@ -58,533 +58,4 @@ struct CoinData
   struct TALER_Amount contribution;
 };
 
-
-/**
- * @brief A /reserves/$RID/open Handle
- */
-// struct DONAU_ReservesOpenHandle
-// {
-
-//   /**
-//    * The keys of the donau this request handle will use
-//    */
-//   struct DONAU_Keys *keys;
-
-//   /**
-//    * The url for this request.
-//    */
-//   char *url;
-
-//   /**
-//    * Handle for the request.
-//    */
-//   struct GNUNET_CURL_Job *job;
-
-//   /**
-//    * Context for #DH_curl_easy_post(). Keeps the data that must
-//    * persist for Curl to make the upload.
-//    */
-//   struct TALER_CURL_PostContext post_ctx;
-
-//   /**
-//    * Function to call with the result.
-//    */
-//   DONAU_ReservesOpenCallback cb;
-
-//   /**
-//    * Closure for @a cb.
-//    */
-//   void *cb_cls;
-
-//   /**
-//    * Information we keep per coin to validate the reply.
-//    */
-//   struct CoinData *coins;
-
-//   /**
-//    * Length of the @e coins array.
-//    */
-//   unsigned int num_coins;
-
-//   /**
-//    * Public key of the reserve we are querying.
-//    */
-//   struct TALER_ReservePublicKeyP reserve_pub;
-
-//   /**
-//    * Our signature.
-//    */
-//   struct TALER_ReserveSignatureP reserve_sig;
-
-//   /**
-//    * When did we make the request.
-//    */
-//   struct GNUNET_TIME_Timestamp ts;
-
-// };
-
-
-/**
- * We received an #MHD_HTTP_OK open code. Handle the JSON
- * response.
- *
- * @param roh handle of the request
- * @param j JSON response
- * @return #GNUNET_OK on success
- */
-// static enum GNUNET_GenericReturnValue
-// handle_reserves_open_ok (struct DONAU_ReservesOpenHandle *roh,
-//                          const json_t *j)
-// {
-//   struct DONAU_ReserveOpenResult rs = {
-//     .hr.reply = j,
-//     .hr.http_status = MHD_HTTP_OK,
-//   };
-//   struct GNUNET_JSON_Specification spec[] = {
-//     TALER_JSON_spec_amount_any ("open_cost",
-//                                 &rs.details.ok.open_cost),
-//     GNUNET_JSON_spec_timestamp ("reserve_expiration",
-//                                 &rs.details.ok.expiration_time),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (j,
-//                          spec,
-//                          NULL,
-//                          NULL))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   roh->cb (roh->cb_cls,
-//            &rs);
-//   roh->cb = NULL;
-//   GNUNET_JSON_parse_free (spec);
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * We received an #MHD_HTTP_PAYMENT_REQUIRED open code. Handle the JSON
-//  * response.
-//  *
-//  * @param roh handle of the request
-//  * @param j JSON response
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// handle_reserves_open_pr (struct DONAU_ReservesOpenHandle *roh,
-//                          const json_t *j)
-// {
-//   struct DONAU_ReserveOpenResult rs = {
-//     .hr.reply = j,
-//     .hr.http_status = MHD_HTTP_PAYMENT_REQUIRED,
-//   };
-//   struct GNUNET_JSON_Specification spec[] = {
-//     TALER_JSON_spec_amount_any ("open_cost",
-//                                 &rs.details.payment_required.open_cost),
-//     GNUNET_JSON_spec_timestamp ("reserve_expiration",
-//                                 
&rs.details.payment_required.expiration_time),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (j,
-//                          spec,
-//                          NULL,
-//                          NULL))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   roh->cb (roh->cb_cls,
-//            &rs);
-//   roh->cb = NULL;
-//   GNUNET_JSON_parse_free (spec);
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * We received an #MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS open code. Handle 
the JSON
-//  * response.
-//  *
-//  * @param roh handle of the request
-//  * @param j JSON response
-//  * @return #GNUNET_OK on success
-//  */
-// static enum GNUNET_GenericReturnValue
-// handle_reserves_open_kyc (struct DONAU_ReservesOpenHandle *roh,
-//                           const json_t *j)
-// {
-//   struct DONAU_ReserveOpenResult rs = {
-//     .hr.reply = j,
-//     .hr.http_status = MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS,
-//   };
-//   struct GNUNET_JSON_Specification spec[] = {
-//     GNUNET_JSON_spec_fixed_auto (
-//       "h_payto",
-//       &rs.details.unavailable_for_legal_reasons.h_payto),
-//     GNUNET_JSON_spec_uint64 (
-//       "requirement_row",
-//       &rs.details.unavailable_for_legal_reasons.requirement_row),
-//     GNUNET_JSON_spec_end ()
-//   };
-
-//   if (GNUNET_OK !=
-//       GNUNET_JSON_parse (j,
-//                          spec,
-//                          NULL,
-//                          NULL))
-//   {
-//     GNUNET_break_op (0);
-//     return GNUNET_SYSERR;
-//   }
-//   roh->cb (roh->cb_cls,
-//            &rs);
-//   roh->cb = NULL;
-//   GNUNET_JSON_parse_free (spec);
-//   return GNUNET_OK;
-// }
-
-
-// /**
-//  * Function called when we're done processing the
-//  * HTTP /reserves/$RID/open request.
-//  *
-//  * @param cls the `struct DONAU_ReservesOpenHandle`
-//  * @param response_code HTTP response code, 0 on error
-//  * @param response parsed JSON result, NULL on error
-//  */
-// static void
-// handle_reserves_open_finished (void *cls,
-//                                long response_code,
-//                                const void *response)
-// {
-//   struct DONAU_ReservesOpenHandle *roh = cls;
-//   const json_t *j = response;
-//   struct DONAU_ReserveOpenResult rs = {
-//     .hr.reply = j,
-//     .hr.http_status = (unsigned int) response_code
-//   };
-
-//   roh->job = NULL;
-//   switch (response_code)
-//   {
-//   case 0:
-//     rs.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
-//     break;
-//   case MHD_HTTP_OK:
-//     if (GNUNET_OK !=
-//         handle_reserves_open_ok (roh,
-//                                  j))
-//     {
-//       GNUNET_break_op (0);
-//       rs.hr.http_status = 0;
-//       rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-//     }
-//     break;
-//   case MHD_HTTP_BAD_REQUEST:
-//     /* This should never happen, either us or the donau is buggy
-//        (or API version conflict); just pass JSON reply to the application */
-//     GNUNET_break (0);
-//     json_dumpf (j,
-//                 stderr,
-//                 JSON_INDENT (2));
-//     rs.hr.ec = TALER_JSON_get_error_code (j);
-//     rs.hr.hint = TALER_JSON_get_error_hint (j);
-//     break;
-//   case MHD_HTTP_PAYMENT_REQUIRED:
-//     if (GNUNET_OK !=
-//         handle_reserves_open_pr (roh,
-//                                  j))
-//     {
-//       GNUNET_break_op (0);
-//       rs.hr.http_status = 0;
-//       rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-//     }
-//     break;
-//   case MHD_HTTP_FORBIDDEN:
-//     /* This should never happen, either us or the donau is buggy
-//        (or API version conflict); just pass JSON reply to the application */
-//     GNUNET_break (0);
-//     rs.hr.ec = TALER_JSON_get_error_code (j);
-//     rs.hr.hint = TALER_JSON_get_error_hint (j);
-//     break;
-//   case MHD_HTTP_NOT_FOUND:
-//     /* Nothing really to verify, this should never
-//        happen, we should pass the JSON reply to the application */
-//     rs.hr.ec = TALER_JSON_get_error_code (j);
-//     rs.hr.hint = TALER_JSON_get_error_hint (j);
-//     break;
-//   case MHD_HTTP_CONFLICT:
-//     {
-//       const struct CoinData *cd = NULL;
-//       struct TALER_CoinSpendPublicKeyP coin_pub;
-//       const struct DONAU_DenomPublicKey *dk;
-//       struct GNUNET_JSON_Specification spec[] = {
-//         GNUNET_JSON_spec_fixed_auto ("coin_pub",
-//                                      &coin_pub),
-//         GNUNET_JSON_spec_end ()
-//       };
-
-//       if (GNUNET_OK !=
-//           GNUNET_JSON_parse (j,
-//                              spec,
-//                              NULL,
-//                              NULL))
-//       {
-//         GNUNET_break_op (0);
-//         rs.hr.http_status = 0;
-//         rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-//         break;
-//       }
-//       for (unsigned int i = 0; i<roh->num_coins; i++)
-//       {
-//         const struct CoinData *cdi = &roh->coins[i];
-
-//         if (0 == GNUNET_memcmp (&coin_pub,
-//                                 &cdi->coin_pub))
-//         {
-//           cd = cdi;
-//           break;
-//         }
-//       }
-//       if (NULL == cd)
-//       {
-//         GNUNET_break_op (0);
-//         rs.hr.http_status = 0;
-//         rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-//         break;
-//       }
-//       dk = DONAU_get_denomination_key_by_hash (roh->keys,
-//                                                &cd->h_denom_pub);
-//       if (NULL == dk)
-//       {
-//         GNUNET_break_op (0);
-//         rs.hr.http_status = 0;
-//         rs.hr.ec = TALER_EC_GENERIC_CLIENT_INTERNAL_ERROR;
-//         break;
-//       }
-//       if (GNUNET_OK !=
-//           DONAU_check_coin_conflict_ (roh->keys,
-//                                       j,
-//                                       dk,
-//                                       &coin_pub,
-//                                       &cd->coin_sig,
-//                                       &cd->contribution))
-//       {
-//         GNUNET_break_op (0);
-//         rs.hr.http_status = 0;
-//         rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-//         break;
-//       }
-//       rs.hr.ec = TALER_JSON_get_error_code (j);
-//       rs.hr.hint = TALER_JSON_get_error_hint (j);
-//       break;
-//     }
-//   case MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS:
-//     if (GNUNET_OK !=
-//         handle_reserves_open_kyc (roh,
-//                                   j))
-//     {
-//       GNUNET_break_op (0);
-//       rs.hr.http_status = 0;
-//       rs.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-//     }
-//     break;
-//   case MHD_HTTP_INTERNAL_SERVER_ERROR:
-//     /* Server had an internal issue; we should retry, but this API
-//        leaves this to the application */
-//     rs.hr.ec = TALER_JSON_get_error_code (j);
-//     rs.hr.hint = TALER_JSON_get_error_hint (j);
-//     break;
-//   default:
-//     /* unexpected response code */
-//     GNUNET_break_op (0);
-//     rs.hr.ec = TALER_JSON_get_error_code (j);
-//     rs.hr.hint = TALER_JSON_get_error_hint (j);
-//     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-//                 "Unexpected response code %u/%d for reserves open\n",
-//                 (unsigned int) response_code,
-//                 (int) rs.hr.ec);
-//     break;
-//   }
-//   if (NULL != roh->cb)
-//   {
-//     roh->cb (roh->cb_cls,
-//              &rs);
-//     roh->cb = NULL;
-//   }
-//   DONAU_reserves_open_cancel (roh);
-// }
-
-
-// struct DONAU_ReservesOpenHandle *
-// DONAU_reserves_open (
-//   struct GNUNET_CURL_Context *ctx,
-//   const char *url,
-//   struct DONAU_Keys *keys,
-//   const struct TALER_ReservePrivateKeyP *reserve_priv,
-//   const struct TALER_Amount *reserve_contribution,
-//   unsigned int coin_payments_length,
-//   const struct DONAU_PurseDeposit coin_payments[
-//     static coin_payments_length],
-//   struct GNUNET_TIME_Timestamp expiration_time,
-//   uint32_t min_purses,
-//   DONAU_ReservesOpenCallback cb,
-//   void *cb_cls)
-// {
-//   struct DONAU_ReservesOpenHandle *roh;
-//   CURL *eh;
-//   char arg_str[sizeof (struct TALER_ReservePublicKeyP) * 2 + 32];
-//   json_t *cpa;
-
-//   roh = GNUNET_new (struct DONAU_ReservesOpenHandle);
-//   roh->cb = cb;
-//   roh->cb_cls = cb_cls;
-//   roh->ts = GNUNET_TIME_timestamp_get ();
-//   GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
-//                                       &roh->reserve_pub.eddsa_pub);
-//   {
-//     char pub_str[sizeof (struct TALER_ReservePublicKeyP) * 2];
-//     char *end;
-
-//     end = GNUNET_STRINGS_data_to_string (
-//       &roh->reserve_pub,
-//       sizeof (roh->reserve_pub),
-//       pub_str,
-//       sizeof (pub_str));
-//     *end = '\0';
-//     GNUNET_snprintf (arg_str,
-//                      sizeof (arg_str),
-//                      "reserves/%s/open",
-//                      pub_str);
-//   }
-//   roh->url = TALER_url_join (url,
-//                              arg_str,
-//                              NULL);
-//   if (NULL == roh->url)
-//   {
-//     GNUNET_free (roh);
-//     return NULL;
-//   }
-//   eh = DONAU_curl_easy_get_ (roh->url);
-//   if (NULL == eh)
-//   {
-//     GNUNET_break (0);
-//     GNUNET_free (roh->url);
-//     GNUNET_free (roh);
-//     return NULL;
-//   }
-//   TALER_wallet_reserve_open_sign (reserve_contribution,
-//                                   roh->ts,
-//                                   expiration_time,
-//                                   min_purses,
-//                                   reserve_priv,
-//                                   &roh->reserve_sig);
-//   roh->coins = GNUNET_new_array (coin_payments_length,
-//                                  struct CoinData);
-//   cpa = json_array ();
-//   GNUNET_assert (NULL != cpa);
-//   for (unsigned int i = 0; i<coin_payments_length; i++)
-//   {
-//     const struct DONAU_PurseDeposit *pd = &coin_payments[i];
-//     const struct TALER_AgeCommitmentProof *acp = pd->age_commitment_proof;
-//     struct TALER_AgeCommitmentHash ahac;
-//     struct TALER_AgeCommitmentHash *achp = NULL;
-//     struct CoinData *cd = &roh->coins[i];
-//     json_t *cp;
-
-//     cd->contribution = pd->amount;
-//     cd->h_denom_pub = pd->h_denom_pub;
-//     if (NULL != acp)
-//     {
-//       TALER_age_commitment_hash (&acp->commitment,
-//                                  &ahac);
-//       achp = &ahac;
-//     }
-//     TALER_wallet_reserve_open_deposit_sign (&pd->amount,
-//                                             &roh->reserve_sig,
-//                                             &pd->coin_priv,
-//                                             &cd->coin_sig);
-//     GNUNET_CRYPTO_eddsa_key_get_public (&pd->coin_priv.eddsa_priv,
-//                                         &cd->coin_pub.eddsa_pub);
-
-//     cp = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_allow_null (
-//         GNUNET_JSON_pack_data_auto ("h_age_commitment",
-//                                     achp)),
-//       TALER_JSON_pack_amount ("amount",
-//                               &pd->amount),
-//       GNUNET_JSON_pack_data_auto ("denom_pub_hash",
-//                                   &pd->h_denom_pub),
-//       TALER_JSON_pack_denom_sig ("ub_sig",
-//                                  &pd->denom_sig),
-//       GNUNET_JSON_pack_data_auto ("coin_pub",
-//                                   &cd->coin_pub),
-//       GNUNET_JSON_pack_data_auto ("coin_sig",
-//                                   &cd->coin_sig));
-//     GNUNET_assert (0 ==
-//                    json_array_append_new (cpa,
-//                                           cp));
-//   }
-//   {
-//     json_t *open_obj = GNUNET_JSON_PACK (
-//       GNUNET_JSON_pack_timestamp ("request_timestamp",
-//                                   roh->ts),
-//       GNUNET_JSON_pack_timestamp ("reserve_expiration",
-//                                   expiration_time),
-//       GNUNET_JSON_pack_array_steal ("payments",
-//                                     cpa),
-//       TALER_JSON_pack_amount ("reserve_payment",
-//                               reserve_contribution),
-//       GNUNET_JSON_pack_uint64 ("purse_limit",
-//                                min_purses),
-//       GNUNET_JSON_pack_data_auto ("reserve_sig",
-//                                   &roh->reserve_sig));
-
-//     if (GNUNET_OK !=
-//         TALER_curl_easy_post (&roh->post_ctx,
-//                               eh,
-//                               open_obj))
-//     {
-//       GNUNET_break (0);
-//       curl_easy_cleanup (eh);
-//       json_decref (open_obj);
-//       GNUNET_free (roh->coins);
-//       GNUNET_free (roh->url);
-//       GNUNET_free (roh);
-//       return NULL;
-//     }
-//     json_decref (open_obj);
-//   }
-//   roh->keys = DONAU_keys_incref (keys);
-//   roh->job = GNUNET_CURL_job_add2 (ctx,
-//                                    eh,
-//                                    roh->post_ctx.headers,
-//                                    &handle_reserves_open_finished,
-//                                    roh);
-//   return roh;
-// }
-
-
-// void
-// DONAU_reserves_open_cancel (
-//   struct DONAU_ReservesOpenHandle *roh)
-// {
-//   if (NULL != roh->job)
-//   {
-//     GNUNET_CURL_job_cancel (roh->job);
-//     roh->job = NULL;
-//   }
-//   TALER_curl_easy_post_finished (&roh->post_ctx);
-//   GNUNET_free (roh->coins);
-//   GNUNET_free (roh->url);
-//   DONAU_keys_decref (roh->keys);
-//   GNUNET_free (roh);
-// }
-
-
 /* end of donau_api_reserves_open.c */
diff --git a/src/lib/donau_api_common.c b/src/lib/donau_api_common.c
index 7f4c4af..474405b 100644
--- a/src/lib/donau_api_common.c
+++ b/src/lib/donau_api_common.c
@@ -80,2369 +80,4 @@ typedef enum GNUNET_GenericReturnValue
                const json_t *transaction);
 
 
-/**
- * Parse "credit" reserve history entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_credit (struct DONAU_ReserveHistoryEntry *rh,
-              struct HistoryParseContext *uc,
-              const json_t *transaction)
-{
-  const char *wire_url;
-  uint64_t wire_reference;
-  struct GNUNET_TIME_Timestamp timestamp;
-  struct GNUNET_JSON_Specification withdraw_spec[] = {
-    GNUNET_JSON_spec_uint64 ("wire_reference",
-                             &wire_reference),
-    GNUNET_JSON_spec_timestamp ("timestamp",
-                                &timestamp),
-    GNUNET_JSON_spec_string ("sender_account_url",
-                             &wire_url),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_CREDIT;
-  if (0 >
-      TALER_amount_add (uc->total_in,
-                        uc->total_in,
-                        &rh->amount))
-  {
-    /* overflow in history already!? inconceivable! Bad donau! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         withdraw_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  rh->details.in_details.sender_url = GNUNET_strdup (wire_url);
-  rh->details.in_details.wire_reference = wire_reference;
-  rh->details.in_details.timestamp = timestamp;
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse "credit" reserve history entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_withdraw (struct DONAU_ReserveHistoryEntry *rh,
-                struct HistoryParseContext *uc,
-                const json_t *transaction)
-{
-  struct TALER_ReserveSignatureP sig;
-  struct TALER_DenominationHashP h_denom_pub;
-  struct TALER_BlindedCoinHashP bch;
-  struct TALER_Amount withdraw_fee;
-  struct GNUNET_JSON_Specification withdraw_spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("reserve_sig",
-                                 &sig),
-    TALER_JSON_spec_amount_any ("withdraw_fee",
-                                &withdraw_fee),
-    GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-                                 &h_denom_pub),
-    GNUNET_JSON_spec_fixed_auto ("h_coin_envelope",
-                                 &bch),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_WITHDRAWAL;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         withdraw_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-
-  /* Check that the signature is a valid withdraw request */
-  if (GNUNET_OK !=
-      TALER_wallet_withdraw_verify (&h_denom_pub,
-                                    &rh->amount,
-                                    &bch,
-                                    uc->reserve_pub,
-                                    &sig))
-  {
-    GNUNET_break_op (0);
-    GNUNET_JSON_parse_free (withdraw_spec);
-    return GNUNET_SYSERR;
-  }
-  /* check that withdraw fee matches expectations! */
-  {
-    const struct DONAU_Keys *key_state;
-    const struct DONAU_DenomPublicKey *dki;
-
-    key_state = uc->keys;
-    dki = DONAU_get_denomination_key_by_hash (key_state,
-                                              &h_denom_pub);
-    if ( (GNUNET_YES !=
-          TALER_amount_cmp_currency (&withdraw_fee,
-                                     &dki->fees.withdraw)) ||
-         (0 !=
-          TALER_amount_cmp (&withdraw_fee,
-                            &dki->fees.withdraw)) )
-    {
-      GNUNET_break_op (0);
-      GNUNET_JSON_parse_free (withdraw_spec);
-      return GNUNET_SYSERR;
-    }
-    rh->details.withdraw.fee = withdraw_fee;
-  }
-  rh->details.withdraw.out_authorization_sig
-    = json_object_get (transaction,
-                       "signature");
-  /* Check check that the same withdraw transaction
-       isn't listed twice by the donau. We use the
-       "uuid" array to remember the hashes of all
-       signatures, and compare the hashes to find
-       duplicates. */
-  GNUNET_CRYPTO_hash (&sig,
-                      sizeof (sig),
-                      &uc->uuids[uc->uuid_off]);
-  for (unsigned int i = 0; i<uc->uuid_off; i++)
-  {
-    if (0 == GNUNET_memcmp (&uc->uuids[uc->uuid_off],
-                            &uc->uuids[i]))
-    {
-      GNUNET_break_op (0);
-      GNUNET_JSON_parse_free (withdraw_spec);
-      return GNUNET_SYSERR;
-    }
-  }
-  uc->uuid_off++;
-
-  if (0 >
-      TALER_amount_add (uc->total_out,
-                        uc->total_out,
-                        &rh->amount))
-  {
-    /* overflow in history already!? inconceivable! Bad donau! */
-    GNUNET_break_op (0);
-    GNUNET_JSON_parse_free (withdraw_spec);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse "recoup" reserve history entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_recoup (struct DONAU_ReserveHistoryEntry *rh,
-              struct HistoryParseContext *uc,
-              const json_t *transaction)
-{
-  const struct DONAU_Keys *key_state;
-  struct GNUNET_JSON_Specification recoup_spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("coin_pub",
-                                 &rh->details.recoup_details.coin_pub),
-    GNUNET_JSON_spec_fixed_auto ("donau_sig",
-                                 &rh->details.recoup_details.donau_sig),
-    GNUNET_JSON_spec_fixed_auto ("donau_pub",
-                                 &rh->details.recoup_details.donau_pub),
-    GNUNET_JSON_spec_timestamp ("timestamp",
-                                &rh->details.recoup_details.timestamp),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_RECOUP;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         recoup_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  key_state = uc->keys;
-  if (GNUNET_OK !=
-      DONAU_test_signing_key (key_state,
-                              &rh->details.
-                              recoup_details.donau_pub))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_donau_online_confirm_recoup_verify (
-        rh->details.recoup_details.timestamp,
-        &rh->amount,
-        &rh->details.recoup_details.coin_pub,
-        uc->reserve_pub,
-        &rh->details.recoup_details.donau_pub,
-        &rh->details.recoup_details.donau_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 >
-      TALER_amount_add (uc->total_in,
-                        uc->total_in,
-                        &rh->amount))
-  {
-    /* overflow in history already!? inconceivable! Bad donau! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse "closing" reserve history entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_closing (struct DONAU_ReserveHistoryEntry *rh,
-               struct HistoryParseContext *uc,
-               const json_t *transaction)
-{
-  const struct DONAU_Keys *key_state;
-  struct GNUNET_JSON_Specification closing_spec[] = {
-    GNUNET_JSON_spec_string (
-      "receiver_account_details",
-      &rh->details.close_details.receiver_account_details),
-    GNUNET_JSON_spec_fixed_auto ("wtid",
-                                 &rh->details.close_details.wtid),
-    GNUNET_JSON_spec_fixed_auto ("donau_sig",
-                                 &rh->details.close_details.donau_sig),
-    GNUNET_JSON_spec_fixed_auto ("donau_pub",
-                                 &rh->details.close_details.donau_pub),
-    TALER_JSON_spec_amount_any ("closing_fee",
-                                &rh->details.close_details.fee),
-    GNUNET_JSON_spec_timestamp ("timestamp",
-                                &rh->details.close_details.timestamp),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_CLOSING;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         closing_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  key_state = uc->keys;
-  if (GNUNET_OK !=
-      DONAU_test_signing_key (
-        key_state,
-        &rh->details.close_details.donau_pub))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_donau_online_reserve_closed_verify (
-        rh->details.close_details.timestamp,
-        &rh->amount,
-        &rh->details.close_details.fee,
-        rh->details.close_details.receiver_account_details,
-        &rh->details.close_details.wtid,
-        uc->reserve_pub,
-        &rh->details.close_details.donau_pub,
-        &rh->details.close_details.donau_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 >
-      TALER_amount_add (uc->total_out,
-                        uc->total_out,
-                        &rh->amount))
-  {
-    /* overflow in history already!? inconceivable! Bad donau! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse "merge" reserve history entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_merge (struct DONAU_ReserveHistoryEntry *rh,
-             struct HistoryParseContext *uc,
-             const json_t *transaction)
-{
-  uint32_t flags32;
-  struct GNUNET_JSON_Specification merge_spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
-                                 &rh->details.merge_details.h_contract_terms),
-    GNUNET_JSON_spec_fixed_auto ("merge_pub",
-                                 &rh->details.merge_details.merge_pub),
-    GNUNET_JSON_spec_fixed_auto ("purse_pub",
-                                 &rh->details.merge_details.purse_pub),
-    GNUNET_JSON_spec_uint32 ("min_age",
-                             &rh->details.merge_details.min_age),
-    GNUNET_JSON_spec_uint32 ("flags",
-                             &flags32),
-    GNUNET_JSON_spec_fixed_auto ("reserve_sig",
-                                 &rh->details.merge_details.reserve_sig),
-    TALER_JSON_spec_amount_any ("purse_fee",
-                                &rh->details.merge_details.purse_fee),
-    GNUNET_JSON_spec_timestamp ("merge_timestamp",
-                                &rh->details.merge_details.merge_timestamp),
-    GNUNET_JSON_spec_timestamp ("purse_expiration",
-                                &rh->details.merge_details.purse_expiration),
-    GNUNET_JSON_spec_bool ("merged",
-                           &rh->details.merge_details.merged),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_MERGE;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         merge_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  rh->details.merge_details.flags =
-    (enum TALER_WalletAccountMergeFlags) flags32;
-  if (GNUNET_OK !=
-      TALER_wallet_account_merge_verify (
-        rh->details.merge_details.merge_timestamp,
-        &rh->details.merge_details.purse_pub,
-        rh->details.merge_details.purse_expiration,
-        &rh->details.merge_details.h_contract_terms,
-        &rh->amount,
-        &rh->details.merge_details.purse_fee,
-        rh->details.merge_details.min_age,
-        rh->details.merge_details.flags,
-        uc->reserve_pub,
-        &rh->details.merge_details.reserve_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (rh->details.merge_details.merged)
-  {
-    if (0 >
-        TALER_amount_add (uc->total_in,
-                          uc->total_in,
-                          &rh->amount))
-    {
-      /* overflow in history already!? inconceivable! Bad donau! */
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-  }
-  else
-  {
-    if (0 >
-        TALER_amount_add (uc->total_out,
-                          uc->total_out,
-                          &rh->details.merge_details.purse_fee))
-    {
-      /* overflow in history already!? inconceivable! Bad donau! */
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse "history" reserve history entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_history (struct DONAU_ReserveHistoryEntry *rh,
-               struct HistoryParseContext *uc,
-               const json_t *transaction)
-{
-  struct GNUNET_JSON_Specification history_spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("reserve_sig",
-                                 &rh->details.history_details.reserve_sig),
-    GNUNET_JSON_spec_timestamp ("request_timestamp",
-                                
&rh->details.history_details.request_timestamp),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_HISTORY;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         history_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_reserve_history_verify (
-        rh->details.history_details.request_timestamp,
-        &rh->amount,
-        uc->reserve_pub,
-        &rh->details.history_details.reserve_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 >
-      TALER_amount_add (uc->total_out,
-                        uc->total_out,
-                        &rh->amount))
-  {
-    /* overflow in history already!? inconceivable! Bad donau! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse "open" reserve open entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_open (struct DONAU_ReserveHistoryEntry *rh,
-            struct HistoryParseContext *uc,
-            const json_t *transaction)
-{
-  struct GNUNET_JSON_Specification open_spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("reserve_sig",
-                                 &rh->details.open_request.reserve_sig),
-    TALER_JSON_spec_amount_any ("open_payment",
-                                &rh->details.open_request.reserve_payment),
-    GNUNET_JSON_spec_uint32 ("requested_min_purses",
-                             &rh->details.open_request.purse_limit),
-    GNUNET_JSON_spec_timestamp ("request_timestamp",
-                                &rh->details.open_request.request_timestamp),
-    GNUNET_JSON_spec_timestamp ("requested_expiration",
-                                &rh->details.open_request.reserve_expiration),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_OPEN;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         open_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_reserve_open_verify (
-        &rh->amount,
-        rh->details.open_request.request_timestamp,
-        rh->details.open_request.reserve_expiration,
-        rh->details.open_request.purse_limit,
-        uc->reserve_pub,
-        &rh->details.open_request.reserve_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 >
-      TALER_amount_add (uc->total_out,
-                        uc->total_out,
-                        &rh->amount))
-  {
-    /* overflow in history already!? inconceivable! Bad donau! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse "close" reserve close entry.
- *
- * @param[in,out] rh entry to parse
- * @param uc our context
- * @param transaction the transaction to parse
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_close (struct DONAU_ReserveHistoryEntry *rh,
-             struct HistoryParseContext *uc,
-             const json_t *transaction)
-{
-  struct GNUNET_JSON_Specification close_spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("reserve_sig",
-                                 &rh->details.close_request.reserve_sig),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_fixed_auto ("h_payto",
-                                   &rh->details.close_request.
-                                   target_account_h_payto),
-      NULL),
-    GNUNET_JSON_spec_timestamp ("request_timestamp",
-                                &rh->details.close_request.request_timestamp),
-    GNUNET_JSON_spec_end ()
-  };
-
-  rh->type = DONAU_RTT_CLOSE;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         close_spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  /* force amount to invalid */
-  memset (&rh->amount,
-          0,
-          sizeof (rh->amount));
-  if (GNUNET_OK !=
-      TALER_wallet_reserve_close_verify (
-        rh->details.close_request.request_timestamp,
-        &rh->details.close_request.target_account_h_payto,
-        uc->reserve_pub,
-        &rh->details.close_request.reserve_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_parse_reserve_history (
-  const struct DONAU_Keys *keys,
-  const json_t *history,
-  const struct TALER_ReservePublicKeyP *reserve_pub,
-  const char *currency,
-  struct TALER_Amount *total_in,
-  struct TALER_Amount *total_out,
-  unsigned int history_length,
-  struct DONAU_ReserveHistoryEntry rhistory[static history_length])
-{
-  const struct
-  {
-    const char *type;
-    ParseHelper helper;
-  } map[] = {
-    { "CREDIT", &parse_credit },
-    { "WITHDRAW", &parse_withdraw },
-    { "RECOUP", &parse_recoup },
-    { "MERGE", &parse_merge },
-    { "CLOSING", &parse_closing },
-    { "HISTORY", &parse_history },
-    { "OPEN", &parse_open },
-    { "CLOSE", &parse_close },
-    { NULL, NULL }
-  };
-  struct GNUNET_HashCode uuid[history_length];
-  struct HistoryParseContext uc = {
-    .keys = keys,
-    .reserve_pub = reserve_pub,
-    .uuids = uuid,
-    .total_in = total_in,
-    .total_out = total_out
-  };
-
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_amount_set_zero (currency,
-                                        total_in));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_amount_set_zero (currency,
-                                        total_out));
-  for (unsigned int off = 0; off<history_length; off++)
-  {
-    struct DONAU_ReserveHistoryEntry *rh = &rhistory[off];
-    json_t *transaction;
-    struct TALER_Amount amount;
-    const char *type;
-    struct GNUNET_JSON_Specification hist_spec[] = {
-      GNUNET_JSON_spec_string ("type",
-                               &type),
-      TALER_JSON_spec_amount_any ("amount",
-                                  &amount),
-      /* 'wire' and 'signature' are optional depending on 'type'! */
-      GNUNET_JSON_spec_end ()
-    };
-    bool found = false;
-
-    transaction = json_array_get (history,
-                                  off);
-    if (GNUNET_OK !=
-        GNUNET_JSON_parse (transaction,
-                           hist_spec,
-                           NULL, NULL))
-    {
-      GNUNET_break_op (0);
-      json_dumpf (transaction,
-                  stderr,
-                  JSON_INDENT (2));
-      return GNUNET_SYSERR;
-    }
-    rh->amount = amount;
-    if (GNUNET_YES !=
-        TALER_amount_cmp_currency (&amount,
-                                   total_in))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    for (unsigned int i = 0; NULL != map[i].type; i++)
-    {
-      if (0 == strcasecmp (map[i].type,
-                           type))
-      {
-        found = true;
-        if (GNUNET_OK !=
-            map[i].helper (rh,
-                           &uc,
-                           transaction))
-        {
-          GNUNET_break_op (0);
-          return GNUNET_SYSERR;
-        }
-        break;
-      }
-    }
-    if (! found)
-    {
-      /* unexpected 'type', protocol incompatibility, complain! */
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-  }
-  return GNUNET_OK;
-}
-
-
-void
-DONAU_free_reserve_history (
-  unsigned int len,
-  struct DONAU_ReserveHistoryEntry rhistory[static len])
-{
-  for (unsigned int i = 0; i<len; i++)
-  {
-    switch (rhistory[i].type)
-    {
-    case DONAU_RTT_CREDIT:
-      GNUNET_free (rhistory[i].details.in_details.sender_url);
-      break;
-    case DONAU_RTT_WITHDRAWAL:
-      break;
-    case DONAU_RTT_AGEWITHDRAWAL:
-      break;
-    case DONAU_RTT_RECOUP:
-      break;
-    case DONAU_RTT_CLOSING:
-      break;
-    case DONAU_RTT_HISTORY:
-      break;
-    case DONAU_RTT_MERGE:
-      break;
-    case DONAU_RTT_OPEN:
-      break;
-    case DONAU_RTT_CLOSE:
-      break;
-    }
-  }
-  GNUNET_free (rhistory);
-}
-
-
-/**
- * Context for coin helpers.
- */
-struct CoinHistoryParseContext
-{
-
-  /**
-   * Denomination of the coin.
-   */
-  const struct DONAU_DenomPublicKey *dk;
-
-  /**
-   * Our coin public key.
-   */
-  const struct TALER_CoinSpendPublicKeyP *coin_pub;
-
-  /**
-   * Where to sum up total refunds.
-   */
-  struct TALER_Amount rtotal;
-
-  /**
-   * Total amount encountered.
-   */
-  struct TALER_Amount *total;
-
-};
-
-
-/**
- * Signature of functions that operate on one of
- * the coin's history entries.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-typedef enum GNUNET_GenericReturnValue
-(*CoinCheckHelper)(struct CoinHistoryParseContext *pc,
-                   const struct TALER_Amount *amount,
-                   json_t *transaction);
-
-
-/**
- * Handle deposit entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_deposit (struct CoinHistoryParseContext *pc,
-              const struct TALER_Amount *amount,
-              json_t *transaction)
-{
-  struct TALER_CharityWireHashP h_wire;
-  struct TALER_PrivateContractHashP h_contract_terms;
-  struct TALER_ExtensionPolicyHashP h_policy;
-  bool no_h_policy;
-  struct GNUNET_HashCode wallet_data_hash;
-  bool no_wallet_data_hash;
-  struct GNUNET_TIME_Timestamp wallet_timestamp;
-  struct DONAU_CharityPublicKeyP charity_pub;
-  struct GNUNET_TIME_Timestamp refund_deadline = {0};
-  struct TALER_CoinSpendSignatureP sig;
-  struct TALER_AgeCommitmentHash hac;
-  bool no_hac;
-  struct TALER_Amount deposit_fee;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                 &sig),
-    GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
-                                 &h_contract_terms),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_fixed_auto ("wallet_data_hash",
-                                   &wallet_data_hash),
-      &no_wallet_data_hash),
-    GNUNET_JSON_spec_fixed_auto ("h_wire",
-                                 &h_wire),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
-                                   &hac),
-      &no_hac),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_fixed_auto ("h_policy",
-                                   &h_policy),
-      &no_h_policy),
-    GNUNET_JSON_spec_timestamp ("timestamp",
-                                &wallet_timestamp),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_timestamp ("refund_deadline",
-                                  &refund_deadline),
-      NULL),
-    TALER_JSON_spec_amount_any ("deposit_fee",
-                                &deposit_fee),
-    GNUNET_JSON_spec_fixed_auto ("charity_pub",
-                                 &charity_pub),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_deposit_verify (
-        amount,
-        &deposit_fee,
-        &h_wire,
-        &h_contract_terms,
-        no_wallet_data_hash ? NULL : &wallet_data_hash,
-        no_hac ? NULL : &hac,
-        no_h_policy ? NULL : &h_policy,
-        &pc->dk->h_key,
-        wallet_timestamp,
-        &charity_pub,
-        refund_deadline,
-        pc->coin_pub,
-        &sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  /* check that deposit fee matches our expectations from /keys! */
-  if ( (GNUNET_YES !=
-        TALER_amount_cmp_currency (&deposit_fee,
-                                   &pc->dk->fees.deposit)) ||
-       (0 !=
-        TALER_amount_cmp (&deposit_fee,
-                          &pc->dk->fees.deposit)) )
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_YES;
-}
-
-
-/**
- * Handle melt entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_melt (struct CoinHistoryParseContext *pc,
-           const struct TALER_Amount *amount,
-           json_t *transaction)
-{
-  struct TALER_CoinSpendSignatureP sig;
-  struct TALER_RefreshCommitmentP rc;
-  struct TALER_AgeCommitmentHash h_age_commitment;
-  bool no_hac;
-  struct TALER_Amount melt_fee;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                 &sig),
-    GNUNET_JSON_spec_fixed_auto ("rc",
-                                 &rc),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
-                                   &h_age_commitment),
-      &no_hac),
-    TALER_JSON_spec_amount_any ("melt_fee",
-                                &melt_fee),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-
-  /* check that melt fee matches our expectations from /keys! */
-  if ( (GNUNET_YES !=
-        TALER_amount_cmp_currency (&melt_fee,
-                                   &pc->dk->fees.refresh)) ||
-       (0 !=
-        TALER_amount_cmp (&melt_fee,
-                          &pc->dk->fees.refresh)) )
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_melt_verify (
-        amount,
-        &melt_fee,
-        &rc,
-        &pc->dk->h_key,
-        no_hac
-        ? NULL
-        : &h_age_commitment,
-        pc->coin_pub,
-        &sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_YES;
-}
-
-
-/**
- * Handle refund entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_refund (struct CoinHistoryParseContext *pc,
-             const struct TALER_Amount *amount,
-             json_t *transaction)
-{
-  struct TALER_PrivateContractHashP h_contract_terms;
-  struct DONAU_CharityPublicKeyP charity_pub;
-  struct DONAU_CharitySignatureP sig;
-  struct TALER_Amount refund_fee;
-  struct TALER_Amount sig_amount;
-  uint64_t rtransaction_id;
-  struct GNUNET_JSON_Specification spec[] = {
-    TALER_JSON_spec_amount_any ("refund_fee",
-                                &refund_fee),
-    GNUNET_JSON_spec_fixed_auto ("charity_sig",
-                                 &sig),
-    GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
-                                 &h_contract_terms),
-    GNUNET_JSON_spec_fixed_auto ("charity_pub",
-                                 &charity_pub),
-    GNUNET_JSON_spec_uint64 ("rtransaction_id",
-                             &rtransaction_id),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 >
-      TALER_amount_add (&sig_amount,
-                        &refund_fee,
-                        amount))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_charity_refund_verify (pc->coin_pub,
-                                   &h_contract_terms,
-                                   rtransaction_id,
-                                   &sig_amount,
-                                   &charity_pub,
-                                   &sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  /* NOTE: theoretically, we could also check that the given
-     charity_pub and h_contract_terms appear in the
-     history under deposits.  However, there is really no benefit
-     for the donau to lie here, so not checking is probably OK
-     (an auditor ought to check, though). Then again, we similarly
-     had no reason to check the charity's signature (other than a
-     well-formendess check). */
-
-  /* check that refund fee matches our expectations from /keys! */
-  if ( (GNUNET_YES !=
-        TALER_amount_cmp_currency (&refund_fee,
-                                   &pc->dk->fees.refund)) ||
-       (0 !=
-        TALER_amount_cmp (&refund_fee,
-                          &pc->dk->fees.refund)) )
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_NO;
-}
-
-
-/**
- * Handle recoup entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_recoup (struct CoinHistoryParseContext *pc,
-             const struct TALER_Amount *amount,
-             json_t *transaction)
-{
-  struct TALER_ReservePublicKeyP reserve_pub;
-  struct GNUNET_TIME_Timestamp timestamp;
-  union TALER_DenominationBlindingKeyP coin_bks;
-  struct DONAU_DonauPublicKeyP donau_pub;
-  struct TALER_DonauSignatureP donau_sig;
-  struct TALER_CoinSpendSignatureP coin_sig;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("donau_sig",
-                                 &donau_sig),
-    GNUNET_JSON_spec_fixed_auto ("donau_pub",
-                                 &donau_pub),
-    GNUNET_JSON_spec_fixed_auto ("reserve_pub",
-                                 &reserve_pub),
-    GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                 &coin_sig),
-    GNUNET_JSON_spec_fixed_auto ("coin_blind",
-                                 &coin_bks),
-    GNUNET_JSON_spec_timestamp ("timestamp",
-                                &timestamp),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_donau_online_confirm_recoup_verify (
-        timestamp,
-        amount,
-        pc->coin_pub,
-        &reserve_pub,
-        &donau_pub,
-        &donau_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_recoup_verify (&pc->dk->h_key,
-                                  &coin_bks,
-                                  pc->coin_pub,
-                                  &coin_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_YES;
-}
-
-
-/**
- * Handle recoup-refresh entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_recoup_refresh (struct CoinHistoryParseContext *pc,
-                     const struct TALER_Amount *amount,
-                     json_t *transaction)
-{
-  /* This is the coin that was subjected to a recoup,
-       the value being credited to the old coin. */
-  struct TALER_CoinSpendPublicKeyP old_coin_pub;
-  union TALER_DenominationBlindingKeyP coin_bks;
-  struct GNUNET_TIME_Timestamp timestamp;
-  struct DONAU_DonauPublicKeyP donau_pub;
-  struct TALER_DonauSignatureP donau_sig;
-  struct TALER_CoinSpendSignatureP coin_sig;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("donau_sig",
-                                 &donau_sig),
-    GNUNET_JSON_spec_fixed_auto ("donau_pub",
-                                 &donau_pub),
-    GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                 &coin_sig),
-    GNUNET_JSON_spec_fixed_auto ("old_coin_pub",
-                                 &old_coin_pub),
-    GNUNET_JSON_spec_fixed_auto ("coin_blind",
-                                 &coin_bks),
-    GNUNET_JSON_spec_timestamp ("timestamp",
-                                &timestamp),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_donau_online_confirm_recoup_refresh_verify (
-        timestamp,
-        amount,
-        pc->coin_pub,
-        &old_coin_pub,
-        &donau_pub,
-        &donau_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_recoup_verify (&pc->dk->h_key,
-                                  &coin_bks,
-                                  pc->coin_pub,
-                                  &coin_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_YES;
-}
-
-
-/**
- * Handle old coin recoup entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_old_coin_recoup (struct CoinHistoryParseContext *pc,
-                      const struct TALER_Amount *amount,
-                      json_t *transaction)
-{
-  /* This is the coin that was credited in a recoup,
-       the value being credited to the this coin. */
-  struct DONAU_DonauPublicKeyP donau_pub;
-  struct TALER_DonauSignatureP donau_sig;
-  struct TALER_CoinSpendPublicKeyP new_coin_pub;
-  struct GNUNET_TIME_Timestamp timestamp;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("donau_sig",
-                                 &donau_sig),
-    GNUNET_JSON_spec_fixed_auto ("donau_pub",
-                                 &donau_pub),
-    GNUNET_JSON_spec_fixed_auto ("coin_pub",
-                                 &new_coin_pub),
-    GNUNET_JSON_spec_timestamp ("timestamp",
-                                &timestamp),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_donau_online_confirm_recoup_refresh_verify (
-        timestamp,
-        amount,
-        &new_coin_pub,
-        pc->coin_pub,
-        &donau_pub,
-        &donau_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_NO;
-}
-
-
-/**
- * Handle purse deposit entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_purse_deposit (struct CoinHistoryParseContext *pc,
-                    const struct TALER_Amount *amount,
-                    json_t *transaction)
-{
-  struct TALER_PurseContractPublicKeyP purse_pub;
-  struct TALER_CoinSpendSignatureP coin_sig;
-  const char *donau_base_url;
-  bool refunded;
-  struct TALER_AgeCommitmentHash phac = { 0 };
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("purse_pub",
-                                 &purse_pub),
-    GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                 &coin_sig),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
-                                   &coin_sig),
-      NULL),
-    GNUNET_JSON_spec_string ("donau_base_url",
-                             &donau_base_url),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
-                                   &phac),
-      NULL),
-    GNUNET_JSON_spec_bool ("refunded",
-                           &refunded),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_purse_deposit_verify (
-        donau_base_url,
-        &purse_pub,
-        amount,
-        &pc->dk->h_key,
-        &phac,
-        pc->coin_pub,
-        &coin_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (refunded)
-  {
-    /* We wave the deposit fee. */
-    if (0 >
-        TALER_amount_add (&pc->rtotal,
-                          &pc->rtotal,
-                          &pc->dk->fees.deposit))
-    {
-      /* overflow in refund history? inconceivable! Bad donau! */
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-  }
-  return GNUNET_YES;
-}
-
-
-/**
- * Handle purse refund entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_purse_refund (struct CoinHistoryParseContext *pc,
-                   const struct TALER_Amount *amount,
-                   json_t *transaction)
-{
-  struct TALER_PurseContractPublicKeyP purse_pub;
-  struct TALER_Amount refund_fee;
-  struct DONAU_DonauPublicKeyP donau_pub;
-  struct TALER_DonauSignatureP donau_sig;
-  struct GNUNET_JSON_Specification spec[] = {
-    TALER_JSON_spec_amount_any ("refund_fee",
-                                &refund_fee),
-    GNUNET_JSON_spec_fixed_auto ("purse_pub",
-                                 &purse_pub),
-    GNUNET_JSON_spec_fixed_auto ("donau_sig",
-                                 &donau_sig),
-    GNUNET_JSON_spec_fixed_auto ("donau_pub",
-                                 &donau_pub),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_donau_online_purse_refund_verify (
-        amount,
-        &refund_fee,
-        pc->coin_pub,
-        &purse_pub,
-        &donau_pub,
-        &donau_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if ( (GNUNET_YES !=
-        TALER_amount_cmp_currency (&refund_fee,
-                                   &pc->dk->fees.refund)) ||
-       (0 !=
-        TALER_amount_cmp (&refund_fee,
-                          &pc->dk->fees.refund)) )
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_NO;
-}
-
-
-/**
- * Handle reserve deposit entry in the coin's history.
- *
- * @param[in,out] pc overall context
- * @param amount main amount of this operation
- * @param transaction JSON details for the operation
- * @return #GNUNET_SYSERR on error,
- *         #GNUNET_OK to add, #GNUNET_NO to subtract
- */
-static enum GNUNET_GenericReturnValue
-help_reserve_open_deposit (struct CoinHistoryParseContext *pc,
-                           const struct TALER_Amount *amount,
-                           json_t *transaction)
-{
-  struct TALER_ReserveSignatureP reserve_sig;
-  struct TALER_CoinSpendSignatureP coin_sig;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("reserve_sig",
-                                 &reserve_sig),
-    GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                 &coin_sig),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (transaction,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_reserve_open_deposit_verify (
-        amount,
-        &reserve_sig,
-        pc->coin_pub,
-        &coin_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_YES;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_verify_coin_history (
-  const struct DONAU_DenomPublicKey *dk,
-  const struct TALER_CoinSpendPublicKeyP *coin_pub,
-  const json_t *history,
-  struct TALER_Amount *total)
-{
-  const char *currency = dk->value.currency;
-  const struct
-  {
-    const char *type;
-    CoinCheckHelper helper;
-  } map[] = {
-    { "DEPOSIT", &help_deposit },
-    { "MELT", &help_melt },
-    { "REFUND", &help_refund },
-    { "RECOUP", &help_recoup },
-    { "RECOUP-REFRESH", &help_recoup_refresh },
-    { "OLD-COIN-RECOUP", &help_old_coin_recoup },
-    { "PURSE-DEPOSIT", &help_purse_deposit },
-    { "PURSE-REFUND", &help_purse_refund },
-    { "RESERVE-OPEN-DEPOSIT", &help_reserve_open_deposit },
-    { NULL, NULL }
-  };
-  struct CoinHistoryParseContext pc = {
-    .dk = dk,
-    .coin_pub = coin_pub,
-    .total = total
-  };
-  size_t len;
-
-  if (NULL == history)
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  len = json_array_size (history);
-  if (0 == len)
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_amount_set_zero (currency,
-                                        total));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_amount_set_zero (currency,
-                                        &pc.rtotal));
-  for (size_t off = 0; off<len; off++)
-  {
-    enum GNUNET_GenericReturnValue add;
-    json_t *transaction;
-    struct TALER_Amount amount;
-    const char *type;
-    struct GNUNET_JSON_Specification spec_glob[] = {
-      TALER_JSON_spec_amount_any ("amount",
-                                  &amount),
-      GNUNET_JSON_spec_string ("type",
-                               &type),
-      GNUNET_JSON_spec_end ()
-    };
-
-    transaction = json_array_get (history,
-                                  off);
-    if (GNUNET_OK !=
-        GNUNET_JSON_parse (transaction,
-                           spec_glob,
-                           NULL, NULL))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    if (GNUNET_YES !=
-        TALER_amount_cmp_currency (&amount,
-                                   &pc.rtotal))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                "Operation of type %s with amount %s\n",
-                type,
-                TALER_amount2s (&amount));
-    add = GNUNET_SYSERR;
-    for (unsigned int i = 0; NULL != map[i].type; i++)
-    {
-      if (0 == strcasecmp (type,
-                           map[i].type))
-      {
-        add = map[i].helper (&pc,
-                             &amount,
-                             transaction);
-        break;
-      }
-    }
-    switch (add)
-    {
-    case GNUNET_SYSERR:
-      /* entry type not supported, new version on server? */
-      GNUNET_break_op (0);
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Unexpected type `%s' in response\n",
-                  type);
-      return GNUNET_SYSERR;
-    case GNUNET_YES:
-      /* This amount should be added to the total */
-      if (0 >
-          TALER_amount_add (total,
-                            total,
-                            &amount))
-      {
-        /* overflow in history already!? inconceivable! Bad donau! */
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      break;
-    case GNUNET_NO:
-      /* This amount should be subtracted from the total.
-
-         However, for the implementation, we first *add* up all of
-         these negative amounts, as we might get refunds before
-         deposits from a semi-evil donau.  Then, at the end, we do
-         the subtraction by calculating "total = total - rtotal" */
-      if (0 >
-          TALER_amount_add (&pc.rtotal,
-                            &pc.rtotal,
-                            &amount))
-      {
-        /* overflow in refund history? inconceivable! Bad donau! */
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      break;
-    } /* end of switch(add) */
-  }
-  /* Finally, subtract 'rtotal' from total to handle the subtractions */
-  if (0 >
-      TALER_amount_subtract (total,
-                             total,
-                             &pc.rtotal))
-  {
-    /* underflow in history? inconceivable! Bad donau! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-const struct DONAU_SigningPublicKey *
-DONAU_get_signing_key_info (
-  const struct DONAU_Keys *keys,
-  const struct DONAU_DonauPublicKeyP *donau_pub)
-{
-  for (unsigned int i = 0; i<keys->num_sign_keys; i++)
-  {
-    const struct DONAU_SigningPublicKey *spk
-      = &keys->sign_keys[i];
-
-    if (0 == GNUNET_memcmp (donau_pub,
-                            &spk->key))
-      return spk;
-  }
-  return NULL;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_create_conflict_ (
-  const struct TALER_PurseContractSignatureP *cpurse_sig,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const json_t *proof)
-{
-  struct TALER_Amount amount;
-  uint32_t min_age;
-  struct GNUNET_TIME_Timestamp purse_expiration;
-  struct TALER_PurseContractSignatureP purse_sig;
-  struct TALER_PrivateContractHashP h_contract_terms;
-  struct TALER_PurseMergePublicKeyP merge_pub;
-  struct GNUNET_JSON_Specification spec[] = {
-    TALER_JSON_spec_amount_any ("amount",
-                                &amount),
-    GNUNET_JSON_spec_uint32 ("min_age",
-                             &min_age),
-    GNUNET_JSON_spec_timestamp ("purse_expiration",
-                                &purse_expiration),
-    GNUNET_JSON_spec_fixed_auto ("purse_sig",
-                                 &purse_sig),
-    GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
-                                 &h_contract_terms),
-    GNUNET_JSON_spec_fixed_auto ("merge_pub",
-                                 &merge_pub),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (proof,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_purse_create_verify (purse_expiration,
-                                        &h_contract_terms,
-                                        &merge_pub,
-                                        min_age,
-                                        &amount,
-                                        purse_pub,
-                                        &purse_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 ==
-      GNUNET_memcmp (&purse_sig,
-                     cpurse_sig))
-  {
-    /* Must be the SAME data, not a conflict! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_merge_conflict_ (
-  const struct TALER_PurseMergeSignatureP *cmerge_sig,
-  const struct TALER_PurseMergePublicKeyP *merge_pub,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const char *donau_url,
-  const json_t *proof)
-{
-  struct TALER_PurseMergeSignatureP merge_sig;
-  struct GNUNET_TIME_Timestamp merge_timestamp;
-  const char *partner_url = NULL;
-  struct TALER_ReservePublicKeyP reserve_pub;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_string ("partner_url",
-                               &partner_url),
-      NULL),
-    GNUNET_JSON_spec_timestamp ("merge_timestamp",
-                                &merge_timestamp),
-    GNUNET_JSON_spec_fixed_auto ("merge_sig",
-                                 &merge_sig),
-    GNUNET_JSON_spec_fixed_auto ("reserve_pub",
-                                 &reserve_pub),
-    GNUNET_JSON_spec_end ()
-  };
-  char *payto_uri;
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (proof,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (NULL == partner_url)
-    partner_url = donau_url;
-  payto_uri = TALER_reserve_make_payto (partner_url,
-                                        &reserve_pub);
-  if (GNUNET_OK !=
-      TALER_wallet_purse_merge_verify (
-        payto_uri,
-        merge_timestamp,
-        purse_pub,
-        merge_pub,
-        &merge_sig))
-  {
-    GNUNET_break_op (0);
-    GNUNET_free (payto_uri);
-    return GNUNET_SYSERR;
-  }
-  GNUNET_free (payto_uri);
-  if (0 ==
-      GNUNET_memcmp (&merge_sig,
-                     cmerge_sig))
-  {
-    /* Must be the SAME data, not a conflict! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_coin_conflict_ (
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const char *donau_url,
-  const json_t *proof,
-  struct TALER_DenominationHashP *h_denom_pub,
-  struct TALER_AgeCommitmentHash *phac,
-  struct TALER_CoinSpendPublicKeyP *coin_pub,
-  struct TALER_CoinSpendSignatureP *coin_sig)
-{
-  const char *partner_url = NULL;
-  struct TALER_Amount amount;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-                                 h_denom_pub),
-    GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
-                                 phac),
-    GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                 coin_sig),
-    GNUNET_JSON_spec_fixed_auto ("coin_pub",
-                                 coin_pub),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_string ("partner_url",
-                               &partner_url),
-      NULL),
-    TALER_JSON_spec_amount_any ("amount",
-                                &amount),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (proof,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (NULL == partner_url)
-    partner_url = donau_url;
-  if (GNUNET_OK !=
-      TALER_wallet_purse_deposit_verify (
-        partner_url,
-        purse_pub,
-        &amount,
-        h_denom_pub,
-        phac,
-        coin_pub,
-        coin_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_econtract_conflict_ (
-  const struct TALER_PurseContractSignatureP *ccontract_sig,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const json_t *proof)
-{
-  struct TALER_ContractDiffiePublicP contract_pub;
-  struct TALER_PurseContractSignatureP contract_sig;
-  struct GNUNET_HashCode h_econtract;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("h_econtract",
-                                 &h_econtract),
-    GNUNET_JSON_spec_fixed_auto ("econtract_sig",
-                                 &contract_sig),
-    GNUNET_JSON_spec_fixed_auto ("contract_pub",
-                                 &contract_pub),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (proof,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      TALER_wallet_econtract_upload_verify2 (
-        &h_econtract,
-        &contract_pub,
-        purse_pub,
-        &contract_sig))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 ==
-      GNUNET_memcmp (&contract_sig,
-                     ccontract_sig))
-  {
-    /* Must be the SAME data, not a conflict! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_check_coin_amount_conflict_ (
-  const struct DONAU_Keys *keys,
-  const json_t *proof,
-  struct TALER_CoinSpendPublicKeyP *coin_pub,
-  struct TALER_Amount *remaining)
-{
-  const json_t *history;
-  struct TALER_Amount total;
-  struct TALER_DenominationHashP h_denom_pub;
-  const struct DONAU_DenomPublicKey *dki;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("coin_pub",
-                                 coin_pub),
-    GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-                                 &h_denom_pub),
-    GNUNET_JSON_spec_array_const ("history",
-                                  &history),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (proof,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  dki = DONAU_get_denomination_key_by_hash (
-    keys,
-    &h_denom_pub);
-  if (NULL == dki)
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (GNUNET_OK !=
-      DONAU_verify_coin_history (dki,
-                                 coin_pub,
-                                 history,
-                                 &total))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 >
-      TALER_amount_subtract (remaining,
-                             &dki->value,
-                             &total))
-  {
-    /* Strange 'proof': coin was double-spent
-       before our transaction?! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Verify that @a coin_sig does NOT appear in
- * the history of @a proof and thus whatever transaction
- * is authorized by @a coin_sig is a conflict with
- * @a proof.
- *
- * @param proof a proof to check
- * @param coin_sig signature that must not be in @a proof
- * @return #GNUNET_OK if @a coin_sig is not in @a proof
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_coin_signature_conflict_ (
-  const json_t *proof,
-  const struct TALER_CoinSpendSignatureP *coin_sig)
-{
-  json_t *history;
-  size_t off;
-  json_t *entry;
-
-  history = json_object_get (proof,
-                             "history");
-  if (NULL == history)
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  json_array_foreach (history, off, entry)
-  {
-    struct TALER_CoinSpendSignatureP cs;
-    struct GNUNET_JSON_Specification spec[] = {
-      GNUNET_JSON_spec_fixed_auto ("coin_sig",
-                                   &cs),
-      GNUNET_JSON_spec_end ()
-    };
-
-    if (GNUNET_OK !=
-        GNUNET_JSON_parse (entry,
-                           spec,
-                           NULL, NULL))
-      continue; /* entry without coin signature */
-    if (0 ==
-        GNUNET_memcmp (&cs,
-                       coin_sig))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_check_coin_denomination_conflict_ (
-  const json_t *proof,
-  const struct TALER_DenominationHashP *ch_denom_pub)
-{
-  struct TALER_DenominationHashP h_denom_pub;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-                                 &h_denom_pub),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (proof,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  if (0 ==
-      GNUNET_memcmp (ch_denom_pub,
-                     &h_denom_pub))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_OK;
-  }
-  /* indeed, proof with different denomination key provided */
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_check_coin_conflict_ (
-  const struct DONAU_Keys *keys,
-  const json_t *proof,
-  const struct DONAU_DenomPublicKey *dk,
-  const struct TALER_CoinSpendPublicKeyP *coin_pub,
-  const struct TALER_CoinSpendSignatureP *coin_sig,
-  const struct TALER_Amount *required)
-{
-  enum TALER_ErrorCode ec;
-
-  ec = TALER_JSON_get_error_code (proof);
-  switch (ec)
-  {
-  case TALER_EC_DONAU_GENERIC_INSUFFICIENT_FUNDS:
-    {
-      struct TALER_Amount left;
-      struct TALER_CoinSpendPublicKeyP pcoin_pub;
-
-      if (GNUNET_OK !=
-          DONAU_check_coin_amount_conflict_ (
-            keys,
-            proof,
-            &pcoin_pub,
-            &left))
-      {
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      if (0 !=
-          GNUNET_memcmp (&pcoin_pub,
-                         coin_pub))
-      {
-        /* conflict is for a different coin! */
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      if (-1 !=
-          TALER_amount_cmp (&left,
-                            required))
-      {
-        /* Balance was sufficient after all; recoup MAY have still been 
possible */
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      if (GNUNET_OK !=
-          DONAU_check_coin_signature_conflict_ (
-            proof,
-            coin_sig))
-      {
-        /* Not a conflicting transaction: ours is included! */
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      break;
-    }
-  case TALER_EC_DONAU_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY:
-    {
-      struct TALER_Amount left;
-      struct TALER_CoinSpendPublicKeyP pcoin_pub;
-
-      if (GNUNET_OK !=
-          DONAU_check_coin_amount_conflict_ (
-            keys,
-            proof,
-            &pcoin_pub,
-            &left))
-      {
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      if (0 !=
-          GNUNET_memcmp (&pcoin_pub,
-                         coin_pub))
-      {
-        /* conflict is for a different coin! */
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      if (GNUNET_OK !=
-          DONAU_check_coin_denomination_conflict_ (
-            proof,
-            &dk->h_key))
-      {
-        /* Eh, same denomination, hence no conflict */
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      break;
-    }
-  default:
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_get_min_denomination_ (
-  const struct DONAU_Keys *keys,
-  struct TALER_Amount *min)
-{
-  bool have_min = false;
-  for (unsigned int i = 0; i<keys->num_denom_keys; i++)
-  {
-    const struct DONAU_DenomPublicKey *dk = &keys->denom_keys[i];
-
-    if (! have_min)
-    {
-      *min = dk->value;
-      have_min = true;
-      continue;
-    }
-    if (1 != TALER_amount_cmp (min,
-                               &dk->value))
-      continue;
-    *min = dk->value;
-  }
-  if (! have_min)
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_verify_deposit_signature_ (
-  const struct DONAU_DepositContractDetail *dcd,
-  const struct TALER_ExtensionPolicyHashP *ech,
-  const struct TALER_CharityWireHashP *h_wire,
-  const struct DONAU_CoinDepositDetail *cdd,
-  const struct DONAU_DenomPublicKey *dki)
-{
-  if (GNUNET_OK !=
-      TALER_wallet_deposit_verify (&cdd->amount,
-                                   &dki->fees.deposit,
-                                   h_wire,
-                                   &dcd->h_contract_terms,
-                                   &dcd->wallet_data_hash,
-                                   &cdd->h_age_commitment,
-                                   ech,
-                                   &cdd->h_denom_pub,
-                                   dcd->wallet_timestamp,
-                                   &dcd->charity_pub,
-                                   dcd->refund_deadline,
-                                   &cdd->coin_pub,
-                                   &cdd->coin_sig))
-  {
-    GNUNET_break_op (0);
-    TALER_LOG_WARNING ("Invalid coin signature on /deposit request!\n");
-    TALER_LOG_DEBUG ("... amount_with_fee was %s\n",
-                     TALER_amount2s (&cdd->amount));
-    TALER_LOG_DEBUG ("... deposit_fee was %s\n",
-                     TALER_amount2s (&dki->fees.deposit));
-    return GNUNET_SYSERR;
-  }
-
-  /* check coin signature */
-  {
-    struct TALER_CoinPublicInfo coin_info = {
-      .coin_pub = cdd->coin_pub,
-      .denom_pub_hash = cdd->h_denom_pub,
-      .denom_sig = cdd->denom_sig,
-      .h_age_commitment = cdd->h_age_commitment,
-    };
-
-    if (GNUNET_YES !=
-        TALER_test_coin_valid (&coin_info,
-                               &dki->key))
-    {
-      GNUNET_break_op (0);
-      TALER_LOG_WARNING ("Invalid coin passed for /deposit\n");
-      return GNUNET_SYSERR;
-    }
-  }
-
-  /* Check coin does make a contribution */
-  if (0 < TALER_amount_cmp (&dki->fees.deposit,
-                            &cdd->amount))
-  {
-    GNUNET_break_op (0);
-    TALER_LOG_WARNING ("Deposit amount smaller than fee\n");
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
-
-
-/**
- * Parse account restriction in @a jrest into @a rest.
- *
- * @param jresta array of account restrictions in JSON
- * @param[out] resta_len set to length of @a resta
- * @param[out] resta account restriction array to set
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_restrictions (const json_t *jresta,
-                    unsigned int *resta_len,
-                    struct DONAU_AccountRestriction **resta)
-{
-  if (! json_is_array (jresta))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  *resta_len = json_array_size (jresta);
-  if (0 == *resta_len)
-  {
-    /* no restrictions, perfectly OK */
-    *resta = NULL;
-    return GNUNET_OK;
-  }
-  *resta = GNUNET_new_array (*resta_len,
-                             struct DONAU_AccountRestriction);
-  for (unsigned int i = 0; i<*resta_len; i++)
-  {
-    const json_t *jr = json_array_get (jresta,
-                                       i);
-    struct DONAU_AccountRestriction *ar = &(*resta)[i];
-    const char *type = json_string_value (json_object_get (jr,
-                                                           "type"));
-
-    if (NULL == type)
-    {
-      GNUNET_break (0);
-      goto fail;
-    }
-    if (0 == strcmp (type,
-                     "deny"))
-    {
-      ar->type = DONAU_AR_DENY;
-      continue;
-    }
-    if (0 == strcmp (type,
-                     "regex"))
-    {
-      const char *regex;
-      const char *hint;
-      struct GNUNET_JSON_Specification spec[] = {
-        GNUNET_JSON_spec_string (
-          "payto_regex",
-          &regex),
-        GNUNET_JSON_spec_string (
-          "human_hint",
-          &hint),
-        GNUNET_JSON_spec_mark_optional (
-          GNUNET_JSON_spec_json (
-            "human_hint_i18n",
-            &ar->details.regex.human_hint_i18n),
-          NULL),
-        GNUNET_JSON_spec_end ()
-      };
-
-      if (GNUNET_OK !=
-          GNUNET_JSON_parse (jr,
-                             spec,
-                             NULL, NULL))
-      {
-        /* bogus reply */
-        GNUNET_break_op (0);
-        goto fail;
-      }
-      ar->type = DONAU_AR_REGEX;
-      ar->details.regex.posix_egrep = GNUNET_strdup (regex);
-      ar->details.regex.human_hint = GNUNET_strdup (hint);
-      continue;
-    }
-    /* unsupported type */
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-fail:
-  GNUNET_free (*resta);
-  *resta_len = 0;
-  return GNUNET_SYSERR;
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_parse_accounts (
-  const struct TALER_MasterPublicKeyP *master_pub,
-  const json_t *accounts,
-  unsigned int was_length,
-  struct DONAU_WireAccount was[static was_length])
-{
-  memset (was,
-          0,
-          sizeof (struct DONAU_WireAccount) * was_length);
-  GNUNET_assert (was_length ==
-                 json_array_size (accounts));
-  for (unsigned int i = 0;
-       i<was_length;
-       i++)
-  {
-    struct DONAU_WireAccount *wa = &was[i];
-    const char *payto_uri;
-    const char *conversion_url;
-    const json_t *credit_restrictions;
-    const json_t *debit_restrictions;
-    struct GNUNET_JSON_Specification spec_account[] = {
-      GNUNET_JSON_spec_string ("payto_uri",
-                               &payto_uri),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_string ("conversion_url",
-                                 &conversion_url),
-        NULL),
-      GNUNET_JSON_spec_array_const ("credit_restrictions",
-                                    &credit_restrictions),
-      GNUNET_JSON_spec_array_const ("debit_restrictions",
-                                    &debit_restrictions),
-      GNUNET_JSON_spec_fixed_auto ("master_sig",
-                                   &wa->master_sig),
-      GNUNET_JSON_spec_end ()
-    };
-    json_t *account;
-
-    account = json_array_get (accounts,
-                              i);
-    if (GNUNET_OK !=
-        GNUNET_JSON_parse (account,
-                           spec_account,
-                           NULL, NULL))
-    {
-      /* bogus reply */
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    {
-      char *err;
-
-      err = TALER_payto_validate (payto_uri);
-      if (NULL != err)
-      {
-        GNUNET_break_op (0);
-        GNUNET_free (err);
-        return GNUNET_SYSERR;
-      }
-    }
-
-    if ( (NULL != master_pub) &&
-         (GNUNET_OK !=
-          TALER_donau_wire_signature_check (
-            payto_uri,
-            conversion_url,
-            debit_restrictions,
-            credit_restrictions,
-            master_pub,
-            &wa->master_sig)) )
-    {
-      /* bogus reply */
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    if ( (GNUNET_OK !=
-          parse_restrictions (credit_restrictions,
-                              &wa->credit_restrictions_length,
-                              &wa->credit_restrictions)) ||
-         (GNUNET_OK !=
-          parse_restrictions (debit_restrictions,
-                              &wa->debit_restrictions_length,
-                              &wa->debit_restrictions)) )
-    {
-      /* bogus reply */
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    wa->payto_uri = GNUNET_strdup (payto_uri);
-    if (NULL != conversion_url)
-      wa->conversion_url = GNUNET_strdup (conversion_url);
-  }       /* end 'for all accounts */
-  return GNUNET_OK;
-}
-
-
-/**
- * Free array of account restrictions.
- *
- * @param ar_len length of @a ar
- * @param[in] ar array to free contents of (but not @a ar itself)
- */
-static void
-free_restrictions (unsigned int ar_len,
-                   struct DONAU_AccountRestriction ar[static ar_len])
-{
-  for (unsigned int i = 0; i<ar_len; i++)
-  {
-    struct DONAU_AccountRestriction *a = &ar[i];
-    switch (a->type)
-    {
-    case DONAU_AR_INVALID:
-      GNUNET_break (0);
-      break;
-    case DONAU_AR_DENY:
-      break;
-    case DONAU_AR_REGEX:
-      GNUNET_free (ar->details.regex.posix_egrep);
-      GNUNET_free (ar->details.regex.human_hint);
-      json_decref (ar->details.regex.human_hint_i18n);
-      break;
-    }
-  }
-}
-
-
-void
-DONAU_free_accounts (
-  unsigned int was_len,
-  struct DONAU_WireAccount was[static was_len])
-{
-  for (unsigned int i = 0; i<was_len; i++)
-  {
-    struct DONAU_WireAccount *wa = &was[i];
-
-    GNUNET_free (wa->payto_uri);
-    GNUNET_free (wa->conversion_url);
-    free_restrictions (wa->credit_restrictions_length,
-                       wa->credit_restrictions);
-    GNUNET_array_grow (wa->credit_restrictions,
-                       wa->credit_restrictions_length,
-                       0);
-    free_restrictions (wa->debit_restrictions_length,
-                       wa->debit_restrictions);
-    GNUNET_array_grow (wa->debit_restrictions,
-                       wa->debit_restrictions_length,
-                       0);
-  }
-}
-
-
 /* end of donau_api_common.c */
diff --git a/src/lib/donau_api_common.h b/src/lib/donau_api_common.h
index 99e96a5..18bb67e 100644
--- a/src/lib/donau_api_common.h
+++ b/src/lib/donau_api_common.h
@@ -25,195 +25,6 @@
 #include "taler/taler_json_lib.h"
 #include "donau_service.h"
 
-
-/**
- * Check proof of a purse creation conflict.
- *
- * @param cpurse_sig conflicting signature (must
- *        not match the signature from the proof)
- * @param purse_pub the public key (must match
- *        the signature from the proof)
- * @param proof the proof to check
- * @return #GNUNET_OK if the @a proof is OK for @a purse_pub and conflicts 
with @a cpurse_sig
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_create_conflict_ (
-  const struct TALER_PurseContractSignatureP *cpurse_sig,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const json_t *proof);
-
-
-/**
- * Check proof of a purse merge conflict.
- *
- * @param cmerge_sig conflicting signature (must
- *        not match the signature from the proof)
- * @param merge_pub the public key (must match
- *        the signature from the proof)
- * @param purse_pub the public key of the purse
- * @param donau_url the base URL of this donau
- * @param proof the proof to check
- * @return #GNUNET_OK if the @a proof is OK for @a purse_pub and @a merge_pub 
and conflicts with @a cmerge_sig
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_merge_conflict_ (
-  const struct TALER_PurseMergeSignatureP *cmerge_sig,
-  const struct TALER_PurseMergePublicKeyP *merge_pub,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const char *donau_url,
-  const json_t *proof);
-
-
-/**
- * Check @a proof that claims this coin was spend
- * differently on the same purse already. Note that
- * the caller must still check that @a coin_pub is
- * in the list of coins that were used, and that
- * @a coin_sig is different from the signature the
- * caller used.
- *
- * @param purse_pub the public key of the purse
- * @param donau_url base URL of our donau
- * @param proof the proof to check
- * @param[out] h_denom_pub hash of the coin's denomination
- * @param[out] phac age commitment hash of the coin
- * @param[out] coin_pub set to the conflicting coin
- * @param[out] coin_sig set to the conflicting signature
- * @return #GNUNET_OK if the @a proof is OK for @a purse_pub and showing that 
@a coin_pub was spent using @a coin_sig.
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_coin_conflict_ (
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const char *donau_url,
-  const json_t *proof,
-  struct TALER_DenominationHashP *h_denom_pub,
-  struct TALER_AgeCommitmentHash *phac,
-  struct TALER_CoinSpendPublicKeyP *coin_pub,
-  struct TALER_CoinSpendSignatureP *coin_sig);
-
-
-/**
- * Check proof of a contract conflict.
- *
- * @param ccontract_sig conflicting signature (must
- *        not match the signature from the proof)
- * @param purse_pub public key of the purse
- * @param proof the proof to check
- * @return #GNUNET_OK if the @a proof is OK for @a purse_pub and conflicts 
with @a ccontract_sig
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_purse_econtract_conflict_ (
-  const struct TALER_PurseContractSignatureP *ccontract_sig,
-  const struct TALER_PurseContractPublicKeyP *purse_pub,
-  const json_t *proof);
-
-
-/**
- * Check proof of a coin spend value conflict.
- *
- * @param keys donau /keys structure
- * @param proof the proof to check
- * @param[out] coin_pub set to the public key of the
- *        coin that is claimed to have an insufficient
- *        balance
- * @param[out] remaining set to the remaining balance
- *        of the coin as provided by the proof
- * @return #GNUNET_OK if the @a proof is OK for @a purse_pub demonstrating 
that @a coin_pub has only @a remaining balance.
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_coin_amount_conflict_ (
-  const struct DONAU_Keys *keys,
-  const json_t *proof,
-  struct TALER_CoinSpendPublicKeyP *coin_pub,
-  struct TALER_Amount *remaining);
-
-
-/**
- * Verify that @a proof contains a coin history that demonstrates that @a
- * coin_pub was previously used with a denomination key that is different from
- * @a ch_denom_pub.  Note that the coin history MUST have been checked before
- * using #DONAU_check_coin_amount_conflict_().
- *
- * @param proof a proof to check
- * @param ch_denom_pub hash of the conflicting denomination
- * @return #GNUNET_OK if @a ch_denom_pub differs from the
- *         denomination hash given by the history of the coin
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_coin_denomination_conflict_ (
-  const json_t *proof,
-  const struct TALER_DenominationHashP *ch_denom_pub);
-
-
-/**
- * Verify that @a coin_sig does NOT appear in
- * the history of @a proof and thus whatever transaction
- * is authorized by @a coin_sig is a conflict with
- * @a proof.
- *
- * @param proof a proof to check
- * @param coin_sig signature that must not be in @a proof
- * @return #GNUNET_OK if @a coin_sig is not in @a proof
- */
-enum GNUNET_GenericReturnValue
-DONAU_check_coin_signature_conflict_ (
-  const json_t *proof,
-  const struct TALER_CoinSpendSignatureP *coin_sig);
-
-
-/**
- * Check that the provided @a proof indeeds indicates
- * a conflict for @a coin_pub.
- *
- * @param keys donau keys
- * @param proof provided conflict proof
- * @param dk denomination of @a coin_pub that the client
- *           used
- * @param coin_pub public key of the coin
- * @param coin_sig signature over operation that conflicted
- * @param required balance required on the coin for the operation
- * @return #GNUNET_OK if @a proof holds
- */
-// enum GNUNET_GenericReturnValue
-// DONAU_check_coin_conflict_ (
-//   const struct DONAU_Keys *keys,
-//   const json_t *proof,
-//   const struct DONAU_DenomPublicKey *dk,
-//   const struct TALER_CoinSpendPublicKeyP *coin_pub,
-//   const struct TALER_CoinSpendSignatureP *coin_sig,
-//   const struct TALER_Amount *required);
-
-
-/**
- * Find the smallest denomination amount in @e keys.
- *
- * @param keys keys to search
- * @param[out] min set to the smallest amount
- * @return #GNUNET_SYSERR if there are no denominations in @a keys
-*/
-enum GNUNET_GenericReturnValue
-DONAU_get_min_denomination_ (
-  const struct DONAU_Keys *keys,
-  struct TALER_Amount *min);
-
-
-/**
- * Verify signature information about the deposit.
- *
- * @param dcd contract details
- * @param ech hashed policy (passed to avoid recomputation)
- * @param h_wire hashed wire details (passed to avoid recomputation)
- * @param cdd coin-specific details
- * @param dki denomination of the coin
- * @return #GNUNET_OK if signatures are OK, #GNUNET_SYSERR if not
- */
-// enum GNUNET_GenericReturnValue
-// DONAU_verify_deposit_signature_ (
-//   const struct DONAU_DepositContractDetail *dcd,
-//   const struct TALER_ExtensionPolicyHashP *ech,
-//   const struct TALER_CharityWireHashP *h_wire,
-//   const struct DONAU_CoinDepositDetail *cdd,
-//   const struct DONAU_DenomPublicKey *dki);
-
+// Checks
 
 #endif
diff --git a/src/lib/donau_api_handle.c b/src/lib/donau_api_handle.c
index 917658b..9ebc96b 100644
--- a/src/lib/donau_api_handle.c
+++ b/src/lib/donau_api_handle.c
@@ -74,7 +74,7 @@
  * how long do we assume the reply to be valid at least?
  */
 #define MINIMUM_EXPIRATION GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_MINUTES, 2)
+          GNUNET_TIME_UNIT_MINUTES, 2)
 
 
 /**
@@ -124,9 +124,9 @@ struct DONAU_GetKeysHandle
 
 
 #define EXITIF(cond)                                              \
-  do {                                                            \
-    if (cond) { GNUNET_break (0); goto EXITIF_exit; }             \
-  } while (0)
+        do {                                                            \
+          if (cond) { GNUNET_break (0); goto EXITIF_exit; }             \
+        } while (0)
 
 
 /**
@@ -179,1649 +179,3 @@ parse_json_signkey (struct 
DONAU_SigningPublicKeyAndValidity *sign_key,
   }
   return GNUNET_OK;
 }
-
-
-/**
- * Parse a donau's denomination key encoded in JSON partially.
- *
- * Only the values for master_sig, timestamps and the cipher-specific public
- * key are parsed.  All other fields (fees, age_mask, value) MUST have been set
- * prior to calling this function, otherwise the signature verification
- * performed within this function will fail.
- *
- * @param[out] denom_key where to return the result
- * @param cipher cipher type to parse
- * @param check_sigs should we check signatures?
- * @param denom_key_obj json to parse
- * @param master_key master key to use to verify signature
- * @param[in,out] hash_xor where to accumulate data for signature verification 
via XOR
- * @return #GNUNET_OK if all is fine, #GNUNET_SYSERR if the signature is
- *        invalid or the json malformed.
- */
-static enum GNUNET_GenericReturnValue
-parse_json_denomkey_partially (
-  struct DONAU_DenomPublicKey *denom_key,
-  enum TALER_DenominationCipher cipher,
-  bool check_sigs,
-  const json_t *denom_key_obj,
-  struct TALER_MasterPublicKeyP *master_key,
-  struct GNUNET_HashCode *hash_xor)
-{
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_fixed_auto ("master_sig",
-                                 &denom_key->master_sig),
-    GNUNET_JSON_spec_timestamp ("stamp_expire_deposit",
-                                &denom_key->expire_deposit),
-    GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw",
-                                &denom_key->withdraw_valid_until),
-    GNUNET_JSON_spec_timestamp ("stamp_start",
-                                &denom_key->valid_from),
-    GNUNET_JSON_spec_timestamp ("stamp_expire_legal",
-                                &denom_key->expire_legal),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_bool ("lost",
-                             &denom_key->lost),
-      NULL),
-    TALER_JSON_spec_denom_pub_cipher (NULL,
-                                      cipher,
-                                      &denom_key->key),
-    GNUNET_JSON_spec_end ()
-  };
-
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (denom_key_obj,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  TALER_denom_pub_hash (&denom_key->key,
-                        &denom_key->h_key);
-  if (NULL != hash_xor)
-    GNUNET_CRYPTO_hash_xor (&denom_key->h_key.hash,
-                            hash_xor,
-                            hash_xor);
-  if (! check_sigs)
-    return GNUNET_OK;
-  EXITIF (GNUNET_SYSERR ==
-          TALER_donau_offline_denom_validity_verify (
-            &denom_key->h_key,
-            denom_key->valid_from,
-            denom_key->withdraw_valid_until,
-            denom_key->expire_deposit,
-            denom_key->expire_legal,
-            &denom_key->value,
-            &denom_key->fees,
-            master_key,
-            &denom_key->master_sig));
-  return GNUNET_OK;
-EXITIF_exit:
-  /* invalidate denom_key, just to be sure */
-  memset (denom_key,
-          0,
-          sizeof (*denom_key));
-  GNUNET_JSON_parse_free (spec);
-  return GNUNET_SYSERR;
-}
-
-
-/**
- * Decode the JSON in @a resp_obj from the /keys response
- * and store the data in the @a key_data.
- *
- * @param[in] resp_obj JSON object to parse
- * @param check_sig true if we should check the signature
- * @param[out] key_data where to store the results we decoded
- * @param[out] vc where to store version compatibility data
- * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
- * (malformed JSON)
- */
-static enum GNUNET_GenericReturnValue
-decode_keys_json (const json_t *resp_obj,
-                  bool check_sig,
-                  struct DONAU_Keys *key_data,
-                  enum DONAU_VersionCompatibility *vc)
-{
-  struct TALER_DonauSignatureP denominations_sig;
-  struct DONAU_DonauPublicKeyP pub;
-  const json_t *sign_keys_array;
-  const json_t *donation_units_by_group;
-  bool no_signature = false;
-
-  if (JSON_OBJECT != json_typeof (resp_obj))
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-#if DEBUG
-  json_dumpf (resp_obj,
-              stderr,
-              JSON_INDENT (2));
-#endif
-  /* check the version first */
-  {
-    const char *ver;
-    unsigned int age;
-    unsigned int revision;
-    unsigned int current;
-    char dummy;
-    struct GNUNET_JSON_Specification spec[] = {
-      GNUNET_JSON_spec_string ("version",
-                               &ver),
-      GNUNET_JSON_spec_end ()
-    };
-
-    if (GNUNET_OK !=
-        GNUNET_JSON_parse (resp_obj,
-                           spec,
-                           NULL, NULL))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    if (3 != sscanf (ver,
-                     "%u:%u:%u%c",
-                     &current,
-                     &revision,
-                     &age,
-                     &dummy))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    *vc = DONAU_VC_MATCH;
-    if (DONAU_PROTOCOL_CURRENT < current)
-    {
-      *vc |= DONAU_VC_NEWER;
-      if (DONAU_PROTOCOL_CURRENT < current - age)
-        *vc |= DONAU_VC_INCOMPATIBLE;
-    }
-    if (DONAU_PROTOCOL_CURRENT > current)
-    {
-      *vc |= DONAU_VC_OLDER;
-      if (DONAU_PROTOCOL_CURRENT - DONAU_PROTOCOL_AGE > current)
-        *vc |= DONAU_VC_INCOMPATIBLE;
-    }
-    key_data->version = GNUNET_strdup (ver);
-  }
-
-  {
-    const char *currency;
-    const char *asset_type;
-    struct GNUNET_JSON_Specification mspec[] = {
-      GNUNET_JSON_spec_fixed_auto (
-        "denominations_sig",
-        &denominations_sig),
-      GNUNET_JSON_spec_fixed_auto (
-        "eddsa_pub",
-        &pub),
-      GNUNET_JSON_spec_fixed_auto (
-        "master_public_key",
-        &key_data->master_pub),
-      GNUNET_JSON_spec_array_const ("accounts",
-                                    &accounts),
-      GNUNET_JSON_spec_object_const ("wire_fees",
-                                     &fees),
-      GNUNET_JSON_spec_array_const ("wads",
-                                    &wads),
-      GNUNET_JSON_spec_timestamp (
-        "list_issue_date",
-        &key_data->list_issue_date),
-      GNUNET_JSON_spec_relative_time (
-        "reserve_closing_delay",
-        &key_data->reserve_closing_delay),
-      GNUNET_JSON_spec_string (
-        "currency",
-        &currency),
-      GNUNET_JSON_spec_uint32 (
-        "currency_fraction_digits",
-        &key_data->currency_fraction_digits),
-      GNUNET_JSON_spec_string (
-        "asset_type",
-        &asset_type),
-      GNUNET_JSON_spec_array_const (
-        "global_fees",
-        &global_fees),
-      GNUNET_JSON_spec_array_const (
-        "signkeys",
-        &sign_keys_array),
-      GNUNET_JSON_spec_array_const (
-        "denominations",
-        &denominations_by_group),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_array_const (
-          "recoup",
-          &recoup_array),
-        NULL),
-      GNUNET_JSON_spec_array_const (
-        "auditors",
-        &auditors_array),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_bool (
-          "rewards_allowed",
-          &key_data->rewards_allowed),
-        NULL),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_object_const ("extensions",
-                                       &manifests),
-        &no_extensions),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_fixed_auto (
-          "extensions_sig",
-          &key_data->extensions_sig),
-        &no_signature),
-      GNUNET_JSON_spec_mark_optional (
-        GNUNET_JSON_spec_array_const (
-          "wallet_balance_limit_without_kyc",
-          &wblwk),
-        NULL),
-      GNUNET_JSON_spec_end ()
-    };
-    const char *emsg;
-    unsigned int eline;
-
-    if (GNUNET_OK !=
-        GNUNET_JSON_parse (resp_obj,
-                           (check_sig) ? mspec : &mspec[2],
-                           &emsg,
-                           &eline))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "Parsing /keys failed for `%s' (%u)\n",
-                  emsg,
-                  eline);
-      EXITIF (1);
-    }
-    {
-      struct GNUNET_JSON_Specification sspec[] = {
-        TALER_JSON_spec_amount (
-          "stefan_abs",
-          currency,
-          &key_data->stefan_abs),
-        TALER_JSON_spec_amount (
-          "stefan_log",
-          currency,
-          &key_data->stefan_log),
-        TALER_JSON_spec_amount (
-          "stefan_lin",
-          currency,
-          &key_data->stefan_lin),
-        GNUNET_JSON_spec_end ()
-      };
-
-      EXITIF (GNUNET_OK !=
-              GNUNET_JSON_parse (resp_obj,
-                                 sspec,
-                                 NULL, NULL));
-    }
-
-    key_data->currency = GNUNET_strdup (currency);
-    key_data->asset_type = GNUNET_strdup (asset_type);
-    if (! no_extensions)
-      key_data->extensions = json_incref ((json_t *) manifests);
-  }
-
-  /* parse the global fees */
-  key_data->num_global_fees
-    = json_array_size (global_fees);
-  if (0 != key_data->num_global_fees)
-  {
-    json_t *global_fee;
-    unsigned int index;
-
-    key_data->global_fees
-      = GNUNET_new_array (key_data->num_global_fees,
-                          struct DONAU_GlobalFee);
-    json_array_foreach (global_fees, index, global_fee)
-    {
-      EXITIF (GNUNET_SYSERR ==
-              parse_global_fee (&key_data->global_fees[index],
-                                check_sig,
-                                global_fee,
-                                key_data));
-    }
-  }
-
-  /* parse the signing keys */
-  key_data->num_sign_keys
-    = json_array_size (sign_keys_array);
-  if (0 != key_data->num_sign_keys)
-  {
-    json_t *sign_key_obj;
-    unsigned int index;
-
-    key_data->sign_keys
-      = GNUNET_new_array (key_data->num_sign_keys,
-                          struct DONAU_SigningPublicKey);
-    json_array_foreach (sign_keys_array, index, sign_key_obj) {
-      EXITIF (GNUNET_SYSERR ==
-              parse_json_signkey (&key_data->sign_keys[index],
-                                  check_sig,
-                                  sign_key_obj,
-                                  &key_data->master_pub));
-    }
-  }
-
-  /* Parse balance limits */
-  if (NULL != wblwk)
-  {
-    key_data->wblwk_length = json_array_size (wblwk);
-    key_data->wallet_balance_limit_without_kyc
-      = GNUNET_new_array (key_data->wblwk_length,
-                          struct TALER_Amount);
-    for (unsigned int i = 0; i<key_data->wblwk_length; i++)
-    {
-      struct TALER_Amount *a = &key_data->wallet_balance_limit_without_kyc[i];
-      const json_t *aj = json_array_get (wblwk,
-                                         i);
-      struct GNUNET_JSON_Specification spec[] = {
-        TALER_JSON_spec_amount (NULL,
-                                key_data->currency,
-                                a),
-        GNUNET_JSON_spec_end ()
-      };
-
-      EXITIF (GNUNET_OK !=
-              GNUNET_JSON_parse (aj,
-                                 spec,
-                                 NULL, NULL));
-    }
-  }
-
-  /* Parse wire accounts */
-  key_data->fees = parse_fees (&key_data->master_pub,
-                               key_data->currency,
-                               fees,
-                               &key_data->fees_len);
-  EXITIF (NULL == key_data->fees);
-  /* parse accounts */
-  GNUNET_array_grow (key_data->accounts,
-                     key_data->accounts_len,
-                     json_array_size (accounts));
-  EXITIF (GNUNET_OK !=
-          DONAU_parse_accounts (&key_data->master_pub,
-                                accounts,
-                                key_data->accounts_len,
-                                key_data->accounts));
-
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Parsed %u wire accounts from JSON\n",
-              (unsigned int) json_array_size (accounts));
-
-
-  /* Parse the supported extension(s): age-restriction. */
-  /* TODO: maybe lift all this into a FP in TALER_Extension ? */
-  if (! no_extensions)
-  {
-    if (no_signature)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "found extensions without signature\n");
-    }
-    else
-    {
-      /* We have an extensions object. Verify its signature. */
-      EXITIF (GNUNET_OK !=
-              TALER_extensions_verify_manifests_signature (
-                manifests,
-                &key_data->extensions_sig,
-                &key_data->master_pub));
-
-      /* Parse and set the the configuration of the extensions accordingly */
-      EXITIF (GNUNET_OK !=
-              TALER_extensions_load_manifests (manifests));
-    }
-
-    /* Assuming we might have now a new value for age_mask, set it in key_data 
*/
-    key_data->age_mask = TALER_extensions_get_age_restriction_mask ();
-  }
-
-  /*
-   * Parse the denomination keys, merging with the
-   * possibly EXISTING array as required (/keys cherry picking).
-   *
-   * The denominations are grouped by common values of
-   *    {cipher, value, fee, age_mask}.
-   */
-  {
-    json_t *group_obj;
-    unsigned int group_idx;
-
-    json_array_foreach (denominations_by_group, group_idx, group_obj)
-    {
-      /* Running XOR of each SHA512 hash of the denominations' public key in
-         this group.  Used to compare against group.hash after all keys have
-         been parsed. */
-      struct GNUNET_HashCode group_hash_xor = {0};
-
-      /* First, parse { cipher, fees, value, age_mask, hash } of the current
-         group. */
-      struct TALER_DenominationGroup group = {0};
-      const json_t *denom_keys_array;
-      struct GNUNET_JSON_Specification group_spec[] = {
-        TALER_JSON_spec_denomination_group (NULL,
-                                            key_data->currency,
-                                            &group),
-        GNUNET_JSON_spec_array_const ("denoms",
-                                      &denom_keys_array),
-        GNUNET_JSON_spec_end ()
-      };
-      json_t *denom_key_obj;
-      unsigned int index;
-
-      EXITIF (GNUNET_SYSERR ==
-              GNUNET_JSON_parse (group_obj,
-                                 group_spec,
-                                 NULL,
-                                 NULL));
-
-      /* Now, parse the individual denominations */
-      json_array_foreach (denom_keys_array, index, denom_key_obj)
-      {
-        /* Set the common fields from the group for this particular
-           denomination.  Required to make the validity check inside
-           parse_json_denomkey_partially pass */
-        struct DONAU_DenomPublicKey dk = {
-          .key.cipher = group.cipher,
-          .value = group.value,
-          .fees = group.fees,
-          .key.age_mask = group.age_mask
-        };
-        bool found = false;
-
-        EXITIF (GNUNET_SYSERR ==
-                parse_json_denomkey_partially (&dk,
-                                               group.cipher,
-                                               check_sig,
-                                               denom_key_obj,
-                                               &key_data->master_pub,
-                                               check_sig ? &hash_xor : NULL));
-
-        /* Build the running xor of the SHA512-hash of the public keys for the 
group */
-        GNUNET_CRYPTO_hash_xor (&dk.h_key.hash,
-                                &group_hash_xor,
-                                &group_hash_xor);
-        for (unsigned int j = 0;
-             j<key_data->num_denom_keys;
-             j++)
-        {
-          if (0 == GNUNET_CRYPTO_bsign_pub_cmp (&dk,
-                                                &key_data->denom_keys[j]))
-          {
-            found = true;
-            break;
-          }
-        }
-
-        if (found)
-        {
-          /* 0:0:0 did not support /keys cherry picking */
-          TALER_LOG_DEBUG ("Skipping denomination key: already know it\n");
-          TALER_denom_pub_free (&dk.key);
-          continue;
-        }
-
-        if (key_data->denom_keys_size == key_data->num_denom_keys)
-          GNUNET_array_grow (key_data->denom_keys,
-                             key_data->denom_keys_size,
-                             key_data->denom_keys_size * 2 + 2);
-        key_data->denom_keys[key_data->num_denom_keys++] = dk;
-
-        /* Update "last_denom_issue_date" */
-        TALER_LOG_DEBUG ("Adding denomination key that is valid_until %s\n",
-                         GNUNET_TIME_timestamp2s (dk.valid_from));
-        key_data->last_denom_issue_date
-          = GNUNET_TIME_timestamp_max (key_data->last_denom_issue_date,
-                                       dk.valid_from);
-      };   /* end of json_array_foreach over denominations */
-
-      /* The calculated group_hash_xor must be the same as group.hash from
-         the JSON. */
-      EXITIF (0 !=
-              GNUNET_CRYPTO_hash_cmp (&group_hash_xor,
-                                      &group.hash));
-
-    } /* end of json_array_foreach over groups of denominations */
-  } /* end of scope for group_ojb/group_idx */
-
-  /* parse the auditor information */
-  {
-    json_t *auditor_info;
-    unsigned int index;
-
-    /* Merge with the existing auditor information we have (/keys cherry 
picking) */
-    json_array_foreach (auditors_array, index, auditor_info)
-    {
-      struct DONAU_AuditorInformation ai;
-      bool found = false;
-
-      memset (&ai,
-              0,
-              sizeof (ai));
-      EXITIF (GNUNET_SYSERR ==
-              parse_json_auditor (&ai,
-                                  check_sig,
-                                  auditor_info,
-                                  key_data));
-      for (unsigned int j = 0; j<key_data->num_auditors; j++)
-      {
-        struct DONAU_AuditorInformation *aix = &key_data->auditors[j];
-
-        if (0 == GNUNET_memcmp (&ai.auditor_pub,
-                                &aix->auditor_pub))
-        {
-          found = true;
-          /* Merge denomination key signatures of downloaded /keys into 
existing
-             auditor information 'aix'. */
-          TALER_LOG_DEBUG (
-            "Merging %u new audited keys with %u known audited keys\n",
-            aix->num_denom_keys,
-            ai.num_denom_keys);
-          for (unsigned int i = 0; i<ai.num_denom_keys; i++)
-          {
-            bool kfound = false;
-
-            for (unsigned int k = 0; k<aix->num_denom_keys; k++)
-            {
-              if (aix->denom_keys[k].denom_key_offset ==
-                  ai.denom_keys[i].denom_key_offset)
-              {
-                kfound = true;
-                break;
-              }
-            }
-            if (! kfound)
-              GNUNET_array_append (aix->denom_keys,
-                                   aix->num_denom_keys,
-                                   ai.denom_keys[i]);
-          }
-          break;
-        }
-      }
-      if (found)
-      {
-        GNUNET_array_grow (ai.denom_keys,
-                           ai.num_denom_keys,
-                           0);
-        GNUNET_free (ai.auditor_url);
-        continue; /* we are done */
-      }
-      if (key_data->auditors_size == key_data->num_auditors)
-        GNUNET_array_grow (key_data->auditors,
-                           key_data->auditors_size,
-                           key_data->auditors_size * 2 + 2);
-      GNUNET_assert (NULL != ai.auditor_url);
-      key_data->auditors[key_data->num_auditors++] = ai;
-    };
-  }
-
-  /* parse the revocation/recoup information */
-  if (NULL != recoup_array)
-  {
-    json_t *recoup_info;
-    unsigned int index;
-
-    json_array_foreach (recoup_array, index, recoup_info)
-    {
-      struct TALER_DenominationHashP h_denom_pub;
-      struct GNUNET_JSON_Specification spec[] = {
-        GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
-                                     &h_denom_pub),
-        GNUNET_JSON_spec_end ()
-      };
-
-      EXITIF (GNUNET_OK !=
-              GNUNET_JSON_parse (recoup_info,
-                                 spec,
-                                 NULL, NULL));
-      for (unsigned int j = 0;
-           j<key_data->num_denom_keys;
-           j++)
-      {
-        if (0 == GNUNET_memcmp (&h_denom_pub,
-                                &key_data->denom_keys[j].h_key))
-        {
-          key_data->denom_keys[j].revoked = true;
-          break;
-        }
-      }
-    }
-  }
-
-  if (check_sig)
-  {
-    EXITIF (GNUNET_OK !=
-            DONAU_test_signing_key (key_data,
-                                    &pub));
-    EXITIF (GNUNET_OK !=
-            TALER_donau_online_key_set_verify (
-              key_data->list_issue_date,
-              &hash_xor,
-              &pub,
-              &denominations_sig));
-  }
-  return GNUNET_OK;
-
-EXITIF_exit:
-  *vc = DONAU_VC_PROTOCOL_ERROR;
-  return GNUNET_SYSERR;
-}
-
-
-/**
- * Callback used when downloading the reply to a /keys request
- * is complete.
- *
- * @param cls the `struct KeysRequest`
- * @param response_code HTTP response code, 0 on error
- * @param resp_obj parsed JSON result, NULL on error
- */
-static void
-keys_completed_cb (void *cls,
-                   long response_code,
-                   const void *resp_obj)
-{
-  struct DONAU_GetKeysHandle *gkh = cls;
-  const json_t *j = resp_obj;
-  struct DONAU_Keys *kd = NULL;
-  struct DONAU_KeysResponse kresp = {
-    .hr.reply = j,
-    .hr.http_status = (unsigned int) response_code,
-    .details.ok.compat = DONAU_VC_PROTOCOL_ERROR,
-  };
-
-  gkh->job = NULL;
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Received keys from URL `%s' with status %ld and expiration 
%s.\n",
-              gkh->url,
-              response_code,
-              GNUNET_TIME_timestamp2s (gkh->expire));
-  if (GNUNET_TIME_absolute_is_past (gkh->expire.abs_time))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Donau failed to give expiration time, assuming in %s\n",
-                GNUNET_TIME_relative2s (DEFAULT_EXPIRATION,
-                                        true));
-    gkh->expire
-      = GNUNET_TIME_absolute_to_timestamp (
-          GNUNET_TIME_relative_to_absolute (DEFAULT_EXPIRATION));
-  }
-  switch (response_code)
-  {
-  case 0:
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Failed to receive /keys response from donau %s\n",
-                gkh->donau_url);
-    break;
-  case MHD_HTTP_OK:
-    if (NULL == j)
-    {
-      GNUNET_break (0);
-      response_code = 0;
-      break;
-    }
-    kd = GNUNET_new (struct DONAU_Keys);
-    kd->donau_url = GNUNET_strdup (gkh->donau_url);
-    if (NULL != gkh->prev_keys)
-    {
-      const struct DONAU_Keys *kd_old = gkh->prev_keys;
-
-      /* We keep the denomination keys and auditor signatures from the
-         previous iteration (/keys cherry picking) */
-      kd->num_denom_keys
-        = kd_old->num_denom_keys;
-      kd->last_denom_issue_date
-        = kd_old->last_denom_issue_date;
-      GNUNET_array_grow (kd->denom_keys,
-                         kd->denom_keys_size,
-                         kd->num_denom_keys);
-      /* First make a shallow copy, we then need another pass for the RSA 
key... */
-      GNUNET_memcpy (kd->denom_keys,
-                     kd_old->denom_keys,
-                     kd_old->num_denom_keys
-                     * sizeof (struct DONAU_DenomPublicKey));
-      for (unsigned int i = 0; i<kd_old->num_denom_keys; i++)
-        TALER_denom_pub_deep_copy (&kd->denom_keys[i].key,
-                                   &kd_old->denom_keys[i].key);
-      kd->num_auditors = kd_old->num_auditors;
-      kd->auditors = GNUNET_new_array (kd->num_auditors,
-                                       struct DONAU_AuditorInformation);
-      /* Now the necessary deep copy... */
-      for (unsigned int i = 0; i<kd_old->num_auditors; i++)
-      {
-        const struct DONAU_AuditorInformation *aold =
-          &kd_old->auditors[i];
-        struct DONAU_AuditorInformation *anew = &kd->auditors[i];
-
-        anew->auditor_pub = aold->auditor_pub;
-        anew->auditor_url = GNUNET_strdup (aold->auditor_url);
-        GNUNET_array_grow (anew->denom_keys,
-                           anew->num_denom_keys,
-                           aold->num_denom_keys);
-        GNUNET_memcpy (
-          anew->denom_keys,
-          aold->denom_keys,
-          aold->num_denom_keys
-          * sizeof (struct DONAU_AuditorDenominationInfo));
-      }
-    }
-    /* Now decode fresh /keys response */
-    if (GNUNET_OK !=
-        decode_keys_json (j,
-                          true,
-                          kd,
-                          &kresp.details.ok.compat))
-    {
-      TALER_LOG_ERROR ("Could not decode /keys response\n");
-      kd->rc = 1;
-      DONAU_keys_decref (kd);
-      kd = NULL;
-      kresp.hr.http_status = 0;
-      kresp.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-      break;
-    }
-    kd->rc = 1;
-    kd->key_data_expiration = gkh->expire;
-    if (GNUNET_TIME_relative_cmp (
-          GNUNET_TIME_absolute_get_remaining (gkh->expire.abs_time),
-          <,
-          MINIMUM_EXPIRATION))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "Donau returned keys with expiration time below %s. 
Compensating.\n",
-                  GNUNET_TIME_relative2s (MINIMUM_EXPIRATION,
-                                          true));
-      kd->key_data_expiration
-        = GNUNET_TIME_relative_to_timestamp (MINIMUM_EXPIRATION);
-    }
-
-    kresp.details.ok.keys = kd;
-    break;
-  case MHD_HTTP_BAD_REQUEST:
-  case MHD_HTTP_UNAUTHORIZED:
-  case MHD_HTTP_FORBIDDEN:
-  case MHD_HTTP_NOT_FOUND:
-    if (NULL == j)
-    {
-      kresp.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
-      kresp.hr.hint = TALER_ErrorCode_get_hint (kresp.hr.ec);
-    }
-    else
-    {
-      kresp.hr.ec = TALER_JSON_get_error_code (j);
-      kresp.hr.hint = TALER_JSON_get_error_hint (j);
-    }
-    break;
-  default:
-    if (NULL == j)
-    {
-      kresp.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
-      kresp.hr.hint = TALER_ErrorCode_get_hint (kresp.hr.ec);
-    }
-    else
-    {
-      kresp.hr.ec = TALER_JSON_get_error_code (j);
-      kresp.hr.hint = TALER_JSON_get_error_hint (j);
-    }
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected response code %u/%d\n",
-                (unsigned int) response_code,
-                (int) kresp.hr.ec);
-    break;
-  }
-  gkh->cert_cb (gkh->cert_cb_cls,
-                &kresp,
-                kd);
-  DONAU_get_keys_cancel (gkh);
-}
-
-
-/**
- * Define a max length for the HTTP "Expire:" header
- */
-#define MAX_DATE_LINE_LEN 32
-
-
-/**
- * Parse HTTP timestamp.
- *
- * @param dateline header to parse header
- * @param[out] at where to write the result
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-parse_date_string (const char *dateline,
-                   struct GNUNET_TIME_Timestamp *at)
-{
-  static const char *MONTHS[] =
-  { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL };
-  int year;
-  int mon;
-  int day;
-  int hour;
-  int min;
-  int sec;
-  char month[4];
-  struct tm tm;
-  time_t t;
-
-  /* We recognize the three formats in RFC2616, section 3.3.1.  Month
-     names are always in English.  The formats are:
-      Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
-      Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
-      Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
-     Note that the first is preferred.
-   */
-
-  if (strlen (dateline) > MAX_DATE_LINE_LEN)
-  {
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
-  while (*dateline == ' ')
-    ++dateline;
-  while (*dateline && *dateline != ' ')
-    ++dateline;
-  while (*dateline == ' ')
-    ++dateline;
-  /* We just skipped over the day of the week. Now we have:*/
-  if ( (sscanf (dateline,
-                "%d %3s %d %d:%d:%d",
-                &day, month, &year, &hour, &min, &sec) != 6) &&
-       (sscanf (dateline,
-                "%d-%3s-%d %d:%d:%d",
-                &day, month, &year, &hour, &min, &sec) != 6) &&
-       (sscanf (dateline,
-                "%3s %d %d:%d:%d %d",
-                month, &day, &hour, &min, &sec, &year) != 6) )
-  {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  /* Two digit dates are defined to be relative to 1900; all other dates
-   * are supposed to be represented as four digits. */
-  if (year < 100)
-    year += 1900;
-
-  for (mon = 0; ; mon++)
-  {
-    if (! MONTHS[mon])
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    if (0 == strcasecmp (month,
-                         MONTHS[mon]))
-      break;
-  }
-
-  memset (&tm, 0, sizeof(tm));
-  tm.tm_year = year - 1900;
-  tm.tm_mon = mon;
-  tm.tm_mday = day;
-  tm.tm_hour = hour;
-  tm.tm_min = min;
-  tm.tm_sec = sec;
-
-  t = mktime (&tm);
-  if (((time_t) -1) == t)
-  {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
-                         "mktime");
-    return GNUNET_SYSERR;
-  }
-  if (t < 0)
-    t = 0; /* can happen due to timezone issues if date was 1.1.1970 */
-  *at = GNUNET_TIME_timestamp_from_s (t);
-  return GNUNET_OK;
-}
-
-
-/**
- * Function called for each header in the HTTP /keys response.
- * Finds the "Expire:" header and parses it, storing the result
- * in the "expire" field of the keys request.
- *
- * @param buffer header data received
- * @param size size of an item in @a buffer
- * @param nitems number of items in @a buffer
- * @param userdata the `struct DONAU_GetKeysHandle`
- * @return `size * nitems` on success (everything else aborts)
- */
-static size_t
-header_cb (char *buffer,
-           size_t size,
-           size_t nitems,
-           void *userdata)
-{
-  struct DONAU_GetKeysHandle *kr = userdata;
-  size_t total = size * nitems;
-  char *val;
-
-  if (total < strlen (MHD_HTTP_HEADER_EXPIRES ": "))
-    return total;
-  if (0 != strncasecmp (MHD_HTTP_HEADER_EXPIRES ": ",
-                        buffer,
-                        strlen (MHD_HTTP_HEADER_EXPIRES ": ")))
-    return total;
-  val = GNUNET_strndup (&buffer[strlen (MHD_HTTP_HEADER_EXPIRES ": ")],
-                        total - strlen (MHD_HTTP_HEADER_EXPIRES ": "));
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Found %s header `%s'\n",
-              MHD_HTTP_HEADER_EXPIRES,
-              val);
-  if (GNUNET_OK !=
-      parse_date_string (val,
-                         &kr->expire))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Failed to parse %s-header `%s'\n",
-                MHD_HTTP_HEADER_EXPIRES,
-                val);
-    kr->expire = GNUNET_TIME_UNIT_ZERO_TS;
-  }
-  GNUNET_free (val);
-  return total;
-}
-
-
-struct DONAU_GetKeysHandle *
-DONAU_get_keys (
-  struct GNUNET_CURL_Context *ctx,
-  const char *url,
-  struct DONAU_Keys *last_keys,
-  DONAU_GetKeysCallback cert_cb,
-  void *cert_cb_cls)
-{
-  struct DONAU_GetKeysHandle *gkh;
-  CURL *eh;
-
-  TALER_LOG_DEBUG ("Connecting to the donau (%s)\n",
-                   url);
-  gkh = GNUNET_new (struct DONAU_GetKeysHandle);
-  gkh->donau_url = GNUNET_strdup (url);
-  gkh->cert_cb = cert_cb;
-  gkh->cert_cb_cls = cert_cb_cls;
-  gkh->url = TALER_url_join (url,
-                             "keys");
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Requesting keys with URL `%s'.\n",
-              gkh->url);
-  eh = DONAU_curl_easy_get_ (gkh->url);
-  if (NULL == eh)
-  {
-    GNUNET_break (0);
-    GNUNET_free (gkh->donau_url);
-    GNUNET_free (gkh->url);
-    GNUNET_free (gkh);
-    return NULL;
-  }
-  GNUNET_break (CURLE_OK ==
-                curl_easy_setopt (eh,
-                                  CURLOPT_VERBOSE,
-                                  0));
-  GNUNET_break (CURLE_OK ==
-                curl_easy_setopt (eh,
-                                  CURLOPT_TIMEOUT,
-                                  120 /* seconds */));
-  GNUNET_assert (CURLE_OK ==
-                 curl_easy_setopt (eh,
-                                   CURLOPT_HEADERFUNCTION,
-                                   &header_cb));
-  GNUNET_assert (CURLE_OK ==
-                 curl_easy_setopt (eh,
-                                   CURLOPT_HEADERDATA,
-                                   gkh));
-  gkh->job = GNUNET_CURL_job_add_with_ct_json (ctx,
-                                               eh,
-                                               &keys_completed_cb,
-                                               gkh);
-  return gkh;
-}
-
-
-void
-DONAU_get_keys_cancel (
-  struct DONAU_GetKeysHandle *gkh)
-{
-  if (NULL != gkh->job)
-  {
-    GNUNET_CURL_job_cancel (gkh->job);
-    gkh->job = NULL;
-  }
-  DONAU_keys_decref (gkh->prev_keys);
-  GNUNET_free (gkh->donau_url);
-  GNUNET_free (gkh->url);
-  GNUNET_free (gkh);
-}
-
-
-enum GNUNET_GenericReturnValue
-DONAU_test_signing_key (
-  const struct DONAU_Keys *keys,
-  const struct DONAU_DonauPublicKeyP *pub)
-{
-  struct GNUNET_TIME_Absolute now;
-
-  /* we will check using a tolerance of 1h for the time */
-  now = GNUNET_TIME_absolute_get ();
-  for (unsigned int i = 0; i<keys->num_sign_keys; i++)
-    if ( (GNUNET_TIME_absolute_cmp (
-            keys->sign_keys[i].valid_from.abs_time,
-            <=,
-            GNUNET_TIME_absolute_add (now,
-                                      LIFETIME_TOLERANCE))) &&
-         (GNUNET_TIME_absolute_cmp (
-            keys->sign_keys[i].valid_until.abs_time,
-            >,
-            GNUNET_TIME_absolute_subtract (now,
-                                           LIFETIME_TOLERANCE))) &&
-         (0 == GNUNET_memcmp (pub,
-                              &keys->sign_keys[i].key)) )
-      return GNUNET_OK;
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "Signing key not valid at time %s\n",
-              GNUNET_TIME_absolute2s (now));
-  return GNUNET_SYSERR;
-}
-
-
-const struct DONAU_DenomPublicKey *
-DONAU_get_denomination_key (
-  const struct DONAU_Keys *keys,
-  const struct TALER_DenominationPublicKey *pk)
-{
-  for (unsigned int i = 0; i<keys->num_denom_keys; i++)
-    if (0 ==
-        TALER_denom_pub_cmp (pk,
-                             &keys->denom_keys[i].key))
-      return &keys->denom_keys[i];
-  return NULL;
-}
-
-
-struct DONAU_DenomPublicKey *
-DONAU_copy_denomination_key (
-  const struct DONAU_DenomPublicKey *key)
-{
-  struct DONAU_DenomPublicKey *copy;
-
-  copy = GNUNET_new (struct DONAU_DenomPublicKey);
-  *copy = *key;
-  TALER_denom_pub_deep_copy (&copy->key,
-                             &key->key);
-  return copy;
-}
-
-
-void
-DONAU_destroy_denomination_key (
-  struct DONAU_DenomPublicKey *key)
-{
-  TALER_denom_pub_free (&key->key);
-  GNUNET_free (key);
-}
-
-
-const struct DONAU_DenomPublicKey *
-DONAU_get_denomination_key_by_hash (
-  const struct DONAU_Keys *keys,
-  const struct TALER_DenominationHashP *hc)
-{
-  for (unsigned int i = 0; i<keys->num_denom_keys; i++)
-    if (0 == GNUNET_memcmp (hc,
-                            &keys->denom_keys[i].h_key))
-      return &keys->denom_keys[i];
-  return NULL;
-}
-
-
-struct DONAU_Keys *
-DONAU_keys_incref (struct DONAU_Keys *keys)
-{
-  GNUNET_assert (keys->rc < UINT_MAX);
-  keys->rc++;
-  return keys;
-}
-
-
-void
-DONAU_keys_decref (struct DONAU_Keys *keys)
-{
-  if (NULL == keys)
-    return;
-  GNUNET_assert (0 < keys->rc);
-  keys->rc--;
-  if (0 != keys->rc)
-    return;
-  GNUNET_array_grow (keys->sign_keys,
-                     keys->num_sign_keys,
-                     0);
-  for (unsigned int i = 0; i<keys->num_denom_keys; i++)
-    TALER_denom_pub_free (&keys->denom_keys[i].key);
-
-  GNUNET_array_grow (keys->denom_keys,
-                     keys->denom_keys_size,
-                     0);
-  for (unsigned int i = 0; i<keys->num_auditors; i++)
-  {
-    GNUNET_array_grow (keys->auditors[i].denom_keys,
-                       keys->auditors[i].num_denom_keys,
-                       0);
-    GNUNET_free (keys->auditors[i].auditor_url);
-  }
-  GNUNET_array_grow (keys->auditors,
-                     keys->auditors_size,
-                     0);
-  DONAU_free_accounts (keys->accounts_len,
-                       keys->accounts);
-  GNUNET_array_grow (keys->accounts,
-                     keys->accounts_len,
-                     0);
-  free_fees (keys->fees,
-             keys->fees_len);
-  json_decref (keys->extensions);
-  GNUNET_free (keys->wallet_balance_limit_without_kyc);
-  GNUNET_free (keys->version);
-  GNUNET_free (keys->currency);
-  GNUNET_free (keys->asset_type);
-  GNUNET_free (keys->global_fees);
-  GNUNET_free (keys->donau_url);
-  GNUNET_free (keys);
-}
-
-
-struct DONAU_Keys *
-DONAU_keys_from_json (const json_t *j)
-{
-  const json_t *jkeys;
-  const char *url;
-  uint32_t version;
-  struct GNUNET_TIME_Timestamp expire
-    = GNUNET_TIME_UNIT_ZERO_TS;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_uint32 ("version",
-                             &version),
-    GNUNET_JSON_spec_object_const ("keys",
-                                   &jkeys),
-    GNUNET_JSON_spec_string ("donau_url",
-                             &url),
-    GNUNET_JSON_spec_mark_optional (
-      GNUNET_JSON_spec_timestamp ("expire",
-                                  &expire),
-      NULL),
-    GNUNET_JSON_spec_end ()
-  };
-  struct DONAU_Keys *keys;
-  enum DONAU_VersionCompatibility compat;
-
-  if (NULL == j)
-    return NULL;
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (j,
-                         spec,
-                         NULL, NULL))
-  {
-    GNUNET_break_op (0);
-    return NULL;
-  }
-  if (0 != version)
-  {
-    return NULL; /* unsupported version */
-  }
-  keys = GNUNET_new (struct DONAU_Keys);
-  if (GNUNET_OK !=
-      decode_keys_json (jkeys,
-                        false,
-                        keys,
-                        &compat))
-  {
-    GNUNET_break (0);
-    return NULL;
-  }
-  keys->rc = 1;
-  keys->key_data_expiration = expire;
-  keys->donau_url = GNUNET_strdup (url);
-  return keys;
-}
-
-
-/**
- * Data we track per donation unit group.
- */
-struct GroupData
-{
-  /**
-   * The json blob with the group meta-data and list of donation units
-   */
-  json_t *json;
-
-  /**
-   * Meta data for this group.
-   */
-  struct DONAU_DonationUnitGroup meta;
-};
-
-
-/**
- * Add donation unit group represented by @a value
- * to list of donation units in @a cls. Also frees
- * the @a value.
- *
- * @param[in,out] cls a `json_t *` with an array to build
- * @param key unused
- * @param value a `struct GroupData *`
- * @return #GNUNET_OK (continue to iterate)
- */
-static enum GNUNET_GenericReturnValue
-add_grp (void *cls,
-         const struct GNUNET_HashCode *key,
-         void *value)
-{
-  json_t *donation_units_by_group = cls;
-  struct GroupData *gd = value;
-  const char *cipher;
-  json_t *ge;
-
-  (void) key;
-  switch (gd->meta.cipher)
-  {
-  case GNUNET_CRYPTO_BSA_RSA:
-    cipher = age_restricted ? "RSA+age_restricted" : "RSA";
-    break;
-  case GNUNET_CRYPTO_BSA_CS:
-    cipher = age_restricted ? "CS+age_restricted" : "CS";
-    break;
-  default:
-    GNUNET_assert (false);
-  }
-
-  ge = GNUNET_JSON_PACK (
-    GNUNET_JSON_pack_data_auto ("hash",
-                                &gd->meta.hash),
-    GNUNET_JSON_pack_string ("cipher",
-                             cipher),
-    GNUNET_JSON_pack_array_steal ("denoms",
-                                  gd->json),
-    TALER_JSON_pack_amount ("value",
-                            &gd->meta.value));
-  GNUNET_assert (0 ==
-                 json_array_append_new (donation_units_by_group,
-                                        ge));
-  GNUNET_free (gd);
-  return GNUNET_OK;
-}
-
-
-/**
- * Convert array of account restrictions @a ars to JSON.
- *
- * @param ar_len length of @a ars
- * @param ars account restrictions to convert
- * @return JSON representation
- */
-static json_t *
-ar_to_json (unsigned int ar_len,
-            const struct TALER_DONAU_AccountRestriction ars[static ar_len])
-{
-  json_t *rval;
-
-  rval = json_array ();
-  GNUNET_assert (NULL != rval);
-  for (unsigned int i = 0; i<ar_len; i++)
-  {
-    const struct TALER_DONAU_AccountRestriction *ar = &ars[i];
-
-    switch (ar->type)
-    {
-    case TALER_DONAU_AR_INVALID:
-      GNUNET_break (0);
-      json_decref (rval);
-      return NULL;
-    case TALER_DONAU_AR_DENY:
-      GNUNET_assert (
-        0 ==
-        json_array_append_new (
-          rval,
-          GNUNET_JSON_PACK (
-            GNUNET_JSON_pack_string ("type",
-                                     "deny"))));
-      break;
-    case TALER_DONAU_AR_REGEX:
-      GNUNET_assert (
-        0 ==
-        json_array_append_new (
-          rval,
-          GNUNET_JSON_PACK (
-            GNUNET_JSON_pack_string (
-              "type",
-              "regex"),
-            GNUNET_JSON_pack_string (
-              "regex",
-              ar->details.regex.posix_egrep),
-            GNUNET_JSON_pack_string (
-              "human_hint",
-              ar->details.regex.human_hint),
-            GNUNET_JSON_pack_object_incref (
-              "human_hint_i18n",
-              (json_t *) ar->details.regex.human_hint_i18n)
-            )));
-      break;
-    }
-  }
-  return rval;
-}
-
-
-json_t *
-DONAU_keys_to_json (const struct DONAU_Keys *kd)
-{
-  json_t *keys;
-  json_t *signkeys;
-  json_t *donation_units;
-  json_t *accounts;
-
-  now = GNUNET_TIME_timestamp_get ();
-  signkeys = json_array ();
-  GNUNET_assert (NULL != signkeys);
-  for (unsigned int i = 0; i<kd->num_sign_keys; i++)
-  {
-    const struct TALER_DONAU_SigningPublicKey *sk = &kd->sign_keys[i];
-    json_t *signkey;
-
-    signkey = GNUNET_JSON_PACK (
-      GNUNET_JSON_pack_data_auto ("key",
-                                  &sk->key),
-      GNUNET_JSON_pack_uint64 ("year",
-                                  &sk->year));
-    GNUNET_assert (NULL != signkey);
-    GNUNET_assert (0 ==
-                   json_array_append_new (signkeys,
-                                          signkey));
-  }
-
-  donation_units_by_group = json_array ();
-  GNUNET_assert (NULL != donation_units_by_group);
-  {
-    struct GNUNET_CONTAINER_MultiHashMap *dbg;
-
-    dbg = GNUNET_CONTAINER_multihashmap_create (128,
-                                                false);
-    for (unsigned int i = 0; i<kd->num_donation_unit_keys; i++)
-    {
-      const struct TALER_DONAU_DenomPublicKey *dk = &kd->denom_keys[i];
-      struct TALER_DenominationGroup meta = {
-        .cipher = dk->key.cipher,
-        .value = dk->value,
-        .year = dk->year
-      };
-      struct GNUNET_HashCode key;
-      struct GroupData *gd;
-      json_t *donation_unit;
-      struct GNUNET_JSON_PackSpec key_spec;
-
-      //TODO: check year
-
-      TALER_donation_unit_group_get_key (&meta,
-                                        &key);
-      gd = GNUNET_CONTAINER_multihashmap_get (dbg,
-                                              &key);
-      if (NULL == gd)
-      {
-        gd = GNUNET_new (struct GroupData);
-        gd->meta = meta;
-        gd->json = json_array ();
-        GNUNET_assert (NULL != gd->json);
-        GNUNET_assert (
-          GNUNET_OK ==
-          GNUNET_CONTAINER_multihashmap_put (dbg,
-                                             &key,
-                                             gd,
-                                             
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
-
-      }
-
-      switch (meta.cipher)
-      {
-      case GNUNET_CRYPTO_BSA_RSA:
-        key_spec =
-          GNUNET_JSON_pack_rsa_public_key (
-            "rsa_pub",
-            dk->key.bsign_pub_key->details.rsa_public_key);
-        break;
-      case GNUNET_CRYPTO_BSA_CS:
-        key_spec =
-          GNUNET_JSON_pack_data_varsize (
-            "cs_pub",
-            &dk->key.bsign_pub_key->details.cs_public_key,
-            sizeof (dk->key.bsign_pub_key->details.cs_public_key));
-        break;
-      default:
-        GNUNET_assert (false);
-      }
-      donation_unit = GNUNET_JSON_PACK (
-        GNUNET_JSON_pack_timestamp ("stamp_expire_deposit",
-                                    dk->expire_deposit),
-        GNUNET_JSON_pack_timestamp ("stamp_expire_withdraw",
-                                    dk->withdraw_valid_until),
-        GNUNET_JSON_pack_timestamp ("stamp_start",
-                                    dk->valid_from),
-        GNUNET_JSON_pack_timestamp ("stamp_expire_legal",
-                                    dk->expire_legal),
-        GNUNET_JSON_pack_data_auto ("master_sig",
-                                    &dk->master_sig),
-        key_spec
-        );
-      GNUNET_assert (0 ==
-                     json_array_append_new (gd->json,
-                                            donation_unit));
-    }
-    GNUNET_CONTAINER_multihashmap_iterate (dbg,
-                                           &add_grp,
-                                           donation_unit_by_group);
-    GNUNET_CONTAINER_multihashmap_destroy (dbg);
-  }
-
-  auditors = json_array ();
-  GNUNET_assert (NULL != auditors);
-  for (unsigned int i = 0; i<kd->num_auditors; i++)
-  {
-    const struct TALER_DONAU_AuditorInformation *ai = &kd->auditors[i];
-    json_t *a;
-    json_t *adenoms;
-
-    adenoms = json_array ();
-    GNUNET_assert (NULL != adenoms);
-    for (unsigned int j = 0; j<ai->num_denom_keys; j++)
-    {
-      const struct TALER_DONAU_AuditorDenominationInfo *adi =
-        &ai->denom_keys[j];
-      const struct TALER_DONAU_DenomPublicKey *dk =
-        &kd->denom_keys[adi->denom_key_offset];
-      json_t *k;
-
-      GNUNET_assert (adi->denom_key_offset < kd->num_denom_keys);
-      if (GNUNET_TIME_timestamp_cmp (now,
-                                     >,
-                                     dk->expire_deposit))
-        continue; /* skip auditor signatures for denomination keys that have 
expired */
-      GNUNET_assert (adi->denom_key_offset < kd->num_denom_keys);
-      k = GNUNET_JSON_PACK (
-        GNUNET_JSON_pack_data_auto ("denom_pub_h",
-                                    &dk->h_key),
-        GNUNET_JSON_pack_data_auto ("auditor_sig",
-                                    &adi->auditor_sig));
-      GNUNET_assert (0 ==
-                     json_array_append_new (adenoms,
-                                            k));
-    }
-
-    a = GNUNET_JSON_PACK (
-      GNUNET_JSON_pack_data_auto ("auditor_pub",
-                                  &ai->auditor_pub),
-      GNUNET_JSON_pack_string ("auditor_url",
-                               ai->auditor_url),
-      GNUNET_JSON_pack_array_steal ("denomination_keys",
-                                    adenoms));
-    GNUNET_assert (0 ==
-                   json_array_append_new (auditors,
-                                          a));
-  }
-
-  global_fees = json_array ();
-  GNUNET_assert (NULL != global_fees);
-  for (unsigned int i = 0; i<kd->num_global_fees; i++)
-  {
-    const struct TALER_DONAU_GlobalFee *gf
-      = &kd->global_fees[i];
-
-    if (GNUNET_TIME_absolute_is_past (gf->end_date.abs_time))
-      continue;
-    GNUNET_assert (
-      0 ==
-      json_array_append_new (
-        global_fees,
-        GNUNET_JSON_PACK (
-          GNUNET_JSON_pack_timestamp ("start_date",
-                                      gf->start_date),
-          GNUNET_JSON_pack_timestamp ("end_date",
-                                      gf->end_date),
-          TALER_JSON_PACK_GLOBAL_FEES (&gf->fees),
-          GNUNET_JSON_pack_time_rel ("history_expiration",
-                                     gf->history_expiration),
-          GNUNET_JSON_pack_time_rel ("purse_timeout",
-                                     gf->purse_timeout),
-          GNUNET_JSON_pack_uint64 ("purse_account_limit",
-                                   gf->purse_account_limit),
-          GNUNET_JSON_pack_data_auto ("master_sig",
-                                      &gf->master_sig))));
-  }
-
-  accounts = json_array ();
-  GNUNET_assert (NULL != accounts);
-  for (unsigned int i = 0; i<kd->accounts_len; i++)
-  {
-    const struct TALER_DONAU_WireAccount *acc
-      = &kd->accounts[i];
-    json_t *credit_restrictions;
-    json_t *debit_restrictions;
-
-    credit_restrictions
-      = ar_to_json (acc->credit_restrictions_length,
-                    acc->credit_restrictions);
-    GNUNET_assert (NULL != credit_restrictions);
-    debit_restrictions
-      = ar_to_json (acc->debit_restrictions_length,
-                    acc->debit_restrictions);
-    GNUNET_assert (NULL != debit_restrictions);
-    GNUNET_assert (
-      0 ==
-      json_array_append_new (
-        accounts,
-        GNUNET_JSON_PACK (
-          GNUNET_JSON_pack_string ("payto_uri",
-                                   acc->payto_uri),
-          GNUNET_JSON_pack_allow_null (
-            GNUNET_JSON_pack_string ("conversion_url",
-                                     acc->conversion_url)),
-          GNUNET_JSON_pack_array_steal ("debit_restrictions",
-                                        debit_restrictions),
-          GNUNET_JSON_pack_array_steal ("credit_restrictions",
-                                        credit_restrictions),
-          GNUNET_JSON_pack_data_auto ("master_sig",
-                                      &acc->master_sig))));
-  }
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Serialized %u/%u wire accounts to JSON\n",
-              (unsigned int) json_array_size (accounts),
-              kd->accounts_len);
-
-  wire_fees = json_object ();
-  GNUNET_assert (NULL != wire_fees);
-  for (unsigned int i = 0; i<kd->fees_len; i++)
-  {
-    const struct TALER_DONAU_WireFeesByMethod *fbw
-      = &kd->fees[i];
-    json_t *wf;
-
-    wf = json_array ();
-    GNUNET_assert (NULL != wf);
-    for (struct TALER_DONAU_WireAggregateFees *p = fbw->fees_head;
-         NULL != p;
-         p = p->next)
-    {
-      GNUNET_assert (
-        0 ==
-        json_array_append_new (
-          wf,
-          GNUNET_JSON_PACK (
-            TALER_JSON_pack_amount ("wire_fee",
-                                    &p->fees.wire),
-            TALER_JSON_pack_amount ("closing_fee",
-                                    &p->fees.closing),
-            GNUNET_JSON_pack_timestamp ("start_date",
-                                        p->start_date),
-            GNUNET_JSON_pack_timestamp ("end_date",
-                                        p->end_date),
-            GNUNET_JSON_pack_data_auto ("sig",
-                                        &p->master_sig))));
-    }
-    GNUNET_assert (0 ==
-                   json_object_set_new (wire_fees,
-                                        fbw->method,
-                                        wf));
-  }
-
-  recoup = json_array ();
-  GNUNET_assert (NULL != recoup);
-  for (unsigned int i = 0; i<kd->num_denom_keys; i++)
-  {
-    const struct TALER_DONAU_DenomPublicKey *dk
-      = &kd->denom_keys[i];
-    if (! dk->revoked)
-      continue;
-    GNUNET_assert (0 ==
-                   json_array_append_new (
-                     recoup,
-                     GNUNET_JSON_PACK (
-                       GNUNET_JSON_pack_data_auto ("h_denom_pub",
-                                                   &dk->h_key))));
-  }
-
-  wblwk = json_array ();
-  GNUNET_assert (NULL != wblwk);
-  for (unsigned int i = 0; i<kd->wblwk_length; i++)
-  {
-    const struct TALER_Amount *a = &kd->wallet_balance_limit_without_kyc[i];
-
-    GNUNET_assert (0 ==
-                   json_array_append_new (
-                     wblwk,
-                     TALER_JSON_from_amount (a)));
-  }
-
-  keys = GNUNET_JSON_PACK (
-    GNUNET_JSON_pack_string ("version",
-                             kd->version),
-    GNUNET_JSON_pack_string ("currency",
-                             kd->currency),
-    GNUNET_JSON_pack_uint64 ("currency_fraction_digits",
-                             kd->currency_fraction_digits),
-    GNUNET_JSON_pack_array_steal ("signkeys",
-                                  signkeys),
-    GNUNET_JSON_pack_array_steal ("donation_units",
-                                  donation_units_by_group)
-    );
-  return GNUNET_JSON_PACK (
-    GNUNET_JSON_pack_uint64 ("version",
-                             DONAU_SERIALIZATION_FORMAT_VERSION),
-    GNUNET_JSON_pack_string ("donau_url",
-                             kd->donau_url),
-    GNUNET_JSON_pack_object_steal ("keys",
-                                   keys));
-}
-
-
-/* end of donau_api_handle.c */
diff --git a/src/lib/donau_api_submit_receipts_get.c 
b/src/lib/donau_api_submit_receipts_get.c
index adc9f45..3bd5f55 100644
--- a/src/lib/donau_api_submit_receipts_get.c
+++ b/src/lib/donau_api_submit_receipts_get.c
@@ -88,171 +88,6 @@ struct DONAU_DepositGetHandle
 };
 
 
-/**
- * Function called when we're done processing the
- * HTTP /track/transaction request.
- *
- * @param cls the `struct DONAU_DepositGetHandle`
- * @param response_code HTTP response code, 0 on error
- * @param response parsed JSON result, NULL on error
- */
-static void
-handle_deposit_wtid_finished (void *cls,
-                              long response_code,
-                              const void *response)
-{
-  struct DONAU_DepositGetHandle *dwh = cls;
-  const json_t *j = response;
-  struct DONAU_GetDepositResponse dr = {
-    .hr.reply = j,
-    .hr.http_status = (unsigned int) response_code
-  };
-
-  dwh->job = NULL;
-  switch (response_code)
-  {
-  case 0:
-    dr.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
-    break;
-  case MHD_HTTP_OK:
-    {
-      struct GNUNET_JSON_Specification spec[] = {
-        GNUNET_JSON_spec_fixed_auto ("wtid",
-                                     &dr.details.ok.wtid),
-        GNUNET_JSON_spec_timestamp ("execution_time",
-                                    &dr.details.ok.execution_time),
-        TALER_JSON_spec_amount_any ("coin_contribution",
-                                    &dr.details.ok.coin_contribution),
-        GNUNET_JSON_spec_fixed_auto ("donau_sig",
-                                     &dr.details.ok.donau_sig),
-        GNUNET_JSON_spec_fixed_auto ("donau_pub",
-                                     &dr.details.ok.donau_pub),
-        GNUNET_JSON_spec_end ()
-      };
-      const struct DONAU_Keys *key_state;
-
-      key_state = dwh->keys;
-      GNUNET_assert (NULL != key_state);
-      if (GNUNET_OK !=
-          GNUNET_JSON_parse (j,
-                             spec,
-                             NULL, NULL))
-      {
-        GNUNET_break_op (0);
-        dr.hr.http_status = 0;
-        dr.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-        break;
-      }
-      if (GNUNET_OK !=
-          DONAU_test_signing_key (key_state,
-                                  &dr.details.ok.donau_pub))
-      {
-        GNUNET_break_op (0);
-        dr.hr.http_status = 0;
-        dr.hr.ec = TALER_EC_DONAU_DEPOSITS_GET_INVALID_SIGNATURE_BY_DONAU;
-        break;
-      }
-      if (GNUNET_OK !=
-          TALER_donau_online_confirm_wire_verify (
-            &dwh->h_wire,
-            &dwh->h_contract_terms,
-            &dr.details.ok.wtid,
-            &dwh->coin_pub,
-            dr.details.ok.execution_time,
-            &dr.details.ok.coin_contribution,
-            &dr.details.ok.donau_pub,
-            &dr.details.ok.donau_sig))
-      {
-        GNUNET_break_op (0);
-        dr.hr.http_status = 0;
-        dr.hr.ec = TALER_EC_DONAU_DEPOSITS_GET_INVALID_SIGNATURE_BY_DONAU;
-        break;
-      }
-      dwh->cb (dwh->cb_cls,
-               &dr);
-      DONAU_deposits_get_cancel (dwh);
-      return;
-    }
-  case MHD_HTTP_ACCEPTED:
-    {
-      /* Transaction known, but not executed yet */
-      bool no_legi = false;
-      uint32_t state32;
-      struct GNUNET_JSON_Specification spec[] = {
-        GNUNET_JSON_spec_timestamp ("execution_time",
-                                    &dr.details.accepted.execution_time),
-        GNUNET_JSON_spec_mark_optional (
-          GNUNET_JSON_spec_uint64 ("requirement_row",
-                                   &dr.details.accepted.requirement_row),
-          &no_legi),
-        GNUNET_JSON_spec_uint32 ("aml_decision",
-                                 &state32),
-        GNUNET_JSON_spec_bool ("kyc_ok",
-                               &dr.details.accepted.kyc_ok),
-        GNUNET_JSON_spec_end ()
-      };
-
-      if (GNUNET_OK !=
-          GNUNET_JSON_parse (j,
-                             spec,
-                             NULL, NULL))
-      {
-        GNUNET_break_op (0);
-        dr.hr.http_status = 0;
-        dr.hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
-        break;
-      }
-      dr.details.accepted.aml_decision
-        = (enum TALER_AmlDecisionState) state32;
-      if (no_legi)
-        dr.details.accepted.requirement_row = 0;
-      dwh->cb (dwh->cb_cls,
-               &dr);
-      DONAU_deposits_get_cancel (dwh);
-      return;
-    }
-  case MHD_HTTP_BAD_REQUEST:
-    dr.hr.ec = TALER_JSON_get_error_code (j);
-    dr.hr.hint = TALER_JSON_get_error_hint (j);
-    /* This should never happen, either us or the donau is buggy
-       (or API version conflict); just pass JSON reply to the application */
-    break;
-  case MHD_HTTP_FORBIDDEN:
-    dr.hr.ec = TALER_JSON_get_error_code (j);
-    dr.hr.hint = TALER_JSON_get_error_hint (j);
-    /* Nothing really to verify, donau says one of the signatures is
-       invalid; as we checked them, this should never happen, we
-       should pass the JSON reply to the application */
-    break;
-  case MHD_HTTP_NOT_FOUND:
-    dr.hr.ec = TALER_JSON_get_error_code (j);
-    dr.hr.hint = TALER_JSON_get_error_hint (j);
-    /* Donau does not know about transaction;
-       we should pass the reply to the application */
-    break;
-  case MHD_HTTP_INTERNAL_SERVER_ERROR:
-    dr.hr.ec = TALER_JSON_get_error_code (j);
-    dr.hr.hint = TALER_JSON_get_error_hint (j);
-    /* Server had an internal issue; we should retry, but this API
-       leaves this to the application */
-    break;
-  default:
-    /* unexpected response code */
-    dr.hr.ec = TALER_JSON_get_error_code (j);
-    dr.hr.hint = TALER_JSON_get_error_hint (j);
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected response code %u/%d for donau GET deposits\n",
-                (unsigned int) response_code,
-                (int) dr.hr.ec);
-    GNUNET_break_op (0);
-    break;
-  }
-  dwh->cb (dwh->cb_cls,
-           &dr);
-  DONAU_deposits_get_cancel (dwh);
-}
-
-
 struct DONAU_DepositGetHandle *
 DONAU_deposits_get (
   struct GNUNET_CURL_Context *ctx,
diff --git a/src/pq/pq_common.h b/src/pq/pq_common.h
index cb0cfbb..b8946e2 100644
--- a/src/pq/pq_common.h
+++ b/src/pq/pq_common.h
@@ -24,7 +24,7 @@
 #include "taler/taler_util.h"
 
 /**
- * Internal types that are supported as DONAU-exchange-specific array types.
+ * Internal types that are supported as DONAU-specific array types.
  *
  * To support a new type,
  *   1. add a new entry into this list,
diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index 1f4e6db..121ee15 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -270,7 +270,8 @@ qconv_array (
       {
       case DONAU_PQ_array_of_blinded_donation_id_kps:
         {
-          const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *budi_kps 
= data;
+          const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *budi_kps =
+            data;
           size_t len;
 
           buffers  = GNUNET_new_array (num, void *);
@@ -278,9 +279,10 @@ qconv_array (
 
           for (size_t i = 0; i<num; i++)
           {
-            const struct GNUNET_CRYPTO_BlindedMessage *bm = 
&budi_kps[i].blinded_udi;
+            const struct GNUNET_CRYPTO_BlindedMessage *bm = &budi_kps[i].
+                                                            blinded_udi;
 
-            switch (bm->cipher) //?
+            switch (bm->cipher) // ?
             {
             case GNUNET_CRYPTO_BSA_RSA:
               tlen = bm->details.rsa_blinded_message.blinded_msg_size;
@@ -341,8 +343,10 @@ qconv_array (
       {
       case DONAU_PQ_array_of_blinded_donation_id_kps:
         {
-          const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *budi_kps 
= data;
-          const struct GNUNET_CRYPTO_BlindedMessage *bm = 
&budi_kps[i].blinded_udi;
+          const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *budi_kps =
+            data;
+          const struct GNUNET_CRYPTO_BlindedMessage *bm = &budi_kps[i].
+                                                          blinded_udi;
           uint32_t be[2];
 
           be[0] = htonl ((uint32_t) bm->cipher);
@@ -399,4 +403,5 @@ DONE:
   return -1;
 }
 
+
 /* end of pq/pq_query_helper.c */
diff --git a/src/testing/donau-unified-setup.sh 
b/src/testing/donau-unified-setup.sh
index ab6d349..5a012dc 100755
--- a/src/testing/donau-unified-setup.sh
+++ b/src/testing/donau-unified-setup.sh
@@ -78,7 +78,7 @@ START_WIREWATCH=0
 USE_ACCOUNT="exchange-account-1"
 USE_VALGRIND=""
 WIRE_DOMAIN="x-taler-bank"
-CONF_ORIG="$HOME/.config/taler.conf"
+CONF_ORIG="$HOME/.config/donau.conf"
 LOGLEVEL="DEBUG"
 DEFAULT_SLEEP="0.2"
 
diff --git a/src/testing/test_donau_api.c b/src/testing/test_donau_api.c
index 439b1d2..2ef0788 100644
--- a/src/testing/test_donau_api.c
+++ b/src/testing/test_donau_api.c
@@ -62,39 +62,6 @@ static struct TALER_TESTING_Credentials cred;
  */
 static bool uses_cs;
 
-/**
- * Execute the taler-donau-wirewatch command with
- * our configuration file.
- *
- * @param label label to use for the command.
- */
-#define CMD_EXEC_WIREWATCH(label) \
-  TALER_TESTING_cmd_exec_wirewatch2 (label, config_file, "donau-account-2")
-
-/**
- * Execute the taler-donau-aggregator, closer and transfer commands with
- * our configuration file.
- *
- * @param label label to use for the command.
- */
-#define CMD_EXEC_AGGREGATOR(label) \
-  TALER_TESTING_cmd_sleep ("sleep-before-aggregator", 2), \
-  TALER_TESTING_cmd_exec_aggregator (label "-aggregator", config_file), \
-  TALER_TESTING_cmd_exec_transfer (label "-transfer", config_file)
-
-
-/**
- * Run wire transfer of funds from some user's account to the
- * donau.
- *
- * @param label label to use for the command.
- * @param amount amount to transfer, i.e. "EUR:1"
- */
-#define CMD_TRANSFER_TO_DONAU(label,amount) \
-  TALER_TESTING_cmd_admin_add_incoming (label, amount, \
-                                        &cred.ba,                \
-                                        cred.user42_payto)
-
 /**
  * Main function that will tell the interpreter what commands to
  * run.
@@ -106,1158 +73,7 @@ static void
 run (void *cls,
      struct TALER_TESTING_Interpreter *is)
 {
-  /**
-   * Test withdrawal plus spending.
-   */
-  struct TALER_TESTING_Command withdraw[] = {
-    /**
-     * Move money to the donau's bank account.
-     */
-    CMD_TRANSFER_TO_DONAU ("create-reserve-1",
-                           "EUR:6.02"),
-    TALER_TESTING_cmd_reserve_poll ("poll-reserve-1",
-                                    "create-reserve-1",
-                                    "EUR:6.02",
-                                    GNUNET_TIME_UNIT_MINUTES,
-                                    MHD_HTTP_OK),
-    TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-1",
-                                                 "EUR:6.02",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "create-reserve-1"),
-    /**
-     * Make a reserve exist, according to the previous
-     * transfer.
-     */
-    CMD_EXEC_WIREWATCH ("wirewatch-1"),
-    TALER_TESTING_cmd_reserve_poll_finish ("finish-poll-reserve-1",
-                                           GNUNET_TIME_UNIT_SECONDS,
-                                           "poll-reserve-1"),
-    /**
-     * Withdraw EUR:5.
-     */
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1",
-                                       "create-reserve-1",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    /**
-     * Withdraw EUR:1 using the SAME private coin key as for the previous coin
-     * (in violation of the specification, to be detected on spending!).
-     * However, note that this does NOT work with 'CS', as for a different
-     * denomination we get different R0/R1 values from the donau, and
-     * thus will generate a different coin private key as R0/R1 are hashed
-     * into the coin priv. So here, we fail to 'reuse' the key due to the
-     * cryptographic construction!
-     */
-    TALER_TESTING_cmd_withdraw_amount_reuse_key ("withdraw-coin-1x",
-                                                 "create-reserve-1",
-                                                 "EUR:1",
-                                                 0, /* age restriction off */
-                                                 "withdraw-coin-1",
-                                                 MHD_HTTP_OK),
-    /**
-     * Check the reserve is depleted.
-     */
-    TALER_TESTING_cmd_status ("status-1",
-                              "create-reserve-1",
-                              "EUR:0",
-                              MHD_HTTP_OK),
-    /*
-     * Try to overdraw.
-     */
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-2",
-                                       "create-reserve-1",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_CONFLICT),
-    TALER_TESTING_cmd_end ()
-  };
-
-  struct TALER_TESTING_Command spend[] = {
-    /**
-     * Spend the coin.
-     */
-    TALER_TESTING_cmd_deposit ("deposit-simple",
-                               "withdraw-coin-1",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:5",
-                               MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay",
-                                      "deposit-simple",
-                                      MHD_HTTP_OK),
-    /* This creates a conflict, as we have the same coin public key (reuse!),
-       but different denomination public keys (which is not allowed).
-       However, note that this does NOT work with 'CS', as for a different
-       denomination we get different R0/R1 values from the donau, and
-       thus will generate a different coin private key as R0/R1 are hashed
-       into the coin priv. So here, we fail to 'reuse' the key due to the
-       cryptographic construction! */
-    TALER_TESTING_cmd_deposit ("deposit-reused-coin-key-failure",
-                               "withdraw-coin-1x",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:1",
-                               uses_cs
-                               ? MHD_HTTP_OK
-                               : MHD_HTTP_CONFLICT),
-    /**
-     * Try to double spend using different wire details.
-     */
-    TALER_TESTING_cmd_deposit ("deposit-double-1",
-                               "withdraw-coin-1",
-                               0,
-                               cred.user43_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:5",
-                               MHD_HTTP_CONFLICT),
-    /* Try to double spend using a different transaction id.
-     * The test needs the contract terms to differ. This
-     * is currently the case because of the "timestamp" field,
-     * which is set automatically by #TALER_TESTING_cmd_deposit().
-     * This could theoretically fail if at some point a deposit
-     * command executes in less than 1 ms. *///
-    TALER_TESTING_cmd_deposit ("deposit-double-1",
-                               "withdraw-coin-1",
-                               0,
-                               cred.user43_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:5",
-                               MHD_HTTP_CONFLICT),
-    /**
-     * Try to double spend with different proposal.
-     */
-    TALER_TESTING_cmd_deposit ("deposit-double-2",
-                               "withdraw-coin-1",
-                               0,
-                               cred.user43_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":2}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:5",
-                               MHD_HTTP_CONFLICT),
-    TALER_TESTING_cmd_end ()
-  };
-
-  struct TALER_TESTING_Command refresh[] = {
-    /**
-     * Try to melt the coin that shared the private key with another
-     * coin (should fail). Note that in the CS-case, we fail also
-     * with MHD_HTTP_CONFLICT, but for a different reason: here it
-     * is not a denomination conflict, but a double-spending conflict.
-     */
-    TALER_TESTING_cmd_melt ("refresh-melt-reused-coin-key-failure",
-                            "withdraw-coin-1x",
-                            MHD_HTTP_CONFLICT,
-                            NULL),
-
-    /* Fill reserve with EUR:5, 1ct is for fees. */
-    CMD_TRANSFER_TO_DONAU ("refresh-create-reserve-1",
-                           "EUR:5.01"),
-    TALER_TESTING_cmd_check_bank_admin_transfer ("ck-refresh-create-reserve-1",
-                                                 "EUR:5.01",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "refresh-create-reserve-1"),
-    /**
-     * Make previous command effective.
-     */
-    CMD_EXEC_WIREWATCH ("wirewatch-2"),
-    /**
-     * Withdraw EUR:5.
-     */
-    TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin-1",
-                                       "refresh-create-reserve-1",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    /* Try to partially spend (deposit) 1 EUR of the 5 EUR coin
-     * (in full) (charity would receive EUR:0.99 due to 1 ct
-     * deposit fee)
-     */
-    TALER_TESTING_cmd_deposit ("refresh-deposit-partial",
-                               "refresh-withdraw-coin-1",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":\"EUR:1\"}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:1",
-                               MHD_HTTP_OK),
-    /**
-     * Melt the rest of the coin's value
-     * (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
-    TALER_TESTING_cmd_melt_double ("refresh-melt-1",
-                                   "refresh-withdraw-coin-1",
-                                   MHD_HTTP_OK,
-                                   NULL),
-    /**
-     * Complete (successful) melt operation, and
-     * withdraw the coins
-     */
-    TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-1",
-                                      "refresh-melt-1",
-                                      MHD_HTTP_OK),
-    /**
-     * Do it again to check idempotency
-     */
-    TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-1-idempotency",
-                                      "refresh-melt-1",
-                                      MHD_HTTP_OK),
-    /**
-     * Test that /refresh/link works
-     */
-    TALER_TESTING_cmd_refresh_link ("refresh-link-1",
-                                    "refresh-reveal-1",
-                                    MHD_HTTP_OK),
-    /**
-     * Try to spend a refreshed EUR:1 coin
-     */
-    TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-1a",
-                               "refresh-reveal-1-idempotency",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":3}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:1",
-                               MHD_HTTP_OK),
-    /**
-     * Try to spend a refreshed EUR:0.1 coin
-     */
-    TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-1b",
-                               "refresh-reveal-1",
-                               3,
-                               cred.user43_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":3}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:0.1",
-                               MHD_HTTP_OK),
-    /* Test running a failing melt operation (same operation
-     * again must fail) */
-    TALER_TESTING_cmd_melt ("refresh-melt-failing",
-                            "refresh-withdraw-coin-1",
-                            MHD_HTTP_CONFLICT,
-                            NULL),
-    /* Test running a failing melt operation (on a coin that
-       was itself revealed and subsequently deposited) */
-    TALER_TESTING_cmd_melt ("refresh-melt-failing-2",
-                            "refresh-reveal-1",
-                            MHD_HTTP_CONFLICT,
-                            NULL),
-
-    TALER_TESTING_cmd_end ()
-  };
-
-  /**
-   * Test withdrawal with age restriction.  Success is expected, so it MUST be
-   * called _after_ TALER_TESTING_cmd_exec_offline_sign_extensions is called,
-   * i. e. age restriction is activated in the donau!
-   *
-   * TODO: create a test that tries to withdraw coins with age restriction but
-   * (expectedly) fails because the donau doesn't support age restriction
-   * yet.
-   */
-  struct TALER_TESTING_Command withdraw_age[] = {
-    /**
-     * Move money to the donau's bank account.
-     */
-    CMD_TRANSFER_TO_DONAU ("create-reserve-age",
-                           "EUR:6.01"),
-    TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-age",
-                                                 "EUR:6.01",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "create-reserve-age"),
-    /**
-     * Make a reserve exist, according to the previous
-     * transfer.
-     */
-    CMD_EXEC_WIREWATCH ("wirewatch-age"),
-    /**
-     * Withdraw EUR:5.
-     */
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-age-1",
-                                       "create-reserve-age",
-                                       "EUR:5",
-                                       13,
-                                       MHD_HTTP_OK),
-
-    TALER_TESTING_cmd_end ()
-  };
-
-  struct TALER_TESTING_Command spend_age[] = {
-    /**
-     * Spend the coin.
-     */
-    TALER_TESTING_cmd_deposit ("deposit-simple-age",
-                               "withdraw-coin-age-1",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:4.99",
-                               MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-age",
-                                      "deposit-simple-age",
-                                      MHD_HTTP_OK),
-    TALER_TESTING_cmd_end ()
-  };
-
-  struct TALER_TESTING_Command track[] = {
-    /* Try resolving a deposit's WTID, as we never triggered
-     * execution of transactions, the answer should be that
-     * the donau knows about the deposit, but has no WTID yet.
-     */
-    TALER_TESTING_cmd_track_transaction ("deposit-wtid-found",
-                                         "deposit-simple",
-                                         0,
-                                         MHD_HTTP_ACCEPTED,
-                                         NULL),
-    /* Try resolving a deposit's WTID for a failed deposit.
-     * As the deposit failed, the answer should be that the
-     * donau does NOT know about the deposit.
-     */
-    TALER_TESTING_cmd_track_transaction ("deposit-wtid-failing",
-                                         "deposit-double-2",
-                                         0,
-                                         MHD_HTTP_NOT_FOUND,
-                                         NULL),
-    /* Try resolving an undefined (all zeros) WTID; this
-     * should fail as obviously the donau didn't use that
-     * WTID value for any transaction.
-     */
-    TALER_TESTING_cmd_track_transfer_empty ("wire-deposit-failing",
-                                            NULL,
-                                            MHD_HTTP_NOT_FOUND),
-    /* Run transfers. Note that _actual_ aggregation will NOT
-     * happen here, as each deposit operation is run with a
-     * fresh charity public key, so the aggregator will treat
-     * them as "different" charities and do the wire transfers
-     * individually. */
-    CMD_EXEC_AGGREGATOR ("run-aggregator"),
-    /**
-     * Check all the transfers took place.
-     */
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-499c",
-                                           cred.donau_url,
-                                           "EUR:4.98",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-499c2",
-                                           cred.donau_url,
-                                           "EUR:4.97",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c1",
-                                           cred.donau_url,
-                                           "EUR:0.98",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c2",
-                                           cred.donau_url,
-                                           "EUR:0.98",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c3",
-                                           cred.donau_url,
-                                           "EUR:0.98",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c4",
-                                           cred.donau_url,
-                                           "EUR:0.98",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-08c",
-                                           cred.donau_url,
-                                           "EUR:0.08",
-                                           cred.donau_payto,
-                                           cred.user43_payto),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-08c2",
-                                           cred.donau_url,
-                                           "EUR:0.08",
-                                           cred.donau_payto,
-                                           cred.user43_payto),
-    /* In case of CS, one transaction above succeeded that
-       failed for RSA, hence we need to check for an extra transfer here */
-    uses_cs
-    ? TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-98c",
-                                             cred.donau_url,
-                                             "EUR:0.98",
-                                             cred.donau_payto,
-                                             cred.user42_payto)
-    : TALER_TESTING_cmd_sleep ("dummy",
-                               0),
-    TALER_TESTING_cmd_check_bank_empty ("check_bank_empty"),
-    TALER_TESTING_cmd_track_transaction ("deposit-wtid-ok",
-                                         "deposit-simple",
-                                         0,
-                                         MHD_HTTP_OK,
-                                         "check_bank_transfer-499c"),
-    TALER_TESTING_cmd_track_transfer ("wire-deposit-success-bank",
-                                      "check_bank_transfer-99c1",
-                                      MHD_HTTP_OK,
-                                      "EUR:0.98",
-                                      "EUR:0.01"),
-    TALER_TESTING_cmd_track_transfer ("wire-deposits-success-wtid",
-                                      "deposit-wtid-ok",
-                                      MHD_HTTP_OK,
-                                      "EUR:4.98",
-                                      "EUR:0.01"),
-    TALER_TESTING_cmd_end ()
-  };
-
-  /**
-   * This block checks whether a wire deadline
-   * very far in the future does NOT get aggregated now.
-   */
-  struct TALER_TESTING_Command unaggregation[] = {
-    TALER_TESTING_cmd_check_bank_empty ("far-future-aggregation-a"),
-    CMD_TRANSFER_TO_DONAU ("create-reserve-unaggregated",
-                           "EUR:5.01"),
-    /* "consume" reserve creation transfer.  */
-    TALER_TESTING_cmd_check_bank_admin_transfer (
-      "check-create-reserve-unaggregated",
-      "EUR:5.01",
-      cred.user42_payto,
-      cred.donau_payto,
-      "create-reserve-unaggregated"),
-    CMD_EXEC_WIREWATCH ("wirewatch-unaggregated"),
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-unaggregated",
-                                       "create-reserve-unaggregated",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit ("deposit-unaggregated",
-                               "withdraw-coin-unaggregated",
-                               0,
-                               cred.user43_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_relative_multiply (
-                                 GNUNET_TIME_UNIT_YEARS,
-                                 3000),
-                               "EUR:5",
-                               MHD_HTTP_OK),
-    CMD_EXEC_AGGREGATOR ("aggregation-attempt"),
-
-    TALER_TESTING_cmd_check_bank_empty (
-      "far-future-aggregation-b"),
-
-    TALER_TESTING_cmd_end ()
-  };
-
-  struct TALER_TESTING_Command refresh_age[] = {
-    /* Fill reserve with EUR:5, 1ct is for fees. */
-    CMD_TRANSFER_TO_DONAU ("refresh-create-reserve-age-1",
-                           "EUR:6.01"),
-    TALER_TESTING_cmd_check_bank_admin_transfer (
-      "ck-refresh-create-reserve-age-1",
-      "EUR:6.01",
-      cred.user42_payto,
-      cred.donau_payto,
-      "refresh-create-reserve-age-1"),
-    /**
-     * Make previous command effective.
-     */
-    CMD_EXEC_WIREWATCH ("wirewatch-age-2"),
-    /**
-     * Withdraw EUR:7 with age restriction for age 13.
-     */
-    TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin-age-1",
-                                       "refresh-create-reserve-age-1",
-                                       "EUR:5",
-                                       13,
-                                       MHD_HTTP_OK),
-    /* Try to partially spend (deposit) 1 EUR of the 5 EUR coin
-     * (in full) (charity would receive EUR:0.99 due to 1 ct
-     * deposit fee)
-     */
-    TALER_TESTING_cmd_deposit ("refresh-deposit-partial-age",
-                               "refresh-withdraw-coin-age-1",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":\"EUR:1\"}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:1",
-                               MHD_HTTP_OK),
-    /**
-     * Melt the rest of the coin's value
-     * (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
-    TALER_TESTING_cmd_melt_double ("refresh-melt-age-1",
-                                   "refresh-withdraw-coin-age-1",
-                                   MHD_HTTP_OK,
-                                   NULL),
-    /**
-     * Complete (successful) melt operation, and
-     * withdraw the coins
-     */
-    TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-age-1",
-                                      "refresh-melt-age-1",
-                                      MHD_HTTP_OK),
-    /**
-     * Do it again to check idempotency
-     */
-    TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-age-1-idempotency",
-                                      "refresh-melt-age-1",
-                                      MHD_HTTP_OK),
-    /**
-     * Test that /refresh/link works
-     */
-    TALER_TESTING_cmd_refresh_link ("refresh-link-age-1",
-                                    "refresh-reveal-age-1",
-                                    MHD_HTTP_OK),
-    /**
-     * Try to spend a refreshed EUR:1 coin
-     */
-    TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-age-1a",
-                               "refresh-reveal-age-1-idempotency",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":3}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:1",
-                               MHD_HTTP_OK),
-    /**
-     * Try to spend a refreshed EUR:0.1 coin
-     */
-    TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-age-1b",
-                               "refresh-reveal-age-1",
-                               3,
-                               cred.user43_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":3}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:0.1",
-                               MHD_HTTP_OK),
-    /* Test running a failing melt operation (same operation
-     * again must fail) */
-    TALER_TESTING_cmd_melt ("refresh-melt-failing-age",
-                            "refresh-withdraw-coin-age-1",
-                            MHD_HTTP_CONFLICT,
-                            NULL),
-    /* Test running a failing melt operation (on a coin that
-       was itself revealed and subsequently deposited) */
-    TALER_TESTING_cmd_melt ("refresh-melt-failing-age-2",
-                            "refresh-reveal-age-1",
-                            MHD_HTTP_CONFLICT,
-                            NULL),
-    TALER_TESTING_cmd_end ()
-  };
-
-  /**
-   * This block exercises the aggretation logic by making two payments
-   * to the same charity.
-   */
-  struct TALER_TESTING_Command aggregation[] = {
-    CMD_TRANSFER_TO_DONAU ("create-reserve-aggtest",
-                           "EUR:5.01"),
-    /* "consume" reserve creation transfer.  */
-    TALER_TESTING_cmd_check_bank_admin_transfer (
-      "check-create-reserve-aggtest",
-      "EUR:5.01",
-      cred.user42_payto,
-      cred.donau_payto,
-      "create-reserve-aggtest"),
-    CMD_EXEC_WIREWATCH ("wirewatch-aggtest"),
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-aggtest",
-                                       "create-reserve-aggtest",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit ("deposit-aggtest-1",
-                               "withdraw-coin-aggtest",
-                               0,
-                               cred.user43_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:2",
-                               MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit_with_ref ("deposit-aggtest-2",
-                                        "withdraw-coin-aggtest",
-                                        0,
-                                        cred.user43_payto,
-                                        "{\"items\":[{\"name\":\"foo 
bar\",\"value\":1}]}",
-                                        GNUNET_TIME_UNIT_ZERO,
-                                        "EUR:2",
-                                        MHD_HTTP_OK,
-                                        "deposit-aggtest-1"),
-    CMD_EXEC_AGGREGATOR ("aggregation-aggtest"),
-    TALER_TESTING_cmd_check_bank_transfer ("check-bank-transfer-aggtest",
-                                           cred.donau_url,
-                                           "EUR:3.97",
-                                           cred.donau_payto,
-                                           cred.user43_payto),
-    TALER_TESTING_cmd_check_bank_empty ("check-bank-empty-aggtest"),
-    TALER_TESTING_cmd_end ()
-  };
-
-  struct TALER_TESTING_Command refund[] = {
-    /**
-     * Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
-     * config.
-     */
-    CMD_TRANSFER_TO_DONAU ("create-reserve-r1",
-                           "EUR:5.01"),
-    TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-r1",
-                                                 "EUR:5.01",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "create-reserve-r1"),
-    /**
-     * Run wire-watch to trigger the reserve creation.
-     */
-    CMD_EXEC_WIREWATCH ("wirewatch-3"),
-    /* Withdraw a 5 EUR coin, at fee of 1 ct */
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r1",
-                                       "create-reserve-r1",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    /**
-     * Spend 5 EUR of the 5 EUR coin (in full) (charity would
-     * receive EUR:4.99 due to 1 ct deposit fee)
-     */
-    TALER_TESTING_cmd_deposit ("deposit-refund-1",
-                               "withdraw-coin-r1",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":\"EUR:5\"}]}",
-                               GNUNET_TIME_UNIT_MINUTES,
-                               "EUR:5",
-                               MHD_HTTP_OK),
-    /**
-     * Run transfers. Should do nothing as refund deadline blocks it
-     */
-    CMD_EXEC_AGGREGATOR ("run-aggregator-refund"),
-    /* Check that aggregator didn't do anything, as expected.
-     * Note, this operation takes two commands: one to "flush"
-     * the preliminary transfer (used to withdraw) from the
-     * fakebank and the second to actually check there are not
-     * other transfers around. */
-    TALER_TESTING_cmd_check_bank_empty ("check_bank_transfer-pre-refund"),
-    TALER_TESTING_cmd_refund_with_id ("refund-ok",
-                                      MHD_HTTP_OK,
-                                      "EUR:3",
-                                      "deposit-refund-1",
-                                      3),
-    TALER_TESTING_cmd_refund_with_id ("refund-ok-double",
-                                      MHD_HTTP_OK,
-                                      "EUR:3",
-                                      "deposit-refund-1",
-                                      3),
-    /* Previous /refund(s) had id == 0.  */
-    TALER_TESTING_cmd_refund_with_id ("refund-conflicting",
-                                      MHD_HTTP_CONFLICT,
-                                      "EUR:5",
-                                      "deposit-refund-1",
-                                      1),
-    TALER_TESTING_cmd_deposit ("deposit-refund-insufficient-refund",
-                               "withdraw-coin-r1",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":\"EUR:4\"}]}",
-                               GNUNET_TIME_UNIT_MINUTES,
-                               "EUR:4",
-                               MHD_HTTP_CONFLICT),
-    TALER_TESTING_cmd_refund_with_id ("refund-ok-increase",
-                                      MHD_HTTP_OK,
-                                      "EUR:2",
-                                      "deposit-refund-1",
-                                      2),
-    /**
-     * Spend 4.99 EUR of the refunded 4.99 EUR coin (1ct gone
-     * due to refund) (charity would receive EUR:4.98 due to
-     * 1 ct deposit fee) */
-    TALER_TESTING_cmd_deposit ("deposit-refund-2",
-                               "withdraw-coin-r1",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"more ice 
cream\",\"value\":\"EUR:5\"}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:4.99",
-                               MHD_HTTP_OK),
-    /**
-     * Run transfers. This will do the transfer as refund deadline
-     * was 0
-     */
-    CMD_EXEC_AGGREGATOR ("run-aggregator-3"),
-    /**
-     * Check that deposit did run.
-     */
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-pre-refund",
-                                           cred.donau_url,
-                                           "EUR:4.97",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    /**
-     * Run failing refund, as past deadline & aggregation.
-     */
-    TALER_TESTING_cmd_refund ("refund-fail",
-                              MHD_HTTP_GONE,
-                              "EUR:4.99",
-                              "deposit-refund-2"),
-    TALER_TESTING_cmd_check_bank_empty ("check-empty-after-refund"),
-    /**
-     * Test refunded coins are never executed, even past
-     * refund deadline
-     */
-    CMD_TRANSFER_TO_DONAU ("create-reserve-rb",
-                           "EUR:5.01"),
-    TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-rb",
-                                                 "EUR:5.01",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "create-reserve-rb"),
-    CMD_EXEC_WIREWATCH ("wirewatch-rb"),
-    TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-rb",
-                                       "create-reserve-rb",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit ("deposit-refund-1b",
-                               "withdraw-coin-rb",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"ice 
cream\",\"value\":\"EUR:5\"}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:5",
-                               MHD_HTTP_OK),
-    /**
-     * Trigger refund (before aggregator had a chance to execute
-     * deposit, even though refund deadline was zero).
-     */
-    TALER_TESTING_cmd_refund ("refund-ok-fast",
-                              MHD_HTTP_OK,
-                              "EUR:5",
-                              "deposit-refund-1b"),
-    /**
-     * Run transfers. This will do the transfer as refund deadline
-     * was 0, except of course because the refund succeeded, the
-     * transfer should no longer be done.
-     */
-    CMD_EXEC_AGGREGATOR ("run-aggregator-3b"),
-    /* check that aggregator didn't do anything, as expected */
-    TALER_TESTING_cmd_check_bank_empty ("check-refund-fast-not-run"),
-    TALER_TESTING_cmd_end ()
-  };
-
-  struct TALER_TESTING_Command recoup[] = {
-    /**
-     * Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
-     * config.
-     */
-    CMD_TRANSFER_TO_DONAU ("recoup-create-reserve-1",
-                           "EUR:15.02"),
-    TALER_TESTING_cmd_check_bank_admin_transfer (
-      "recoup-create-reserve-1-check",
-      "EUR:15.02",
-      cred.user42_payto,
-      cred.donau_payto,
-      "recoup-create-reserve-1"),
-    /**
-     * Run wire-watch to trigger the reserve creation.
-     */
-    CMD_EXEC_WIREWATCH ("wirewatch-4"),
-    /* Withdraw a 5 EUR coin, at fee of 1 ct */
-    TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-1",
-                                       "recoup-create-reserve-1",
-                                       "EUR:5",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    /* Withdraw a 10 EUR coin, at fee of 1 ct */
-    TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-1b",
-                                       "recoup-create-reserve-1",
-                                       "EUR:10",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    /* melt 10 EUR coin to get 5 EUR refreshed coin */
-    TALER_TESTING_cmd_melt ("recoup-melt-coin-1b",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:5",
-                            NULL),
-    TALER_TESTING_cmd_refresh_reveal ("recoup-reveal-coin-1b",
-                                      "recoup-melt-coin-1b",
-                                      MHD_HTTP_OK),
-    /* Revoke both 5 EUR coins */
-    TALER_TESTING_cmd_revoke ("revoke-0-EUR:5",
-                              MHD_HTTP_OK,
-                              "recoup-withdraw-coin-1",
-                              config_file),
-    /* Recoup coin to reserve */
-    TALER_TESTING_cmd_recoup ("recoup-1",
-                              MHD_HTTP_OK,
-                              "recoup-withdraw-coin-1",
-                              "EUR:5"),
-    /* Check the money is back with the reserve */
-    TALER_TESTING_cmd_status ("recoup-reserve-status-1",
-                              "recoup-create-reserve-1",
-                              "EUR:5.0",
-                              MHD_HTTP_OK),
-    /* Recoup-refresh coin to 10 EUR coin */
-    TALER_TESTING_cmd_recoup_refresh ("recoup-1b",
-                                      MHD_HTTP_OK,
-                                      "recoup-reveal-coin-1b",
-                                      "recoup-melt-coin-1b",
-                                      "EUR:5"),
-    /* melt 10 EUR coin *again* to get 1 EUR refreshed coin */
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1a",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_refresh_reveal ("recoup-reveal-coin-1a",
-                                      "recoup-remelt-coin-1a",
-                                      MHD_HTTP_OK),
-    /* Try melting for more than the residual value to provoke an error */
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1b",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1c",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1d",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1e",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1f",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1g",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1h",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1i",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_OK,
-                            "EUR:1",
-                            NULL),
-    TALER_TESTING_cmd_melt ("recoup-remelt-coin-1b-failing",
-                            "recoup-withdraw-coin-1b",
-                            MHD_HTTP_CONFLICT,
-                            "EUR:1",
-                            NULL),
-    /* Re-withdraw from this reserve */
-    TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2",
-                                       "recoup-create-reserve-1",
-                                       "EUR:1",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    /**
-     * This withdrawal will test the logic to create a "recoup"
-     * element to insert into the reserve's history.
-     */
-    TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2-over",
-                                       "recoup-create-reserve-1",
-                                       "EUR:10",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_CONFLICT),
-    TALER_TESTING_cmd_status ("recoup-reserve-status-2",
-                              "recoup-create-reserve-1",
-                              "EUR:3.99",
-                              MHD_HTTP_OK),
-    /* These commands should close the reserve because
-     * the aggregator is given a config file that overrides
-     * the reserve expiration time (making it now-ish) */
-    CMD_TRANSFER_TO_DONAU ("short-lived-reserve",
-                           "EUR:5.01"),
-    TALER_TESTING_cmd_check_bank_admin_transfer ("check-short-lived-reserve",
-                                                 "EUR:5.01",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "short-lived-reserve"),
-    TALER_TESTING_cmd_exec_wirewatch2 ("short-lived-aggregation",
-                                       config_file_expire_reserve_now,
-                                       "donau-account-2"),
-    TALER_TESTING_cmd_exec_closer ("close-reserves",
-                                   config_file_expire_reserve_now,
-                                   "EUR:5",
-                                   "EUR:0.01",
-                                   "short-lived-reserve"),
-    TALER_TESTING_cmd_exec_transfer ("close-reserves-transfer",
-                                     config_file_expire_reserve_now),
-
-    TALER_TESTING_cmd_status ("short-lived-status",
-                              "short-lived-reserve",
-                              "EUR:0",
-                              MHD_HTTP_OK),
-    TALER_TESTING_cmd_withdraw_amount ("expired-withdraw",
-                                       "short-lived-reserve",
-                                       "EUR:1",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_CONFLICT),
-    TALER_TESTING_cmd_check_bank_transfer ("check_bank_short-lived_reimburse",
-                                           cred.donau_url,
-                                           "EUR:5",
-                                           cred.donau_payto,
-                                           cred.user42_payto),
-    /* Fill reserve with EUR:2.02, as withdraw fee is 1 ct per
-     * config, then withdraw two coin, partially spend one, and
-     * then have the rest paid back.  Check deposit of other coin
-     * fails.  Do not use EUR:5 here as the EUR:5 coin was
-     * revoked and we did not bother to create a new one... */
-    CMD_TRANSFER_TO_DONAU ("recoup-create-reserve-2",
-                           "EUR:2.02"),
-    TALER_TESTING_cmd_check_bank_admin_transfer ("ck-recoup-create-reserve-2",
-                                                 "EUR:2.02",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "recoup-create-reserve-2"),
-    /* Make previous command effective. */
-    CMD_EXEC_WIREWATCH ("wirewatch-5"),
-    /* Withdraw a 1 EUR coin, at fee of 1 ct */
-    TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2a",
-                                       "recoup-create-reserve-2",
-                                       "EUR:1",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    /* Withdraw a 1 EUR coin, at fee of 1 ct */
-    TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2b",
-                                       "recoup-create-reserve-2",
-                                       "EUR:1",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit ("recoup-deposit-partial",
-                               "recoup-withdraw-coin-2a",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"more ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:0.5",
-                               MHD_HTTP_OK),
-    TALER_TESTING_cmd_revoke ("revoke-1-EUR:1",
-                              MHD_HTTP_OK,
-                              "recoup-withdraw-coin-2a",
-                              config_file),
-    /* Check recoup is failing for the coin with the reused coin key
-       (fails either because of denomination conflict (RSA) or
-       double-spending (CS))*/
-    TALER_TESTING_cmd_recoup ("recoup-2x",
-                              MHD_HTTP_CONFLICT,
-                              "withdraw-coin-1x",
-                              "EUR:1"),
-    TALER_TESTING_cmd_recoup ("recoup-2",
-                              MHD_HTTP_OK,
-                              "recoup-withdraw-coin-2a",
-                              "EUR:0.5"),
-    /* Idempotency of recoup (withdrawal variant) */
-    TALER_TESTING_cmd_recoup ("recoup-2b",
-                              MHD_HTTP_OK,
-                              "recoup-withdraw-coin-2a",
-                              "EUR:0.5"),
-    TALER_TESTING_cmd_deposit ("recoup-deposit-revoked",
-                               "recoup-withdraw-coin-2b",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"more ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:1",
-                               MHD_HTTP_GONE),
-    /* Test deposit fails after recoup, with proof in recoup */
-
-    /* Note that, the donau will never return the coin's transaction
-     * history with recoup data, as we get a 410 on the DK! */
-    TALER_TESTING_cmd_deposit ("recoup-deposit-partial-after-recoup",
-                               "recoup-withdraw-coin-2a",
-                               0,
-                               cred.user42_payto,
-                               "{\"items\":[{\"name\":\"extra ice 
cream\",\"value\":1}]}",
-                               GNUNET_TIME_UNIT_ZERO,
-                               "EUR:0.5",
-                               MHD_HTTP_GONE),
-    /* Test that revoked coins cannot be withdrawn */
-    CMD_TRANSFER_TO_DONAU ("recoup-create-reserve-3",
-                           "EUR:1.01"),
-    TALER_TESTING_cmd_check_bank_admin_transfer (
-      "check-recoup-create-reserve-3",
-      "EUR:1.01",
-      cred.user42_payto,
-      cred.donau_payto,
-      "recoup-create-reserve-3"),
-    CMD_EXEC_WIREWATCH ("wirewatch-6"),
-    TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-3-revoked",
-                                       "recoup-create-reserve-3",
-                                       "EUR:1",
-                                       0, /* age restriction off */
-                                       MHD_HTTP_GONE),
-    /* check that we are empty before the rejection test */
-    TALER_TESTING_cmd_check_bank_empty ("check-empty-again"),
-
-    TALER_TESTING_cmd_end ()
-  };
-
-  /**
-   * Test batch withdrawal plus spending.
-   */
-  struct TALER_TESTING_Command batch_withdraw[] = {
-    /**
-     * Move money to the donau's bank account.
-     */
-    CMD_TRANSFER_TO_DONAU ("create-batch-reserve-1",
-                           "EUR:6.03"),
-    TALER_TESTING_cmd_reserve_poll ("poll-batch-reserve-1",
-                                    "create-batch-reserve-1",
-                                    "EUR:6.03",
-                                    GNUNET_TIME_UNIT_MINUTES,
-                                    MHD_HTTP_OK),
-    TALER_TESTING_cmd_check_bank_admin_transfer 
("check-create-batch-reserve-1",
-                                                 "EUR:6.03",
-                                                 cred.user42_payto,
-                                                 cred.donau_payto,
-                                                 "create-batch-reserve-1"),
-    /*
-     * Make a reserve exist, according to the previous
-     * transfer.
-     */
-    CMD_EXEC_WIREWATCH ("wirewatch-batch-1"),
-    TALER_TESTING_cmd_reserve_poll_finish ("finish-poll-batch-reserve-1",
-                                           GNUNET_TIME_UNIT_SECONDS,
-                                           "poll-batch-reserve-1"),
-    /**
-     * Withdraw EUR:5 AND EUR:1.
-     */
-    TALER_TESTING_cmd_batch_withdraw ("batch-withdraw-coin-1",
-                                      "create-batch-reserve-1",
-                                      0,  /* age restriction off */
-                                      MHD_HTTP_OK,
-                                      "EUR:5",
-                                      "EUR:1",
-                                      NULL),
-    /**
-     * Check the reserve is (almost) depleted.
-     */
-    TALER_TESTING_cmd_status ("status-batch-1",
-                              "create-batch-reserve-1",
-                              "EUR:0.01",
-                              MHD_HTTP_OK),
-    TALER_TESTING_cmd_reserve_history ("history-batch-1",
-                                       "create-batch-reserve-1",
-                                       "EUR:0",
-                                       MHD_HTTP_OK),
-    TALER_TESTING_cmd_status ("status-batch-2",
-                              "create-batch-reserve-1",
-                              "EUR:0.0",
-                              MHD_HTTP_OK),
-    /**
-     * Spend the coins.
-     */
-    TALER_TESTING_cmd_batch_deposit ("batch-deposit-1",
-                                     cred.user42_payto,
-                                     "{\"items\":[{\"name\":\"ice 
cream\",\"value\":5}]}",
-                                     GNUNET_TIME_UNIT_ZERO,
-                                     MHD_HTTP_OK,
-                                     "batch-withdraw-coin-1#0",
-                                     "EUR:5",
-                                     "batch-withdraw-coin-1#1",
-                                     "EUR:1",
-                                     NULL),
-    TALER_TESTING_cmd_end ()
-  };
-
-
-#define RESERVE_OPEN_CLOSE_CHUNK 4
-#define RESERVE_OPEN_CLOSE_ITERATIONS 3
-
-  struct TALER_TESTING_Command 
reserve_open_close[(RESERVE_OPEN_CLOSE_ITERATIONS
-                                                   * RESERVE_OPEN_CLOSE_CHUNK)
-                                                  + 1];
-
-  (void) cls;
-  for (unsigned int i = 0;
-       i < RESERVE_OPEN_CLOSE_ITERATIONS;
-       i++)
-  {
-    reserve_open_close[(i * RESERVE_OPEN_CLOSE_CHUNK) + 0]
-      = CMD_TRANSFER_TO_DONAU ("reserve-open-close-key",
-                               "EUR:20");
-    reserve_open_close[(i * RESERVE_OPEN_CLOSE_CHUNK) + 1]
-      = TALER_TESTING_cmd_exec_wirewatch2 ("reserve-open-close-wirewatch",
-                                           config_file_expire_reserve_now,
-                                           "donau-account-2");
-    reserve_open_close[(i * RESERVE_OPEN_CLOSE_CHUNK) + 2]
-      = TALER_TESTING_cmd_exec_closer ("reserve-open-close-aggregation",
-                                       config_file_expire_reserve_now,
-                                       "EUR:19.99",
-                                       "EUR:0.01",
-                                       "reserve-open-close-key");
-    reserve_open_close[(i * RESERVE_OPEN_CLOSE_CHUNK) + 3]
-      = TALER_TESTING_cmd_status ("reserve-open-close-status",
-                                  "reserve-open-close-key",
-                                  "EUR:0",
-                                  MHD_HTTP_OK);
-  }
-  reserve_open_close[RESERVE_OPEN_CLOSE_ITERATIONS * RESERVE_OPEN_CLOSE_CHUNK]
-    = TALER_TESTING_cmd_end ();
-
-  {
-    struct TALER_TESTING_Command commands[] = {
-      TALER_TESTING_cmd_run_fakebank ("run-fakebank",
-                                      cred.cfg,
-                                      "donau-account-2"),
-      TALER_TESTING_cmd_system_start ("start-taler",
-                                      config_file,
-                                      "-e",
-                                      NULL),
-      TALER_TESTING_cmd_get_donau ("get-donau",
-                                   cred.cfg,
-                                   NULL,
-                                   true,
-                                   true),
-      TALER_TESTING_cmd_batch ("withdraw",
-                               withdraw),
-      TALER_TESTING_cmd_batch ("spend",
-                               spend),
-      TALER_TESTING_cmd_batch ("refresh",
-                               refresh),
-      TALER_TESTING_cmd_batch ("withdraw-age",
-                               withdraw_age),
-      TALER_TESTING_cmd_batch ("spend-age",
-                               spend_age),
-      TALER_TESTING_cmd_batch ("refresh-age",
-                               refresh_age),
-      TALER_TESTING_cmd_batch ("track",
-                               track),
-      TALER_TESTING_cmd_batch ("unaggregation",
-                               unaggregation),
-      TALER_TESTING_cmd_batch ("aggregation",
-                               aggregation),
-      TALER_TESTING_cmd_batch ("refund",
-                               refund),
-      TALER_TESTING_cmd_batch ("batch-withdraw",
-                               batch_withdraw),
-      TALER_TESTING_cmd_batch ("recoup",
-                               recoup),
-      TALER_TESTING_cmd_batch ("reserve-open-close",
-                               reserve_open_close),
-      /* End the suite. */
-      TALER_TESTING_cmd_end ()
-    };
-
-    TALER_TESTING_run (is,
-                       commands);
-  }
+  // tests
 }
 
 
diff --git a/src/testing/test_donau_api.conf b/src/testing/test_donau_api.conf
index 5b8c592..f7a4bba 100644
--- a/src/testing/test_donau_api.conf
+++ b/src/testing/test_donau_api.conf
@@ -8,15 +8,6 @@ TALER_TEST_HOME = test_donau_api_home/
 CURRENCY = EUR
 CURRENCY_ROUND_UNIT = EUR:0.01
 
-[auditor]
-BASE_URL = "http://localhost:8083/";
-PORT = 8083
-PUBLIC_KEY = T0XJ9QZ59YDN7QG3RE40SB2HY7W0ASR1EKF4WZDGZ1G159RSQC80
-TINY_AMOUNT = EUR:0.01
-
-[auditordb-postgres]
-CONFIG = "postgres:///talercheck"
-
 [bank]
 HTTP_PORT = 8082
 
@@ -64,28 +55,3 @@ WIRE_GATEWAY_AUTH_METHOD = basic
 USERNAME = Donau
 PASSWORD = x
 WIRE_GATEWAY_URL = "http://localhost:8082/2/";
-
-
-[kyc-provider-test-oauth2]
-COST = 0
-LOGIC = oauth2
-USER_TYPE = INDIVIDUAL
-PROVIDED_CHECKS = DUMMY
-KYC_OAUTH2_VALIDITY = forever
-KYC_OAUTH2_TOKEN_URL = http://localhost:6666/oauth/v2/token
-KYC_OAUTH2_AUTHORIZE_URL = http://localhost:6666/oauth/v2/login
-KYC_OAUTH2_INFO_URL = http://localhost:6666/api/user/me
-KYC_OAUTH2_CLIENT_ID = taler-donau
-KYC_OAUTH2_CLIENT_SECRET = donau-secret
-KYC_OAUTH2_POST_URL = http://example.com/
-KYC_OAUTH2_ATTRIBUTE_TEMPLATE = "{"full_name":"{{last_name}}, {{first_name}}"}"
-
-[kyc-legitimization-close]
-OPERATION_TYPE = CLOSE
-REQUIRED_CHECKS = DUMMY
-THRESHOLD = EUR:0
-TIMEFRAME = 1d
-
-[donau-extension-age_restriction]
-ENABLED = YES
-#AGE_GROUPS = "8:10:12:14:16:18:21"
diff --git a/src/testing/testing_api_cmd_batch.c 
b/src/testing/testing_api_cmd_batch.c
deleted file mode 100644
index 9b80d79..0000000
--- a/src/testing/testing_api_cmd_batch.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2014-2021 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_batch.c
- * @brief Implement batch-execution of CMDs.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "batch" CMD.
- */
-struct BatchState
-{
-  /**
-   * CMDs batch.
-   */
-  struct TALER_TESTING_Command *batch;
-
-  /**
-   * My command (the batch command).
-   */
-  const struct TALER_TESTING_Command *cmd;
-
-  /**
-   * Internal command pointer.
-   */
-  unsigned int batch_ip;
-};
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command being executed.
- * @param is the interpreter state.
- */
-static void
-batch_run (void *cls,
-           const struct TALER_TESTING_Command *cmd,
-           struct TALER_TESTING_Interpreter *is)
-{
-  struct BatchState *bs = cls;
-
-  bs->cmd = cmd;
-  if (NULL != bs->batch[bs->batch_ip].label)
-    TALER_LOG_INFO ("Running batched command: %s\n",
-                    bs->batch[bs->batch_ip].label);
-
-  /* hit end command, leap to next top-level command.  */
-  if (NULL == bs->batch[bs->batch_ip].label)
-  {
-    TALER_LOG_INFO ("Exiting from batch: %s\n",
-                    cmd->label);
-    TALER_TESTING_interpreter_next (is);
-    return;
-  }
-  bs->batch[bs->batch_ip].start_time
-    = bs->batch[bs->batch_ip].last_req_time
-      = GNUNET_TIME_absolute_get ();
-  bs->batch[bs->batch_ip].num_tries = 1;
-  bs->batch[bs->batch_ip].run (bs->batch[bs->batch_ip].cls,
-                               &bs->batch[bs->batch_ip],
-                               is);
-}
-
-
-/**
- * Cleanup the state from a "reserve status" CMD, and possibly
- * cancel a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-batch_cleanup (void *cls,
-               const struct TALER_TESTING_Command *cmd)
-{
-  struct BatchState *bs = cls;
-
-  (void) cmd;
-  for (unsigned int i = 0;
-       NULL != bs->batch[i].label;
-       i++)
-    if (NULL != bs->batch[i].cleanup)
-      bs->batch[i].cleanup (bs->batch[i].cls,
-                            &bs->batch[i]);
-  GNUNET_free (bs->batch);
-  GNUNET_free (bs);
-}
-
-
-/**
- * Offer internal data from a "batch" CMD, to other commands.
- *
- * @param cls closure.
- * @param[out] ret result.
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-batch_traits (void *cls,
-              const void **ret,
-              const char *trait,
-              unsigned int index)
-{
-  struct BatchState *bs = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_make_trait_batch_cmds (bs->batch),
-    TALER_TESTING_trait_end ()
-  };
-
-  /* Always return current command.  */
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_batch (const char *label,
-                         struct TALER_TESTING_Command *batch)
-{
-  struct BatchState *bs;
-  unsigned int i;
-
-  bs = GNUNET_new (struct BatchState);
-
-  /* Get number of commands.  */
-  for (i = 0; NULL != batch[i].label; i++)
-    /* noop */
-    ;
-
-  bs->batch = GNUNET_new_array (i + 1,
-                                struct TALER_TESTING_Command);
-  GNUNET_memcpy (bs->batch,
-                 batch,
-                 sizeof (struct TALER_TESTING_Command) * i);
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = bs,
-      .label = label,
-      .run = &batch_run,
-      .cleanup = &batch_cleanup,
-      .traits = &batch_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-bool
-TALER_TESTING_cmd_batch_next (struct TALER_TESTING_Interpreter *is,
-                              void *cls)
-{
-  struct BatchState *bs = cls;
-  struct TALER_TESTING_Command *bcmd = &bs->batch[bs->batch_ip];
-
-  if (NULL == bcmd->label)
-  {
-    /* This batch is done */
-    return true;
-  }
-  if (TALER_TESTING_cmd_is_batch (bcmd))
-  {
-    if (TALER_TESTING_cmd_batch_next (is,
-                                      bcmd->cls))
-    {
-      /* sub-batch is done */
-      bcmd->finish_time = GNUNET_TIME_absolute_get ();
-      bs->batch_ip++;
-      return false;
-    }
-  }
-  /* Simple command is done */
-  bcmd->finish_time = GNUNET_TIME_absolute_get ();
-  bs->batch_ip++;
-  return false;
-}
-
-
-bool
-TALER_TESTING_cmd_is_batch (const struct TALER_TESTING_Command *cmd)
-{
-  return cmd->run == &batch_run;
-}
-
-
-struct TALER_TESTING_Command *
-TALER_TESTING_cmd_batch_get_current (const struct TALER_TESTING_Command *cmd)
-{
-  struct BatchState *bs = cmd->cls;
-
-  GNUNET_assert (cmd->run == &batch_run);
-  return &bs->batch[bs->batch_ip];
-}
-
-
-void
-TALER_TESTING_cmd_batch_set_current (const struct TALER_TESTING_Command *cmd,
-                                     unsigned int new_ip)
-{
-  struct BatchState *bs = cmd->cls;
-
-  /* sanity checks */
-  GNUNET_assert (cmd->run == &batch_run);
-  for (unsigned int i = 0; i < new_ip; i++)
-    GNUNET_assert (NULL != bs->batch[i].label);
-  /* actual logic */
-  bs->batch_ip = new_ip;
-}
diff --git a/src/testing/testing_api_cmd_batch_deposit.c 
b/src/testing/testing_api_cmd_batch_deposit.c
deleted file mode 100644
index 67ed5a5..0000000
--- a/src/testing/testing_api_cmd_batch_deposit.c
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2018-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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_batch_deposit.c
- * @brief command for testing /batch-deposit.
- * @author Marcello Stanisci
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-#include "taler_signatures.h"
-#include "backoff.h"
-
-
-/**
- * How often do we retry before giving up?
- */
-#define NUM_RETRIES 5
-
-/**
- * How long do we wait AT MOST when retrying?
- */
-#define MAX_BACKOFF GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_MILLISECONDS, 100)
-
-
-/**
- * Information per coin in the batch.
- */
-struct Coin
-{
-
-  /**
-   * Amount to deposit.
-   */
-  struct TALER_Amount amount;
-
-  /**
-   * Deposit fee.
-   */
-  struct TALER_Amount deposit_fee;
-
-  /**
-   * Reference to any command that is able to provide a coin,
-   * possibly using $LABEL#$INDEX notation.
-   */
-  char *coin_reference;
-
-  /**
-   * The command being referenced.
-   */
-  const struct TALER_TESTING_Command *coin_cmd;
-
-  /**
-   * Index of the coin at @e coin_cmd.
-   */
-  unsigned int coin_idx;
-};
-
-
-/**
- * State for a "batch deposit" CMD.
- */
-struct BatchDepositState
-{
-
-  /**
-   * Refund deadline. Zero for no refunds.
-   */
-  struct GNUNET_TIME_Timestamp refund_deadline;
-
-  /**
-   * Wire deadline.
-   */
-  struct GNUNET_TIME_Timestamp wire_deadline;
-
-  /**
-   * Timestamp of the /deposit operation in the wallet (contract signing time).
-   */
-  struct GNUNET_TIME_Timestamp wallet_timestamp;
-
-  /**
-   * How long do we wait until we retry?
-   */
-  struct GNUNET_TIME_Relative backoff;
-
-  /**
-   * When did the donau receive the deposit?
-   */
-  struct GNUNET_TIME_Timestamp donau_timestamp;
-
-  /**
-   * Signing key used by the donau to sign the
-   * deposit confirmation.
-   */
-  struct DONAU_DonauPublicKeyP donau_pub;
-
-  /**
-   * Set (by the interpreter) to a fresh private key.  This
-   * key will be used to sign the deposit request.
-   */
-  struct TALER_CharityPrivateKeyP charity_priv;
-
-  /**
-   * Deposit handle while operation is running.
-   */
-  struct DONAU_BatchDepositHandle *dh;
-
-  /**
-   * Array of coins to batch-deposit.
-   */
-  struct Coin *coins;
-
-  /**
-   * Wire details of who is depositing -- this would be charity
-   * wire details in a normal scenario.
-   */
-  json_t *wire_details;
-
-  /**
-   * JSON string describing what a proposal is about.
-   */
-  json_t *contract_terms;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Task scheduled to try later.
-   */
-  struct GNUNET_SCHEDULER_Task *retry_task;
-
-  /**
-   * Array of @e num_coins signatures from the donau on the
-   * deposit confirmation.
-   */
-  struct TALER_DonauSignatureP *donau_sigs;
-
-  /**
-   * Reference to previous deposit operation.
-   * Only present if we're supposed to replay the previous deposit.
-   */
-  const char *deposit_reference;
-
-  /**
-   * If @e coin_reference refers to an operation that generated
-   * an array of coins, this value determines which coin to pick.
-   */
-  unsigned int num_coins;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Set to true if the /deposit succeeded
-   * and we now can provide the resulting traits.
-   */
-  bool deposit_succeeded;
-
-};
-
-
-/**
- * Callback to analyze the /batch-deposit response, just used to check if the
- * response code is acceptable.
- *
- * @param cls closure.
- * @param dr deposit response details
- */
-static void
-batch_deposit_cb (void *cls,
-                  const struct DONAU_BatchDepositResult *dr)
-{
-  struct BatchDepositState *ds = cls;
-
-  ds->dh = NULL;
-  if (ds->expected_response_code != dr->hr.http_status)
-  {
-    TALER_TESTING_unexpected_status (ds->is,
-                                     dr->hr.http_status,
-                                     ds->expected_response_code);
-    return;
-  }
-  if (MHD_HTTP_OK == dr->hr.http_status)
-  {
-    if (ds->num_coins != dr->details.ok.num_signatures)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (ds->is);
-      return;
-    }
-    ds->deposit_succeeded = GNUNET_YES;
-    ds->donau_timestamp = dr->details.ok.deposit_timestamp;
-    ds->donau_pub = *dr->details.ok.donau_pub;
-    ds->donau_sigs = GNUNET_memdup (dr->details.ok.donau_sigs,
-                                    dr->details.ok.num_signatures
-                                    * sizeof (struct
-                                              TALER_DonauSignatureP));
-  }
-  TALER_TESTING_interpreter_next (ds->is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-batch_deposit_run (void *cls,
-                   const struct TALER_TESTING_Command *cmd,
-                   struct TALER_TESTING_Interpreter *is)
-{
-  struct BatchDepositState *ds = cls;
-  const struct DONAU_DenomPublicKey *denom_pub;
-  const struct TALER_DenominationSignature *denom_pub_sig;
-  struct DONAU_CharityPublicKeyP charity_pub;
-  struct TALER_PrivateContractHashP h_contract_terms;
-  enum TALER_ErrorCode ec;
-  struct TALER_WireSaltP wire_salt;
-  struct TALER_CharityWireHashP h_wire;
-  const char *payto_uri;
-  struct DONAU_CoinDepositDetail cdds[ds->num_coins];
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_string ("payto_uri",
-                             &payto_uri),
-    GNUNET_JSON_spec_fixed_auto ("salt",
-                                 &wire_salt),
-    GNUNET_JSON_spec_end ()
-  };
-  const char *donau_url
-    = TALER_TESTING_get_donau_url (is);
-
-  (void) cmd;
-  if (NULL == donau_url)
-  {
-    GNUNET_break (0);
-    return;
-  }
-  memset (cdds,
-          0,
-          sizeof (cdds));
-  ds->is = is;
-  GNUNET_assert (NULL != ds->wire_details);
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (ds->wire_details,
-                         spec,
-                         NULL, NULL))
-  {
-    json_dumpf (ds->wire_details,
-                stderr,
-                JSON_INDENT (2));
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      TALER_JSON_contract_hash (ds->contract_terms,
-                                &h_contract_terms))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_JSON_charity_wire_signature_hash (ds->wire_details,
-                                                         &h_wire));
-  if (! GNUNET_TIME_absolute_is_zero (ds->refund_deadline.abs_time))
-  {
-    struct GNUNET_TIME_Relative refund_deadline;
-
-    refund_deadline
-      = GNUNET_TIME_absolute_get_remaining (ds->refund_deadline.abs_time);
-    ds->wire_deadline
-      =
-        GNUNET_TIME_relative_to_timestamp (
-          GNUNET_TIME_relative_multiply (refund_deadline,
-                                         2));
-  }
-  else
-  {
-    ds->refund_deadline = ds->wallet_timestamp;
-    ds->wire_deadline = GNUNET_TIME_timestamp_get ();
-  }
-  GNUNET_CRYPTO_eddsa_key_get_public (&ds->charity_priv.eddsa_priv,
-                                      &charity_pub.eddsa_pub);
-
-  for (unsigned int i = 0; i<ds->num_coins; i++)
-  {
-    struct Coin *coin = &ds->coins[i];
-    struct DONAU_CoinDepositDetail *cdd = &cdds[i];
-    const struct TALER_CoinSpendPrivateKeyP *coin_priv;
-    const struct TALER_AgeCommitmentProof *age_commitment_proof = NULL;
-
-    GNUNET_assert (NULL != coin->coin_reference);
-    cdd->amount = coin->amount;
-    coin->coin_cmd = TALER_TESTING_interpreter_lookup_command (
-      is,
-      coin->coin_reference);
-    if (NULL == coin->coin_cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-
-    if ( (GNUNET_OK !=
-          TALER_TESTING_get_trait_coin_priv (coin->coin_cmd,
-                                             coin->coin_idx,
-                                             &coin_priv)) ||
-         (GNUNET_OK !=
-          TALER_TESTING_get_trait_age_commitment_proof (coin->coin_cmd,
-                                                        coin->coin_idx,
-                                                        &age_commitment_proof))
-         ||
-         (GNUNET_OK !=
-          TALER_TESTING_get_trait_denom_pub (coin->coin_cmd,
-                                             coin->coin_idx,
-                                             &denom_pub)) ||
-         (GNUNET_OK !=
-          TALER_TESTING_get_trait_denom_sig (coin->coin_cmd,
-                                             coin->coin_idx,
-                                             &denom_pub_sig)) )
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    if (NULL != age_commitment_proof)
-    {
-      TALER_age_commitment_hash (&age_commitment_proof->commitment,
-                                 &cdd->h_age_commitment);
-    }
-    coin->deposit_fee = denom_pub->fees.deposit;
-    GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
-                                        &cdd->coin_pub.eddsa_pub);
-    cdd->denom_sig = *denom_pub_sig;
-    cdd->h_denom_pub = denom_pub->h_key;
-    TALER_wallet_deposit_sign (&coin->amount,
-                               &denom_pub->fees.deposit,
-                               &h_wire,
-                               &h_contract_terms,
-                               NULL, /* wallet_data_hash */
-                               &cdd->h_age_commitment,
-                               NULL, /* hash of extensions */
-                               &denom_pub->h_key,
-                               ds->wallet_timestamp,
-                               &charity_pub,
-                               ds->refund_deadline,
-                               coin_priv,
-                               &cdd->coin_sig);
-  }
-
-  GNUNET_assert (NULL == ds->dh);
-  {
-    struct DONAU_DepositContractDetail dcd = {
-      .wire_deadline = ds->wire_deadline,
-      .charity_payto_uri = payto_uri,
-      .wire_salt = wire_salt,
-      .h_contract_terms = h_contract_terms,
-      .policy_details = NULL /* FIXME #7270-OEC */,
-      .wallet_timestamp = ds->wallet_timestamp,
-      .charity_pub = charity_pub,
-      .refund_deadline = ds->refund_deadline
-    };
-
-    ds->dh = DONAU_batch_deposit (
-      TALER_TESTING_interpreter_get_context (is),
-      donau_url,
-      TALER_TESTING_get_keys (is),
-      &dcd,
-      ds->num_coins,
-      cdds,
-      &batch_deposit_cb,
-      ds,
-      &ec);
-  }
-  if (NULL == ds->dh)
-  {
-    GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Could not create deposit with EC %d\n",
-                (int) ec);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-}
-
-
-/**
- * Free the state of a "batch-deposit" CMD, and possibly cancel a
- * pending operation thereof.
- *
- * @param cls closure, must be a `struct BatchDepositState`.
- * @param cmd the command which is being cleaned up.
- */
-static void
-batch_deposit_cleanup (void *cls,
-                       const struct TALER_TESTING_Command *cmd)
-{
-  struct BatchDepositState *ds = cls;
-
-  if (NULL != ds->dh)
-  {
-    TALER_TESTING_command_incomplete (ds->is,
-                                      cmd->label);
-    DONAU_batch_deposit_cancel (ds->dh);
-    ds->dh = NULL;
-  }
-  if (NULL != ds->retry_task)
-  {
-    GNUNET_SCHEDULER_cancel (ds->retry_task);
-    ds->retry_task = NULL;
-  }
-  for (unsigned int i = 0; i<ds->num_coins; i++)
-    GNUNET_free (ds->coins[i].coin_reference);
-  GNUNET_free (ds->coins);
-  GNUNET_free (ds->donau_sigs);
-  json_decref (ds->wire_details);
-  json_decref (ds->contract_terms);
-  GNUNET_free (ds);
-}
-
-
-/**
- * Offer internal data from a "batch-deposit" CMD, to other commands.
- *
- * @param cls closure.
- * @param[out] ret result.
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-batch_deposit_traits (void *cls,
-                      const void **ret,
-                      const char *trait,
-                      unsigned int index)
-{
-  struct BatchDepositState *ds = cls;
-  struct Coin *coin = &ds->coins[index];
-  /* Will point to coin cmd internals. */
-  const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv;
-  const struct TALER_AgeCommitmentProof *age_commitment_proof;
-
-  if (index >= ds->num_coins)
-  {
-    GNUNET_break (0);
-    return GNUNET_NO;
-  }
-  if (NULL == coin->coin_cmd)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (ds->is);
-    return GNUNET_NO;
-  }
-  if ( (GNUNET_OK !=
-        TALER_TESTING_get_trait_coin_priv (coin->coin_cmd,
-                                           coin->coin_idx,
-                                           &coin_spent_priv)) ||
-       (GNUNET_OK !=
-        TALER_TESTING_get_trait_age_commitment_proof (coin->coin_cmd,
-                                                      coin->coin_idx,
-                                                      &age_commitment_proof)) )
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (ds->is);
-    return GNUNET_NO;
-  }
-  {
-    struct TALER_TESTING_Trait traits[] = {
-      /* First two traits are only available if
-         ds->traits is #GNUNET_YES */
-      TALER_TESTING_make_trait_donau_pub (index,
-                                          &ds->donau_pub),
-      TALER_TESTING_make_trait_donau_sig (index,
-                                          &ds->donau_sigs[index]),
-      /* These traits are always available */
-      TALER_TESTING_make_trait_wire_details (ds->wire_details),
-      TALER_TESTING_make_trait_contract_terms (ds->contract_terms),
-      TALER_TESTING_make_trait_charity_priv (&ds->charity_priv),
-      TALER_TESTING_make_trait_age_commitment_proof (index,
-                                                     age_commitment_proof),
-      TALER_TESTING_make_trait_coin_priv (index,
-                                          coin_spent_priv),
-      TALER_TESTING_make_trait_deposit_amount (index,
-                                               &coin->amount),
-      TALER_TESTING_make_trait_deposit_fee_amount (index,
-                                                   &coin->deposit_fee),
-
-      TALER_TESTING_make_trait_timestamp (index,
-                                          &ds->donau_timestamp),
-      TALER_TESTING_make_trait_wire_deadline (index,
-                                              &ds->wire_deadline),
-      TALER_TESTING_make_trait_refund_deadline (index,
-                                                &ds->refund_deadline),
-      TALER_TESTING_trait_end ()
-    };
-
-    return TALER_TESTING_get_trait ((ds->deposit_succeeded)
-                                    ? traits
-                                    : &traits[2],
-                                    ret,
-                                    trait,
-                                    index);
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_batch_deposit (const char *label,
-                                 const char *target_account_payto,
-                                 const char *contract_terms,
-                                 struct GNUNET_TIME_Relative refund_deadline,
-                                 unsigned int expected_response_code,
-                                 ...)
-{
-  struct BatchDepositState *ds;
-  va_list ap;
-  unsigned int num_coins = 0;
-  const char *ref;
-
-  va_start (ap,
-            expected_response_code);
-  while (NULL != (ref = va_arg (ap,
-                                const char *)))
-  {
-    GNUNET_assert (NULL != va_arg (ap,
-                                   const char *));
-    num_coins++;
-  }
-  va_end (ap);
-
-  ds = GNUNET_new (struct BatchDepositState);
-  ds->num_coins = num_coins;
-  ds->coins = GNUNET_new_array (num_coins,
-                                struct Coin);
-  num_coins = 0;
-  va_start (ap,
-            expected_response_code);
-  while (NULL != (ref = va_arg (ap,
-                                const char *)))
-  {
-    struct Coin *coin = &ds->coins[num_coins++];
-    const char *amount = va_arg (ap,
-                                 const char *);
-
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_TESTING_parse_coin_reference (ref,
-                                                       &coin->coin_reference,
-                                                       &coin->coin_idx));
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_string_to_amount (amount,
-                                           &coin->amount));
-  }
-  va_end (ap);
-
-  ds->wire_details = TALER_TESTING_make_wire_details (target_account_payto);
-  GNUNET_assert (NULL != ds->wire_details);
-  ds->contract_terms = json_loads (contract_terms,
-                                   JSON_REJECT_DUPLICATES,
-                                   NULL);
-  GNUNET_CRYPTO_eddsa_key_create (&ds->charity_priv.eddsa_priv);
-  if (NULL == ds->contract_terms)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Failed to parse contract terms `%s' for CMD `%s'\n",
-                contract_terms,
-                label);
-    GNUNET_assert (0);
-  }
-  ds->wallet_timestamp = GNUNET_TIME_timestamp_get ();
-  GNUNET_assert (0 ==
-                 json_object_set_new (ds->contract_terms,
-                                      "timestamp",
-                                      GNUNET_JSON_from_timestamp (
-                                        ds->wallet_timestamp)));
-  if (! GNUNET_TIME_relative_is_zero (refund_deadline))
-  {
-    ds->refund_deadline = GNUNET_TIME_relative_to_timestamp (refund_deadline);
-    GNUNET_assert (0 ==
-                   json_object_set_new (ds->contract_terms,
-                                        "refund_deadline",
-                                        GNUNET_JSON_from_timestamp (
-                                          ds->refund_deadline)));
-  }
-  ds->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ds,
-      .label = label,
-      .run = &batch_deposit_run,
-      .cleanup = &batch_deposit_cleanup,
-      .traits = &batch_deposit_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_batch_deposit.c */
diff --git a/src/testing/testing_api_cmd_batch_withdraw.c 
b/src/testing/testing_api_cmd_batch_withdraw.c
deleted file mode 100644
index 74ba0f1..0000000
--- a/src/testing/testing_api_cmd_batch_withdraw.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2018-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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_batch_withdraw.c
- * @brief implements the batch withdraw command
- * @author Christian Grothoff
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler_donau_service.h"
-#include "taler/taler_json_lib.h"
-#include <microhttpd.h>
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler/taler_extensions.h"
-#include "taler_testing_lib.h"
-
-/**
- * Information we track per withdrawn coin.
- */
-struct CoinState
-{
-
-  /**
-   * String describing the denomination value we should withdraw.
-   * A corresponding denomination key must exist in the donau's
-   * offerings.  Can be NULL if @e pk is set instead.
-   */
-  struct TALER_Amount amount;
-
-  /**
-   * If @e amount is NULL, this specifies the denomination key to
-   * use.  Otherwise, this will be set (by the interpreter) to the
-   * denomination PK matching @e amount.
-   */
-  struct DONAU_DenomPublicKey *pk;
-
-  /**
-   * Private key of the coin.
-   */
-  struct TALER_CoinSpendPrivateKeyP coin_priv;
-
-  /**
-   * Blinding key used during the operation.
-   */
-  union TALER_DenominationBlindingKeyP bks;
-
-  /**
-   * Values contributed from the donau during the
-   * withdraw protocol.
-   */
-  struct TALER_DonauWithdrawValues donau_vals;
-
-  /**
-   * Set (by the interpreter) to the donau's signature over the
-   * coin's public key.
-   */
-  struct TALER_DenominationSignature sig;
-
-  /**
-   * Private key material of the coin, set by the interpreter.
-   */
-  struct TALER_PlanchetMasterSecretP ps;
-
-  /**
-   * If age > 0, put here the corresponding age commitment with its proof and
-   * its hash, respectivelly.
-   */
-  struct TALER_AgeCommitmentProof age_commitment_proof;
-  struct TALER_AgeCommitmentHash h_age_commitment;
-
-  /**
-   * Reserve history entry that corresponds to this coin.
-   * Will be of type #DONAU_RTT_WITHDRAWAL.
-   */
-  struct DONAU_ReserveHistoryEntry reserve_history;
-
-
-};
-
-
-/**
- * State for a "batch withdraw" CMD.
- */
-struct BatchWithdrawState
-{
-
-  /**
-   * Which reserve should we withdraw from?
-   */
-  const char *reserve_reference;
-
-  /**
-   * Donau base URL.  Only used as offered trait.
-   */
-  char *donau_url;
-
-  /**
-   * URI if the reserve we are withdrawing from.
-   */
-  char *reserve_payto_uri;
-
-  /**
-   * Private key of the reserve we are withdrawing from.
-   */
-  struct TALER_ReservePrivateKeyP reserve_priv;
-
-  /**
-   * Public key of the reserve we are withdrawing from.
-   */
-  struct TALER_ReservePublicKeyP reserve_pub;
-
-  /**
-   * Interpreter state (during command).
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Withdraw handle (while operation is running).
-   */
-  struct DONAU_BatchWithdrawHandle *wsh;
-
-  /**
-   * Array of coin states.
-   */
-  struct CoinState *coins;
-
-  /**
-   * Set to the KYC requirement payto hash *if* the donau replied with a
-   * request for KYC.
-   */
-  struct TALER_PaytoHashP h_payto;
-
-  /**
-   * Set to the KYC requirement row *if* the donau replied with
-   * a request for KYC.
-   */
-  uint64_t requirement_row;
-
-  /**
-   * Length of the @e coins array.
-   */
-  unsigned int num_coins;
-
-  /**
-   * Expected HTTP response code to the request.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * An age > 0 signifies age restriction is required.
-   * Same for all coins in the batch.
-   */
-  uint8_t age;
-};
-
-
-/**
- * "batch withdraw" operation callback; checks that the
- * response code is expected and store the donau signature
- * in the state.
- *
- * @param cls closure.
- * @param wr withdraw response details
- */
-static void
-reserve_batch_withdraw_cb (void *cls,
-                           const struct
-                           DONAU_BatchWithdrawResponse *wr)
-{
-  struct BatchWithdrawState *ws = cls;
-  struct TALER_TESTING_Interpreter *is = ws->is;
-
-  ws->wsh = NULL;
-  if (ws->expected_response_code != wr->hr.http_status)
-  {
-    TALER_TESTING_unexpected_status (is,
-                                     wr->hr.http_status,
-                                     ws->expected_response_code);
-    return;
-  }
-  switch (wr->hr.http_status)
-  {
-  case MHD_HTTP_OK:
-    for (unsigned int i = 0; i<ws->num_coins; i++)
-    {
-      struct CoinState *cs = &ws->coins[i];
-      const struct DONAU_PrivateCoinDetails *pcd
-        = &wr->details.ok.coins[i];
-
-      TALER_denom_sig_deep_copy (&cs->sig,
-                                 &pcd->sig);
-      cs->coin_priv = pcd->coin_priv;
-      cs->bks = pcd->bks;
-      cs->donau_vals = pcd->donau_vals;
-    }
-    break;
-  case MHD_HTTP_FORBIDDEN:
-    /* nothing to check */
-    break;
-  case MHD_HTTP_NOT_FOUND:
-    /* nothing to check */
-    break;
-  case MHD_HTTP_CONFLICT:
-    /* TODO[oec]: Check if age-requirement is the reason */
-    break;
-  case MHD_HTTP_GONE:
-    /* theoretically could check that the key was actually */
-    break;
-  case MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS:
-    /* nothing to check */
-    ws->requirement_row
-      = wr->details.unavailable_for_legal_reasons.requirement_row;
-    ws->h_payto
-      = wr->details.unavailable_for_legal_reasons.h_payto;
-    break;
-  default:
-    /* Unsupported status code (by test harness) */
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Batch withdraw test command does not support status code 
%u\n",
-                wr->hr.http_status);
-    GNUNET_break (0);
-    break;
-  }
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- */
-static void
-batch_withdraw_run (void *cls,
-                    const struct TALER_TESTING_Command *cmd,
-                    struct TALER_TESTING_Interpreter *is)
-{
-  struct BatchWithdrawState *ws = cls;
-  const struct DONAU_Keys *keys =  TALER_TESTING_get_keys (is);
-  const struct TALER_ReservePrivateKeyP *rp;
-  const struct TALER_TESTING_Command *create_reserve;
-  const struct DONAU_DenomPublicKey *dpk;
-  struct DONAU_WithdrawCoinInput wcis[ws->num_coins];
-
-  (void) cmd;
-  ws->is = is;
-  create_reserve
-    = TALER_TESTING_interpreter_lookup_command (
-        is,
-        ws->reserve_reference);
-
-  if (NULL == create_reserve)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_reserve_priv (create_reserve,
-                                            &rp))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (NULL == ws->donau_url)
-    ws->donau_url
-      = GNUNET_strdup (TALER_TESTING_get_donau_url (is));
-  ws->reserve_priv = *rp;
-  GNUNET_CRYPTO_eddsa_key_get_public (&ws->reserve_priv.eddsa_priv,
-                                      &ws->reserve_pub.eddsa_pub);
-  ws->reserve_payto_uri
-    = TALER_reserve_make_payto (ws->donau_url,
-                                &ws->reserve_pub);
-
-  for (unsigned int i = 0; i<ws->num_coins; i++)
-  {
-    struct CoinState *cs = &ws->coins[i];
-    struct DONAU_WithdrawCoinInput *wci = &wcis[i];
-
-    TALER_planchet_master_setup_random (&cs->ps);
-    dpk = TALER_TESTING_find_pk (keys,
-                                 &cs->amount,
-                                 ws->age > 0);
-    if (NULL == dpk)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Failed to determine denomination key at %s\n",
-                  (NULL != cmd) ? cmd->label : "<retried command>");
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    /* We copy the denomination key, as re-querying /keys
-     * would free the old one. */
-    cs->pk = DONAU_copy_denomination_key (dpk);
-    cs->reserve_history.type = DONAU_RTT_WITHDRAWAL;
-    GNUNET_assert (0 <=
-                   TALER_amount_add (&cs->reserve_history.amount,
-                                     &cs->amount,
-                                     &cs->pk->fees.withdraw));
-    cs->reserve_history.details.withdraw.fee = cs->pk->fees.withdraw;
-
-    wci->pk = cs->pk;
-    wci->ps = &cs->ps;
-    wci->ach = &cs->h_age_commitment;
-  }
-  ws->wsh = DONAU_batch_withdraw (
-    TALER_TESTING_interpreter_get_context (is),
-    TALER_TESTING_get_donau_url (is),
-    keys,
-    rp,
-    ws->num_coins,
-    wcis,
-    &reserve_batch_withdraw_cb,
-    ws);
-  if (NULL == ws->wsh)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-}
-
-
-/**
- * Free the state of a "withdraw" CMD, and possibly cancel
- * a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command being freed.
- */
-static void
-batch_withdraw_cleanup (void *cls,
-                        const struct TALER_TESTING_Command *cmd)
-{
-  struct BatchWithdrawState *ws = cls;
-
-  if (NULL != ws->wsh)
-  {
-    TALER_TESTING_command_incomplete (ws->is,
-                                      cmd->label);
-    DONAU_batch_withdraw_cancel (ws->wsh);
-    ws->wsh = NULL;
-  }
-  for (unsigned int i = 0; i<ws->num_coins; i++)
-  {
-    struct CoinState *cs = &ws->coins[i];
-
-    TALER_denom_sig_free (&cs->sig);
-    if (NULL != cs->pk)
-    {
-      DONAU_destroy_denomination_key (cs->pk);
-      cs->pk = NULL;
-    }
-    if (0 < ws->age)
-      TALER_age_commitment_proof_free (&cs->age_commitment_proof);
-  }
-  GNUNET_free (ws->coins);
-  GNUNET_free (ws->donau_url);
-  GNUNET_free (ws->reserve_payto_uri);
-  GNUNET_free (ws);
-}
-
-
-/**
- * Offer internal data to a "withdraw" CMD state to other
- * commands.
- *
- * @param cls closure
- * @param[out] ret result (could be anything)
- * @param trait name of the trait
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-batch_withdraw_traits (void *cls,
-                       const void **ret,
-                       const char *trait,
-                       unsigned int index)
-{
-  struct BatchWithdrawState *ws = cls;
-  struct CoinState *cs = &ws->coins[index];
-  struct TALER_TESTING_Trait traits[] = {
-    /* history entry MUST be first due to response code logic below! */
-    TALER_TESTING_make_trait_reserve_history (index,
-                                              &cs->reserve_history),
-    TALER_TESTING_make_trait_coin_priv (index,
-                                        &cs->coin_priv),
-    TALER_TESTING_make_trait_planchet_secrets (index,
-                                               &cs->ps),
-    TALER_TESTING_make_trait_blinding_key (index,
-                                           &cs->bks),
-    TALER_TESTING_make_trait_donau_wd_value (index,
-                                             &cs->donau_vals),
-    TALER_TESTING_make_trait_denom_pub (index,
-                                        cs->pk),
-    TALER_TESTING_make_trait_denom_sig (index,
-                                        &cs->sig),
-    TALER_TESTING_make_trait_reserve_priv (&ws->reserve_priv),
-    TALER_TESTING_make_trait_reserve_pub (&ws->reserve_pub),
-    TALER_TESTING_make_trait_amounts (index,
-                                      &cs->amount),
-    TALER_TESTING_make_trait_legi_requirement_row (&ws->requirement_row),
-    TALER_TESTING_make_trait_h_payto (&ws->h_payto),
-    TALER_TESTING_make_trait_payto_uri (ws->reserve_payto_uri),
-    TALER_TESTING_make_trait_donau_url (ws->donau_url),
-    TALER_TESTING_make_trait_age_commitment_proof (index,
-                                                   ws->age > 0 ?
-                                                   &cs->age_commitment_proof:
-                                                   NULL),
-    TALER_TESTING_make_trait_h_age_commitment (index,
-                                               ws->age > 0 ?
-                                               &cs->h_age_commitment :
-                                               NULL),
-    TALER_TESTING_trait_end ()
-  };
-
-  if (index >= ws->num_coins)
-    return GNUNET_NO;
-  return TALER_TESTING_get_trait ((ws->expected_response_code == MHD_HTTP_OK)
-                                  ? &traits[0]   /* we have reserve history */
-                                  : &traits[1],  /* skip reserve history */
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_batch_withdraw (const char *label,
-                                  const char *reserve_reference,
-                                  uint8_t age,
-                                  unsigned int expected_response_code,
-                                  const char *amount,
-                                  ...)
-{
-  struct BatchWithdrawState *ws;
-  unsigned int cnt;
-  va_list ap;
-
-  ws = GNUNET_new (struct BatchWithdrawState);
-  ws->age = age;
-  ws->reserve_reference = reserve_reference;
-  ws->expected_response_code = expected_response_code;
-
-  cnt = 1;
-  va_start (ap, amount);
-  while (NULL != (va_arg (ap, const char *)))
-    cnt++;
-  ws->num_coins = cnt;
-  ws->coins = GNUNET_new_array (cnt,
-                                struct CoinState);
-  va_end (ap);
-  va_start (ap, amount);
-  for (unsigned int i = 0; i<ws->num_coins; i++)
-  {
-    struct CoinState *cs = &ws->coins[i];
-
-    if (0 < age)
-    {
-      struct GNUNET_HashCode seed;
-      struct TALER_AgeMask mask;
-
-      mask = TALER_extensions_get_age_restriction_mask ();
-      GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
-                                  &seed,
-                                  sizeof(seed));
-
-      if (GNUNET_OK !=
-          TALER_age_restriction_commit (
-            &mask,
-            age,
-            &seed,
-            &cs->age_commitment_proof))
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Failed to generate age commitment for age %d at %s\n",
-                    age,
-                    label);
-        GNUNET_assert (0);
-      }
-
-      TALER_age_commitment_hash (&cs->age_commitment_proof.commitment,
-                                 &cs->h_age_commitment);
-    }
-
-    if (GNUNET_OK !=
-        TALER_string_to_amount (amount,
-                                &cs->amount))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Failed to parse amount `%s' at %s\n",
-                  amount,
-                  label);
-      GNUNET_assert (0);
-    }
-    /* move on to next vararg! */
-    amount = va_arg (ap, const char *);
-  }
-  GNUNET_assert (NULL == amount);
-  va_end (ap);
-
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ws,
-      .label = label,
-      .run = &batch_withdraw_run,
-      .cleanup = &batch_withdraw_cleanup,
-      .traits = &batch_withdraw_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_batch_withdraw.c */
diff --git a/src/testing/testing_api_cmd_common.c 
b/src/testing/testing_api_cmd_common.c
deleted file mode 100644
index cc444e0..0000000
--- a/src/testing/testing_api_cmd_common.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2018-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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_common.c
- * @brief common functions for commands
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler_testing_lib.h"
-
-
-int
-TALER_TESTING_history_entry_cmp (
-  const struct DONAU_ReserveHistoryEntry *h1,
-  const struct DONAU_ReserveHistoryEntry *h2)
-{
-  if (h1->type != h2->type)
-    return 1;
-  switch (h1->type)
-  {
-  case DONAU_RTT_CREDIT:
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (0 == strcasecmp (h1->details.in_details.sender_url,
-                           h2->details.in_details.sender_url)) &&
-         (h1->details.in_details.wire_reference ==
-          h2->details.in_details.wire_reference) &&
-         (GNUNET_TIME_timestamp_cmp (h1->details.in_details.timestamp,
-                                     ==,
-                                     h2->details.in_details.timestamp)) )
-      return 0;
-    return 1;
-  case DONAU_RTT_WITHDRAWAL:
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (0 ==
-          TALER_amount_cmp (&h1->details.withdraw.fee,
-                            &h2->details.withdraw.fee)) )
-      /* testing_api_cmd_withdraw doesn't set the out_authorization_sig,
-         so we cannot test for it here. but if the amount matches,
-         that should be good enough. */
-      return 0;
-    return 1;
-  case DONAU_RTT_AGEWITHDRAWAL:
-    /* testing_api_cmd_age_withdraw doesn't set the out_authorization_sig,
-       so we cannot test for it here. but if the amount matches,
-       that should be good enough. */
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (0 ==
-          TALER_amount_cmp (&h1->details.age_withdraw.fee,
-                            &h2->details.age_withdraw.fee)) &&
-         (h1->details.age_withdraw.max_age ==
-          h2->details.age_withdraw.max_age))
-      return 0;
-    return 1;
-  case DONAU_RTT_RECOUP:
-    /* donau_sig, donau_pub and timestamp are NOT available
-       from the original recoup response, hence here NOT check(able/ed) */
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.recoup_details.coin_pub,
-                         &h2->details.recoup_details.coin_pub)) )
-      return 0;
-    return 1;
-  case DONAU_RTT_CLOSING:
-    /* testing_api_cmd_exec_closer doesn't set the
-       receiver_account_details, donau_sig, donau_pub or wtid or timestamp
-       so we cannot test for it here. but if the amount matches,
-       that should be good enough. */
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (0 ==
-          TALER_amount_cmp (&h1->details.close_details.fee,
-                            &h2->details.close_details.fee)) )
-      return 0;
-    return 1;
-  case DONAU_RTT_HISTORY:
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (GNUNET_TIME_timestamp_cmp (
-            h1->details.history_details.request_timestamp,
-            ==,
-            h2->details.history_details.request_timestamp)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.history_details.reserve_sig,
-                         &h2->details.history_details.reserve_sig)) )
-      return 0;
-    return 1;
-  case DONAU_RTT_MERGE:
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (0 ==
-          TALER_amount_cmp (&h1->details.merge_details.purse_fee,
-                            &h2->details.merge_details.purse_fee)) &&
-         (GNUNET_TIME_timestamp_cmp (h1->details.merge_details.merge_timestamp,
-                                     ==,
-                                     
h2->details.merge_details.merge_timestamp))
-         &&
-         (GNUNET_TIME_timestamp_cmp 
(h1->details.merge_details.purse_expiration,
-                                     ==,
-                                     
h2->details.merge_details.purse_expiration))
-         &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.merge_details.merge_pub,
-                         &h2->details.merge_details.merge_pub)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.merge_details.h_contract_terms,
-                         &h2->details.merge_details.h_contract_terms)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.merge_details.purse_pub,
-                         &h2->details.merge_details.purse_pub)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.merge_details.reserve_sig,
-                         &h2->details.merge_details.reserve_sig)) &&
-         (h1->details.merge_details.min_age ==
-          h2->details.merge_details.min_age) &&
-         (h1->details.merge_details.flags ==
-          h2->details.merge_details.flags) )
-      return 0;
-    return 1;
-  case DONAU_RTT_OPEN:
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (GNUNET_TIME_timestamp_cmp (
-            h1->details.open_request.request_timestamp,
-            ==,
-            h2->details.open_request.request_timestamp)) &&
-         (GNUNET_TIME_timestamp_cmp (
-            h1->details.open_request.reserve_expiration,
-            ==,
-            h2->details.open_request.reserve_expiration)) &&
-         (h1->details.open_request.purse_limit ==
-          h2->details.open_request.purse_limit) &&
-         (0 ==
-          TALER_amount_cmp (&h1->details.open_request.reserve_payment,
-                            &h2->details.open_request.reserve_payment)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.open_request.reserve_sig,
-                         &h2->details.open_request.reserve_sig)) )
-      return 0;
-    return 1;
-  case DONAU_RTT_CLOSE:
-    if ( (0 ==
-          TALER_amount_cmp (&h1->amount,
-                            &h2->amount)) &&
-         (GNUNET_TIME_timestamp_cmp (
-            h1->details.close_request.request_timestamp,
-            ==,
-            h2->details.close_request.request_timestamp)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.close_request.target_account_h_payto,
-                         &h2->details.close_request.target_account_h_payto)) &&
-         (0 ==
-          GNUNET_memcmp (&h1->details.close_request.reserve_sig,
-                         &h2->details.close_request.reserve_sig)) )
-      return 0;
-    return 1;
-  }
-  GNUNET_assert (0);
-  return 1;
-}
-
-
-enum GNUNET_GenericReturnValue
-TALER_TESTING_parse_coin_reference (
-  const char *coin_reference,
-  char **cref,
-  unsigned int *idx)
-{
-  const char *index;
-  char dummy;
-
-  /* We allow command references of the form "$LABEL#$INDEX" or
-     just "$LABEL", which implies the index is 0. Figure out
-     which one it is. */
-  index = strchr (coin_reference, '#');
-  if (NULL == index)
-  {
-    *idx = 0;
-    *cref = GNUNET_strdup (coin_reference);
-    return GNUNET_OK;
-  }
-  *cref = GNUNET_strndup (coin_reference,
-                          index - coin_reference);
-  if (1 != sscanf (index + 1,
-                   "%u%c",
-                   idx,
-                   &dummy))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Numeric index (not `%s') required after `#' in command 
reference of command in %s:%u\n",
-                index,
-                __FILE__,
-                __LINE__);
-    GNUNET_free (*cref);
-    *cref = NULL;
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
-}
diff --git a/src/testing/testing_api_cmd_deposit.c 
b/src/testing/testing_api_cmd_deposit.c
deleted file mode 100644
index eb33efe..0000000
--- a/src/testing/testing_api_cmd_deposit.c
+++ /dev/null
@@ -1,791 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2018-2021 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_deposit.c
- * @brief command for testing /deposit.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-#include "taler_signatures.h"
-#include "backoff.h"
-
-
-/**
- * How often do we retry before giving up?
- */
-#define NUM_RETRIES 5
-
-/**
- * How long do we wait AT MOST when retrying?
- */
-#define MAX_BACKOFF GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_MILLISECONDS, 100)
-
-
-/**
- * State for a "deposit" CMD.
- */
-struct DepositState
-{
-
-  /**
-   * Amount to deposit.
-   */
-  struct TALER_Amount amount;
-
-  /**
-   * Deposit fee.
-   */
-  struct TALER_Amount deposit_fee;
-
-  /**
-   * Reference to any command that is able to provide a coin.
-   */
-  const char *coin_reference;
-
-  /**
-   * If @e coin_reference refers to an operation that generated
-   * an array of coins, this value determines which coin to pick.
-   */
-  unsigned int coin_index;
-
-  /**
-   * Wire details of who is depositing -- this would be charity
-   * wire details in a normal scenario.
-   */
-  json_t *wire_details;
-
-  /**
-   * JSON string describing what a proposal is about.
-   */
-  json_t *contract_terms;
-
-  /**
-   * Refund deadline. Zero for no refunds.
-   */
-  struct GNUNET_TIME_Timestamp refund_deadline;
-
-  /**
-   * Wire deadline.
-   */
-  struct GNUNET_TIME_Timestamp wire_deadline;
-
-  /**
-   * Set (by the interpreter) to a fresh private key.  This
-   * key will be used to sign the deposit request.
-   */
-  struct TALER_CharityPrivateKeyP charity_priv;
-
-  /**
-   * Deposit handle while operation is running.
-   */
-  struct DONAU_BatchDepositHandle *dh;
-
-  /**
-   * Timestamp of the /deposit operation in the wallet (contract signing time).
-   */
-  struct GNUNET_TIME_Timestamp wallet_timestamp;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Task scheduled to try later.
-   */
-  struct GNUNET_SCHEDULER_Task *retry_task;
-
-  /**
-   * How long do we wait until we retry?
-   */
-  struct GNUNET_TIME_Relative backoff;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * How often should we retry on (transient) failures?
-   */
-  unsigned int do_retry;
-
-  /**
-   * Set to #GNUNET_YES if the /deposit succeeded
-   * and we now can provide the resulting traits.
-   */
-  int deposit_succeeded;
-
-  /**
-   * When did the donau receive the deposit?
-   */
-  struct GNUNET_TIME_Timestamp donau_timestamp;
-
-  /**
-   * Signing key used by the donau to sign the
-   * deposit confirmation.
-   */
-  struct DONAU_DonauPublicKeyP donau_pub;
-
-  /**
-   * Signature from the donau on the
-   * deposit confirmation.
-   */
-  struct TALER_DonauSignatureP donau_sig;
-
-  /**
-   * Reference to previous deposit operation.
-   * Only present if we're supposed to replay the previous deposit.
-   */
-  const char *deposit_reference;
-
-  /**
-   * Did we set the parameters for this deposit command?
-   *
-   * When we're referencing another deposit operation,
-   * this will only be set after the command has been started.
-   */
-  int command_initialized;
-
-  /**
-   * Reference to fetch the charity private key from.
-   * If NULL, we generate our own, fresh charity key.
-   */
-  const char *charity_priv_reference;
-};
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-deposit_run (void *cls,
-             const struct TALER_TESTING_Command *cmd,
-             struct TALER_TESTING_Interpreter *is);
-
-
-/**
- * Task scheduled to re-try #deposit_run.
- *
- * @param cls a `struct DepositState`
- */
-static void
-do_retry (void *cls)
-{
-  struct DepositState *ds = cls;
-
-  ds->retry_task = NULL;
-  TALER_TESTING_touch_cmd (ds->is);
-  deposit_run (ds,
-               NULL,
-               ds->is);
-}
-
-
-/**
- * Callback to analyze the /deposit response, just used to
- * check if the response code is acceptable.
- *
- * @param cls closure.
- * @param dr deposit response details
- */
-static void
-deposit_cb (void *cls,
-            const struct DONAU_BatchDepositResult *dr)
-{
-  struct DepositState *ds = cls;
-
-  ds->dh = NULL;
-  if (ds->expected_response_code != dr->hr.http_status)
-  {
-    if (0 != ds->do_retry)
-    {
-      ds->do_retry--;
-      if ( (0 == dr->hr.http_status) ||
-           (TALER_EC_GENERIC_DB_SOFT_FAILURE == dr->hr.ec) ||
-           (MHD_HTTP_INTERNAL_SERVER_ERROR == dr->hr.http_status) )
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "Retrying deposit failed with %u/%d\n",
-                    dr->hr.http_status,
-                    (int) dr->hr.ec);
-        /* on DB conflicts, do not use backoff */
-        if (TALER_EC_GENERIC_DB_SOFT_FAILURE == dr->hr.ec)
-          ds->backoff = GNUNET_TIME_UNIT_ZERO;
-        else
-          ds->backoff = GNUNET_TIME_randomized_backoff (ds->backoff,
-                                                        MAX_BACKOFF);
-        TALER_TESTING_inc_tries (ds->is);
-        GNUNET_assert (NULL == ds->retry_task);
-        ds->retry_task
-          = GNUNET_SCHEDULER_add_delayed (ds->backoff,
-                                          &do_retry,
-                                          ds);
-        return;
-      }
-    }
-    TALER_TESTING_unexpected_status_with_body (
-      ds->is,
-      dr->hr.http_status,
-      ds->expected_response_code,
-      dr->hr.reply);
-
-    return;
-  }
-  if (MHD_HTTP_OK == dr->hr.http_status)
-  {
-    GNUNET_assert (1 == dr->details.ok.num_signatures);
-    ds->deposit_succeeded = GNUNET_YES;
-    ds->donau_timestamp = dr->details.ok.deposit_timestamp;
-    ds->donau_pub = *dr->details.ok.donau_pub;
-    ds->donau_sig = dr->details.ok.donau_sigs[0];
-  }
-  TALER_TESTING_interpreter_next (ds->is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-deposit_run (void *cls,
-             const struct TALER_TESTING_Command *cmd,
-             struct TALER_TESTING_Interpreter *is)
-{
-  struct DepositState *ds = cls;
-  const struct TALER_TESTING_Command *coin_cmd;
-  const struct TALER_CoinSpendPrivateKeyP *coin_priv;
-  struct TALER_CoinSpendPublicKeyP coin_pub;
-  const struct TALER_AgeCommitmentHash *phac;
-  const struct DONAU_DenomPublicKey *denom_pub;
-  const struct TALER_DenominationSignature *denom_pub_sig;
-  struct TALER_CoinSpendSignatureP coin_sig;
-  struct DONAU_CharityPublicKeyP charity_pub;
-  struct TALER_PrivateContractHashP h_contract_terms;
-  enum TALER_ErrorCode ec;
-  struct TALER_WireSaltP wire_salt;
-  const char *payto_uri;
-  struct GNUNET_JSON_Specification spec[] = {
-    GNUNET_JSON_spec_string ("payto_uri",
-                             &payto_uri),
-    GNUNET_JSON_spec_fixed_auto ("salt",
-                                 &wire_salt),
-    GNUNET_JSON_spec_end ()
-  };
-  const char *donau_url
-    = TALER_TESTING_get_donau_url (is);
-
-  (void) cmd;
-  if (NULL == donau_url)
-  {
-    GNUNET_break (0);
-    return;
-  }
-  ds->is = is;
-  if (NULL != ds->deposit_reference)
-  {
-    /* We're copying another deposit operation, initialize here. */
-    const struct TALER_TESTING_Command *cmd;
-    struct DepositState *ods;
-
-    cmd = TALER_TESTING_interpreter_lookup_command (is,
-                                                    ds->deposit_reference);
-    if (NULL == cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    ods = cmd->cls;
-    ds->coin_reference = ods->coin_reference;
-    ds->coin_index = ods->coin_index;
-    ds->wire_details = json_incref (ods->wire_details);
-    GNUNET_assert (NULL != ds->wire_details);
-    ds->contract_terms = json_incref (ods->contract_terms);
-    ds->wallet_timestamp = ods->wallet_timestamp;
-    ds->refund_deadline = ods->refund_deadline;
-    ds->amount = ods->amount;
-    ds->charity_priv = ods->charity_priv;
-    ds->command_initialized = GNUNET_YES;
-  }
-  else if (NULL != ds->charity_priv_reference)
-  {
-    /* We're copying the charity key from another deposit operation */
-    const struct TALER_CharityPrivateKeyP *charity_priv;
-    const struct TALER_TESTING_Command *cmd;
-
-    cmd = TALER_TESTING_interpreter_lookup_command (is,
-                                                    
ds->charity_priv_reference);
-    if (NULL == cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    if ( (GNUNET_OK !=
-          TALER_TESTING_get_trait_charity_priv (cmd,
-                                                &charity_priv)) )
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    ds->charity_priv = *charity_priv;
-  }
-  GNUNET_assert (NULL != ds->wire_details);
-  if (GNUNET_OK !=
-      GNUNET_JSON_parse (ds->wire_details,
-                         spec,
-                         NULL, NULL))
-  {
-    json_dumpf (ds->wire_details,
-                stderr,
-                JSON_INDENT (2));
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_assert (ds->coin_reference);
-  coin_cmd = TALER_TESTING_interpreter_lookup_command (is,
-                                                       ds->coin_reference);
-  if (NULL == coin_cmd)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-
-  if ( (GNUNET_OK !=
-        TALER_TESTING_get_trait_coin_priv (coin_cmd,
-                                           ds->coin_index,
-                                           &coin_priv)) ||
-       (GNUNET_OK !=
-        TALER_TESTING_get_trait_h_age_commitment (coin_cmd,
-                                                  ds->coin_index,
-                                                  &phac)) ||
-       (GNUNET_OK !=
-        TALER_TESTING_get_trait_denom_pub (coin_cmd,
-                                           ds->coin_index,
-                                           &denom_pub)) ||
-       (GNUNET_OK !=
-        TALER_TESTING_get_trait_denom_sig (coin_cmd,
-                                           ds->coin_index,
-                                           &denom_pub_sig)) ||
-       (GNUNET_OK !=
-        TALER_JSON_contract_hash (ds->contract_terms,
-                                  &h_contract_terms)) )
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-
-  ds->deposit_fee = denom_pub->fees.deposit;
-  GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
-                                      &coin_pub.eddsa_pub);
-
-  if (! GNUNET_TIME_absolute_is_zero (ds->refund_deadline.abs_time))
-  {
-    struct GNUNET_TIME_Relative refund_deadline;
-
-    refund_deadline
-      = GNUNET_TIME_absolute_get_remaining (ds->refund_deadline.abs_time);
-    ds->wire_deadline
-      =
-        GNUNET_TIME_relative_to_timestamp (
-          GNUNET_TIME_relative_multiply (refund_deadline,
-                                         2));
-  }
-  else
-  {
-    ds->refund_deadline = ds->wallet_timestamp;
-    ds->wire_deadline = GNUNET_TIME_timestamp_get ();
-  }
-  GNUNET_CRYPTO_eddsa_key_get_public (&ds->charity_priv.eddsa_priv,
-                                      &charity_pub.eddsa_pub);
-  {
-    struct TALER_CharityWireHashP h_wire;
-
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_JSON_charity_wire_signature_hash (ds->wire_details,
-                                                           &h_wire));
-    TALER_wallet_deposit_sign (&ds->amount,
-                               &denom_pub->fees.deposit,
-                               &h_wire,
-                               &h_contract_terms,
-                               NULL, /* wallet data hash */
-                               phac,
-                               NULL, /* hash of extensions */
-                               &denom_pub->h_key,
-                               ds->wallet_timestamp,
-                               &charity_pub,
-                               ds->refund_deadline,
-                               coin_priv,
-                               &coin_sig);
-  }
-  GNUNET_assert (NULL == ds->dh);
-  {
-    struct DONAU_CoinDepositDetail cdd = {
-      .amount = ds->amount,
-      .coin_pub = coin_pub,
-      .coin_sig = coin_sig,
-      .denom_sig = *denom_pub_sig,
-      .h_denom_pub = denom_pub->h_key,
-      .h_age_commitment = {{{0}}},
-    };
-    struct DONAU_DepositContractDetail dcd = {
-      .wire_deadline = ds->wire_deadline,
-      .charity_payto_uri = payto_uri,
-      .wire_salt = wire_salt,
-      .h_contract_terms = h_contract_terms,
-      .wallet_timestamp = ds->wallet_timestamp,
-      .charity_pub = charity_pub,
-      .refund_deadline = ds->refund_deadline
-    };
-
-    if (NULL != phac)
-      cdd.h_age_commitment = *phac;
-
-    ds->dh = DONAU_batch_deposit (
-      TALER_TESTING_interpreter_get_context (is),
-      donau_url,
-      TALER_TESTING_get_keys (is),
-      &dcd,
-      1,
-      &cdd,
-      &deposit_cb,
-      ds,
-      &ec);
-  }
-  if (NULL == ds->dh)
-  {
-    GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Could not create deposit with EC %d\n",
-                (int) ec);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-}
-
-
-/**
- * Free the state of a "deposit" CMD, and possibly cancel a
- * pending operation thereof.
- *
- * @param cls closure, must be a `struct DepositState`.
- * @param cmd the command which is being cleaned up.
- */
-static void
-deposit_cleanup (void *cls,
-                 const struct TALER_TESTING_Command *cmd)
-{
-  struct DepositState *ds = cls;
-
-  if (NULL != ds->dh)
-  {
-    TALER_TESTING_command_incomplete (ds->is,
-                                      cmd->label);
-    DONAU_batch_deposit_cancel (ds->dh);
-    ds->dh = NULL;
-  }
-  if (NULL != ds->retry_task)
-  {
-    GNUNET_SCHEDULER_cancel (ds->retry_task);
-    ds->retry_task = NULL;
-  }
-  json_decref (ds->wire_details);
-  json_decref (ds->contract_terms);
-  GNUNET_free (ds);
-}
-
-
-/**
- * Offer internal data from a "deposit" CMD, to other commands.
- *
- * @param cls closure.
- * @param[out] ret result.
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-deposit_traits (void *cls,
-                const void **ret,
-                const char *trait,
-                unsigned int index)
-{
-  struct DepositState *ds = cls;
-  const struct TALER_TESTING_Command *coin_cmd;
-  /* Will point to coin cmd internals. */
-  const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv;
-  const struct TALER_AgeCommitmentProof *age_commitment_proof;
-  const struct TALER_AgeCommitmentHash *h_age_commitment;
-
-  if (GNUNET_YES != ds->command_initialized)
-  {
-    /* No access to traits yet. */
-    GNUNET_break (0);
-    return GNUNET_NO;
-  }
-
-  coin_cmd
-    = TALER_TESTING_interpreter_lookup_command (ds->is,
-                                                ds->coin_reference);
-  if (NULL == coin_cmd)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (ds->is);
-    return GNUNET_NO;
-  }
-  if ( (GNUNET_OK !=
-        TALER_TESTING_get_trait_coin_priv (coin_cmd,
-                                           ds->coin_index,
-                                           &coin_spent_priv)) ||
-       (GNUNET_OK !=
-        TALER_TESTING_get_trait_age_commitment_proof (coin_cmd,
-                                                      ds->coin_index,
-                                                      &age_commitment_proof)) 
||
-       (GNUNET_OK !=
-        TALER_TESTING_get_trait_h_age_commitment (coin_cmd,
-                                                  ds->coin_index,
-                                                  &h_age_commitment)) )
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (ds->is);
-    return GNUNET_NO;
-  }
-
-  {
-    struct TALER_TESTING_Trait traits[] = {
-      /* First two traits are only available if
-         ds->traits is #GNUNET_YES */
-      TALER_TESTING_make_trait_donau_pub (0,
-                                          &ds->donau_pub),
-      TALER_TESTING_make_trait_donau_sig (0,
-                                          &ds->donau_sig),
-      /* These traits are always available */
-      TALER_TESTING_make_trait_coin_priv (0,
-                                          coin_spent_priv),
-      TALER_TESTING_make_trait_age_commitment_proof (0,
-                                                     age_commitment_proof),
-      TALER_TESTING_make_trait_h_age_commitment (0,
-                                                 h_age_commitment),
-      TALER_TESTING_make_trait_wire_details (ds->wire_details),
-      TALER_TESTING_make_trait_contract_terms (ds->contract_terms),
-      TALER_TESTING_make_trait_charity_priv (&ds->charity_priv),
-      TALER_TESTING_make_trait_deposit_amount (0,
-                                               &ds->amount),
-      TALER_TESTING_make_trait_deposit_fee_amount (0,
-                                                   &ds->deposit_fee),
-      TALER_TESTING_make_trait_timestamp (0,
-                                          &ds->donau_timestamp),
-      TALER_TESTING_make_trait_wire_deadline (0,
-                                              &ds->wire_deadline),
-      TALER_TESTING_make_trait_refund_deadline (0,
-                                                &ds->refund_deadline),
-      TALER_TESTING_trait_end ()
-    };
-
-    return TALER_TESTING_get_trait ((ds->deposit_succeeded)
-                                    ? traits
-                                    : &traits[2],
-                                    ret,
-                                    trait,
-                                    index);
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_deposit (const char *label,
-                           const char *coin_reference,
-                           unsigned int coin_index,
-                           const char *target_account_payto,
-                           const char *contract_terms,
-                           struct GNUNET_TIME_Relative refund_deadline,
-                           const char *amount,
-                           unsigned int expected_response_code)
-{
-  struct DepositState *ds;
-
-  ds = GNUNET_new (struct DepositState);
-  ds->coin_reference = coin_reference;
-  ds->coin_index = coin_index;
-  ds->wire_details = TALER_TESTING_make_wire_details (target_account_payto);
-  GNUNET_assert (NULL != ds->wire_details);
-  ds->contract_terms = json_loads (contract_terms,
-                                   JSON_REJECT_DUPLICATES,
-                                   NULL);
-  GNUNET_CRYPTO_eddsa_key_create (&ds->charity_priv.eddsa_priv);
-  if (NULL == ds->contract_terms)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Failed to parse contract terms `%s' for CMD `%s'\n",
-                contract_terms,
-                label);
-    GNUNET_assert (0);
-  }
-  ds->wallet_timestamp = GNUNET_TIME_timestamp_get ();
-  GNUNET_assert (0 ==
-                 json_object_set_new (ds->contract_terms,
-                                      "timestamp",
-                                      GNUNET_JSON_from_timestamp (
-                                        ds->wallet_timestamp)));
-  if (! GNUNET_TIME_relative_is_zero (refund_deadline))
-  {
-    ds->refund_deadline = GNUNET_TIME_relative_to_timestamp (refund_deadline);
-    GNUNET_assert (0 ==
-                   json_object_set_new (ds->contract_terms,
-                                        "refund_deadline",
-                                        GNUNET_JSON_from_timestamp (
-                                          ds->refund_deadline)));
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount (amount,
-                                         &ds->amount));
-  ds->expected_response_code = expected_response_code;
-  ds->command_initialized = GNUNET_YES;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ds,
-      .label = label,
-      .run = &deposit_run,
-      .cleanup = &deposit_cleanup,
-      .traits = &deposit_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_deposit_with_ref (const char *label,
-                                    const char *coin_reference,
-                                    unsigned int coin_index,
-                                    const char *target_account_payto,
-                                    const char *contract_terms,
-                                    struct GNUNET_TIME_Relative 
refund_deadline,
-                                    const char *amount,
-                                    unsigned int expected_response_code,
-                                    const char *charity_priv_reference)
-{
-  struct DepositState *ds;
-
-  ds = GNUNET_new (struct DepositState);
-  ds->charity_priv_reference = charity_priv_reference;
-  ds->coin_reference = coin_reference;
-  ds->coin_index = coin_index;
-  ds->wire_details = TALER_TESTING_make_wire_details (target_account_payto);
-  GNUNET_assert (NULL != ds->wire_details);
-  ds->contract_terms = json_loads (contract_terms,
-                                   JSON_REJECT_DUPLICATES,
-                                   NULL);
-  if (NULL == ds->contract_terms)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Failed to parse contract terms `%s' for CMD `%s'\n",
-                contract_terms,
-                label);
-    GNUNET_assert (0);
-  }
-  ds->wallet_timestamp = GNUNET_TIME_timestamp_get ();
-  GNUNET_assert (0 ==
-                 json_object_set_new (ds->contract_terms,
-                                      "timestamp",
-                                      GNUNET_JSON_from_timestamp (
-                                        ds->wallet_timestamp)));
-  if (0 != refund_deadline.rel_value_us)
-  {
-    ds->refund_deadline = GNUNET_TIME_relative_to_timestamp (refund_deadline);
-    GNUNET_assert (0 ==
-                   json_object_set_new (ds->contract_terms,
-                                        "refund_deadline",
-                                        GNUNET_JSON_from_timestamp (
-                                          ds->refund_deadline)));
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount (amount,
-                                         &ds->amount));
-  ds->expected_response_code = expected_response_code;
-  ds->command_initialized = GNUNET_YES;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ds,
-      .label = label,
-      .run = &deposit_run,
-      .cleanup = &deposit_cleanup,
-      .traits = &deposit_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_deposit_replay (const char *label,
-                                  const char *deposit_reference,
-                                  unsigned int expected_response_code)
-{
-  struct DepositState *ds;
-
-  ds = GNUNET_new (struct DepositState);
-  ds->deposit_reference = deposit_reference;
-  ds->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ds,
-      .label = label,
-      .run = &deposit_run,
-      .cleanup = &deposit_cleanup,
-      .traits = &deposit_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_deposit_with_retry (struct TALER_TESTING_Command cmd)
-{
-  struct DepositState *ds;
-
-  GNUNET_assert (&deposit_run == cmd.run);
-  ds = cmd.cls;
-  ds->do_retry = NUM_RETRIES;
-  return cmd;
-}
-
-
-/* end of testing_api_cmd_deposit.c */
diff --git a/src/testing/testing_api_cmd_deposits_get.c 
b/src/testing/testing_api_cmd_deposits_get.c
deleted file mode 100644
index f3cd853..0000000
--- a/src/testing/testing_api_cmd_deposits_get.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2014-2021 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
-  CHARITYABILITY 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/>
-*/
-
-/**
- * @file testing/testing_api_cmd_deposits_get.c
- * @brief Implement the testing CMDs for the /deposits/ GET operations.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-/**
- * State for a "track transaction" CMD.
- */
-struct TrackTransactionState
-{
-
-  /**
-   * If non NULL, will provide a WTID to be compared against
-   * the one returned by the "track transaction" operation.
-   */
-  const char *bank_transfer_reference;
-
-  /**
-   * Our command.
-   */
-  const struct TALER_TESTING_Command *cmd;
-
-  /**
-   * The WTID associated by the transaction being tracked.
-   */
-  struct TALER_WireTransferIdentifierRawP wtid;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Set to the KYC requirement payto hash *if* the donau replied with a
-   * request for KYC (#MHD_HTTP_ACCEPTED).
-   * Note: set based on our @e charity_payto_uri, as
-   * the donau does not respond with the payto hash.
-   */
-  struct TALER_PaytoHashP h_payto;
-
-  /**
-   * Set to the KYC requirement row *if* the donau replied with
-   * a request for KYC (#MHD_HTTP_ACCEPTED).
-   */
-  uint64_t requirement_row;
-
-  /**
-   * Reference to any operation that can provide a transaction.
-   * Will be the transaction to track.
-   */
-  const char *transaction_reference;
-
-  /**
-   * Payto URI of the charity receiving the deposit.
-   */
-  char *charity_payto_uri;
-
-  /**
-   * Index of the coin involved in the transaction.  Recall:
-   * at the donau, the tracking is done _per coin_.
-   */
-  unsigned int coin_index;
-
-  /**
-   * Handle to the "track transaction" pending operation.
-   */
-  struct DONAU_DepositGetHandle *tth;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-};
-
-
-/**
- * Checks what is returned by the "track transaction" operation.
- * Checks that the HTTP response code is acceptable, and - if the
- * right reference is non NULL - that the wire transfer subject
- * line matches our expectations.
- *
- * @param cls closure.
- * @param dr GET deposit response details
- */
-static void
-deposit_wtid_cb (void *cls,
-                 const struct DONAU_GetDepositResponse *dr)
-{
-  struct TrackTransactionState *tts = cls;
-  struct TALER_TESTING_Interpreter *is = tts->is;
-
-  tts->tth = NULL;
-  if (tts->expected_response_code != dr->hr.http_status)
-  {
-    TALER_TESTING_unexpected_status (is,
-                                     dr->hr.http_status,
-                                     tts->expected_response_code);
-    return;
-  }
-  switch (dr->hr.http_status)
-  {
-  case MHD_HTTP_OK:
-    tts->wtid = dr->details.ok.wtid;
-    if (NULL != tts->bank_transfer_reference)
-    {
-      const struct TALER_TESTING_Command *bank_transfer_cmd;
-      const struct TALER_WireTransferIdentifierRawP *wtid_want;
-
-      /* _this_ wire transfer subject line.  */
-      bank_transfer_cmd
-        = TALER_TESTING_interpreter_lookup_command (is,
-                                                    
tts->bank_transfer_reference);
-      if (NULL == bank_transfer_cmd)
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-
-      if (GNUNET_OK !=
-          TALER_TESTING_get_trait_wtid (bank_transfer_cmd,
-                                        &wtid_want))
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-
-      /* Compare that expected and gotten subjects match.  */
-      if (0 != GNUNET_memcmp (&dr->details.ok.wtid,
-                              wtid_want))
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (tts->is);
-        return;
-      }
-    }
-    break;
-  case MHD_HTTP_ACCEPTED:
-    /* allowed, nothing to check here */
-    TALER_payto_hash (tts->charity_payto_uri,
-                      &tts->h_payto);
-    tts->requirement_row
-      = dr->details.accepted.requirement_row;
-    break;
-  case MHD_HTTP_NOT_FOUND:
-    /* allowed, nothing to check here */
-    break;
-  default:
-    GNUNET_break (0);
-    break;
-  }
-  TALER_TESTING_interpreter_next (tts->is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-track_transaction_run (void *cls,
-                       const struct TALER_TESTING_Command *cmd,
-                       struct TALER_TESTING_Interpreter *is)
-{
-  struct TrackTransactionState *tts = cls;
-  const struct TALER_TESTING_Command *transaction_cmd;
-  const struct TALER_CoinSpendPrivateKeyP *coin_priv;
-  struct TALER_CoinSpendPublicKeyP coin_pub;
-  const json_t *contract_terms;
-  const json_t *wire_details;
-  struct TALER_CharityWireHashP h_wire_details;
-  struct TALER_PrivateContractHashP h_contract_terms;
-  const struct TALER_CharityPrivateKeyP *charity_priv;
-
-  tts->cmd = cmd;
-  tts->is = is;
-  transaction_cmd
-    = TALER_TESTING_interpreter_lookup_command (tts->is,
-                                                tts->transaction_reference);
-  if (NULL == transaction_cmd)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tts->is);
-    return;
-  }
-
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_coin_priv (transaction_cmd,
-                                         tts->coin_index,
-                                         &coin_priv))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tts->is);
-    return;
-  }
-
-  GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
-                                      &coin_pub.eddsa_pub);
-
-  /* Get the strings.. */
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_wire_details (transaction_cmd,
-                                            &wire_details))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tts->is);
-    return;
-  }
-  tts->charity_payto_uri
-    = GNUNET_strdup (json_string_value (json_object_get (wire_details,
-                                                         "payto_uri")));
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_contract_terms (transaction_cmd,
-                                              &contract_terms))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tts->is);
-    return;
-  }
-
-  if ( (NULL == wire_details) ||
-       (NULL == contract_terms) )
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tts->is);
-    return;
-  }
-
-  /* Should not fail here, json has been parsed already */
-  GNUNET_assert
-    ( (GNUNET_OK ==
-       TALER_JSON_charity_wire_signature_hash (wire_details,
-                                               &h_wire_details)) &&
-    (GNUNET_OK ==
-     TALER_JSON_contract_hash (contract_terms,
-                               &h_contract_terms)) );
-
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_charity_priv (transaction_cmd,
-                                            &charity_priv))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (tts->is);
-    return;
-  }
-
-  tts->tth = DONAU_deposits_get (
-    TALER_TESTING_interpreter_get_context (is),
-    TALER_TESTING_get_donau_url (is),
-    TALER_TESTING_get_keys (is),
-    charity_priv,
-    &h_wire_details,
-    &h_contract_terms,
-    &coin_pub,
-    GNUNET_TIME_UNIT_ZERO,
-    &deposit_wtid_cb,
-    tts);
-  GNUNET_assert (NULL != tts->tth);
-}
-
-
-/**
- * Cleanup the state from a "track transaction" CMD, and possibly
- * cancel a operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-track_transaction_cleanup (void *cls,
-                           const struct TALER_TESTING_Command *cmd)
-{
-  struct TrackTransactionState *tts = cls;
-
-  if (NULL != tts->tth)
-  {
-    TALER_TESTING_command_incomplete (tts->is,
-                                      cmd->label);
-    DONAU_deposits_get_cancel (tts->tth);
-    tts->tth = NULL;
-  }
-  GNUNET_free (tts->charity_payto_uri);
-  GNUNET_free (tts);
-}
-
-
-/**
- * Offer internal data from a "track transaction" CMD.
- *
- * @param cls closure.
- * @param[out] ret result (could be anything).
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-track_transaction_traits (void *cls,
-                          const void **ret,
-                          const char *trait,
-                          unsigned int index)
-{
-  struct TrackTransactionState *tts = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_make_trait_wtid (&tts->wtid),
-    TALER_TESTING_make_trait_legi_requirement_row (
-      &tts->requirement_row),
-    TALER_TESTING_make_trait_h_payto (&tts->h_payto),
-    TALER_TESTING_make_trait_payto_uri (tts->charity_payto_uri),
-    TALER_TESTING_trait_end ()
-  };
-
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_track_transaction (const char *label,
-                                     const char *transaction_reference,
-                                     unsigned int coin_index,
-                                     unsigned int expected_response_code,
-                                     const char *bank_transfer_reference)
-{
-  struct TrackTransactionState *tts;
-
-  tts = GNUNET_new (struct TrackTransactionState);
-  tts->transaction_reference = transaction_reference;
-  tts->expected_response_code = expected_response_code;
-  tts->bank_transfer_reference = bank_transfer_reference;
-  tts->coin_index = coin_index;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = tts,
-      .label = label,
-      .run = &track_transaction_run,
-      .cleanup = &track_transaction_cleanup,
-      .traits = &track_transaction_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_deposits_get.c */
diff --git a/src/testing/testing_api_cmd_get_donau.c 
b/src/testing/testing_api_cmd_get_donau.c
deleted file mode 100644
index ea8393b..0000000
--- a/src/testing/testing_api_cmd_get_donau.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
-  This file is part of TALER
-  (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 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_get_donau.c
- * @brief Command to get an donau handle
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "get donau" CMD.
- */
-struct GetDonauState
-{
-
-  /**
-   * Master private key of the donau.
-   */
-  struct TALER_MasterPrivateKeyP master_priv;
-
-  /**
-   * Our interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Donau handle we produced.
-   */
-  struct DONAU_GetKeysHandle *donau;
-
-  /**
-   * Keys of the donau.
-   */
-  struct DONAU_Keys *keys;
-
-  /**
-   * URL of the donau.
-   */
-  char *donau_url;
-
-  /**
-   * Filename of the master private key of the donau.
-   */
-  char *master_priv_file;
-
-  /**
-   * Label of a command to use to obtain existing
-   * keys.
-   */
-  const char *last_keys_ref;
-
-  /**
-   * Last denomination date we received when doing this request.
-   */
-  struct GNUNET_TIME_Timestamp my_denom_date;
-
-  /**
-   * Are we waiting for /keys before continuing?
-   */
-  bool wait_for_keys;
-};
-
-
-/**
- * Function called with information about who is auditing
- * a particular donau and what keys the donau is using.
- *
- * @param cls closure
- * @param kr response from /keys
- * @param[in] keys the keys of the donau
- */
-static void
-cert_cb (void *cls,
-         const struct DONAU_KeysResponse *kr,
-         struct DONAU_Keys *keys)
-{
-  struct GetDonauState *ges = cls;
-  const struct DONAU_HttpResponse *hr = &kr->hr;
-  struct TALER_TESTING_Interpreter *is = ges->is;
-
-  ges->donau = NULL;
-  ges->keys = keys;
-  switch (hr->http_status)
-  {
-  case MHD_HTTP_OK:
-    if (ges->wait_for_keys)
-    {
-      ges->wait_for_keys = false;
-      TALER_TESTING_interpreter_next (is);
-      return;
-    }
-    ges->my_denom_date = kr->details.ok.keys->last_denom_issue_date;
-    return;
-  default:
-    GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "/keys responded with HTTP status %u\n",
-                hr->http_status);
-    if (ges->wait_for_keys)
-    {
-      ges->wait_for_keys = false;
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    return;
-  }
-}
-
-
-/**
- * Run the "get_donau" command.
- *
- * @param cls closure.
- * @param cmd the command currently being executed.
- * @param is the interpreter state.
- */
-static void
-get_donau_run (void *cls,
-               const struct TALER_TESTING_Command *cmd,
-               struct TALER_TESTING_Interpreter *is)
-{
-  struct GetDonauState *ges = cls;
-  struct DONAU_Keys *xkeys = NULL;
-
-  (void) cmd;
-  if (NULL == ges->donau_url)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (NULL != ges->last_keys_ref)
-  {
-    const struct TALER_TESTING_Command *state_cmd;
-    struct DONAU_Keys *old_keys;
-    const char *donau_url;
-    json_t *s_keys;
-
-    state_cmd
-      = TALER_TESTING_interpreter_lookup_command (is,
-                                                  ges->last_keys_ref);
-    if (NULL == state_cmd)
-    {
-      /* Command providing serialized keys not found.  */
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_keys (state_cmd,
-                                      &old_keys))
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    if (NULL == old_keys)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_donau_url (state_cmd,
-                                           &donau_url))
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    if (0 != strcmp (donau_url,
-                     ges->donau_url))
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    s_keys = DONAU_keys_to_json (old_keys);
-    if (NULL == s_keys)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    xkeys = DONAU_keys_from_json (s_keys);
-    if (NULL == xkeys)
-    {
-      GNUNET_break (0);
-      json_dumpf (s_keys,
-                  stderr,
-                  JSON_INDENT (2));
-      json_decref (s_keys);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    json_decref (s_keys);
-  }
-  if (NULL != ges->master_priv_file)
-  {
-    if (GNUNET_SYSERR ==
-        GNUNET_CRYPTO_eddsa_key_from_file (ges->master_priv_file,
-                                           GNUNET_YES,
-                                           &ges->master_priv.eddsa_priv))
-    {
-      GNUNET_break (0);
-      DONAU_keys_decref (xkeys);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-  }
-  ges->is = is;
-  ges->donau
-    = DONAU_get_keys (TALER_TESTING_interpreter_get_context (is),
-                      ges->donau_url,
-                      xkeys,
-                      &cert_cb,
-                      ges);
-  DONAU_keys_decref (xkeys);
-  if (NULL == ges->donau)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (! ges->wait_for_keys)
-    TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Cleanup the state.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-get_donau_cleanup (void *cls,
-                   const struct TALER_TESTING_Command *cmd)
-{
-  struct GetDonauState *ges = cls;
-
-  if (NULL != ges->donau)
-  {
-    DONAU_get_keys_cancel (ges->donau);
-    ges->donau = NULL;
-  }
-  DONAU_keys_decref (ges->keys);
-  ges->keys = NULL;
-  GNUNET_free (ges->master_priv_file);
-  GNUNET_free (ges->donau_url);
-  GNUNET_free (ges);
-}
-
-
-/**
- * Offer internal data to a "get_donau" CMD state to other commands.
- *
- * @param cls closure
- * @param[out] ret result (could be anything)
- * @param trait name of the trait
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-get_donau_traits (void *cls,
-                  const void **ret,
-                  const char *trait,
-                  unsigned int index)
-{
-  struct GetDonauState *ges = cls;
-  unsigned int off = (NULL == ges->master_priv_file) ? 1 : 0;
-
-  if (NULL != ges->keys)
-  {
-    struct TALER_TESTING_Trait traits[] = {
-      TALER_TESTING_make_trait_master_priv (&ges->master_priv),
-      TALER_TESTING_make_trait_master_pub (&ges->keys->master_pub),
-      TALER_TESTING_make_trait_keys (ges->keys),
-      TALER_TESTING_make_trait_donau_url (ges->donau_url),
-      TALER_TESTING_make_trait_timestamp (0,
-                                          &ges->my_denom_date),
-      TALER_TESTING_trait_end ()
-    };
-
-    return TALER_TESTING_get_trait (&traits[off],
-                                    ret,
-                                    trait,
-                                    index);
-  }
-  else
-  {
-    struct TALER_TESTING_Trait traits[] = {
-      TALER_TESTING_make_trait_master_priv (&ges->master_priv),
-      TALER_TESTING_make_trait_donau_url (ges->donau_url),
-      TALER_TESTING_make_trait_timestamp (0,
-                                          &ges->my_denom_date),
-      TALER_TESTING_trait_end ()
-    };
-
-    return TALER_TESTING_get_trait (&traits[off],
-                                    ret,
-                                    trait,
-                                    index);
-  }
-}
-
-
-/**
- * Get the base URL of the donau from @a cfg.
- *
- * @param cfg configuration to evaluate
- * @return base URL of the donau according to @a cfg
- */
-static char *
-get_donau_base_url (
-  const struct GNUNET_CONFIGURATION_Handle *cfg)
-{
-  char *donau_url;
-
-  if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_string (cfg,
-                                             "donau",
-                                             "BASE_URL",
-                                             &donau_url))
-  {
-    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-                               "donau",
-                               "BASE_URL");
-    return NULL;
-  }
-  return donau_url;
-}
-
-
-/**
- * Get the file name of the master private key file of the donau from @a
- * cfg.
- *
- * @param cfg configuration to evaluate
- * @return base URL of the donau according to @a cfg
- */
-static char *
-get_donau_master_priv_file (
-  const struct GNUNET_CONFIGURATION_Handle *cfg)
-{
-  char *fn;
-
-  if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_filename (cfg,
-                                               "donau-offline",
-                                               "MASTER_PRIV_FILE",
-                                               &fn))
-  {
-    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-                               "donau-offline",
-                               "MASTER_PRIV_FILE");
-    return NULL;
-  }
-  return fn;
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_get_donau (
-  const char *label,
-  const struct GNUNET_CONFIGURATION_Handle *cfg,
-  const char *last_keys_ref,
-  bool wait_for_keys,
-  bool load_private_key)
-{
-  struct GetDonauState *ges;
-
-  ges = GNUNET_new (struct GetDonauState);
-  ges->donau_url = get_donau_base_url (cfg);
-  ges->last_keys_ref = last_keys_ref;
-  if (load_private_key)
-    ges->master_priv_file = get_donau_master_priv_file (cfg);
-  ges->wait_for_keys = wait_for_keys;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ges,
-      .label = label,
-      .run = &get_donau_run,
-      .cleanup = &get_donau_cleanup,
-      .traits = &get_donau_traits,
-      .name = "donau"
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_insert_deposit.c 
b/src/testing/testing_api_cmd_insert_deposit.c
deleted file mode 100644
index 5696cbb..0000000
--- a/src/testing/testing_api_cmd_insert_deposit.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2018 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_insert_deposit.c
- * @brief deposit a coin directly into the database.
- * @author Marcello Stanisci
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include <taler/taler_util.h>
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler_testing_lib.h"
-#include "donaudb_plugin.h"
-#include "taler_donaudb_lib.h"
-
-
-/**
- * State for a "insert-deposit" CMD.
- */
-struct InsertDepositState
-{
-  /**
-   * Database connection we use.
-   */
-  struct DONAUDB_Plugin *plugin;
-
-  /**
-   * Human-readable name of the shop.
-   */
-  const char *charity_name;
-
-  /**
-   * Charity account name (NOT a payto-URI).
-   */
-  const char *charity_account;
-
-  /**
-   * Deadline before which the aggregator should
-   * send the payment to the charity.
-   */
-  struct GNUNET_TIME_Relative wire_deadline;
-
-  /**
-   * When did the donau receive the deposit?
-   */
-  struct GNUNET_TIME_Timestamp donau_timestamp;
-
-  /**
-   * Amount to deposit, inclusive of deposit fee.
-   */
-  const char *amount_with_fee;
-
-  /**
-   * Deposit fee.
-   */
-  const char *deposit_fee;
-
-  /**
-   * Do we used a cached @e plugin?
-   */
-  bool cached;
-};
-
-/**
- * Setup (fake) information about a coin used in deposit.
- *
- * @param[out] issue information to initialize with "valid" data
- */
-static void
-fake_issue (struct DONAUDB_DenominationKeyInformation *issue)
-{
-  struct GNUNET_TIME_Timestamp now;
-
-  memset (issue,
-          0,
-          sizeof (*issue));
-  now = GNUNET_TIME_timestamp_get ();
-  issue->start
-    = now;
-  issue->expire_withdraw
-    = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_MINUTES);
-  issue->expire_deposit
-    = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_HOURS);
-  issue->expire_legal
-    = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_DAYS);
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount ("EUR:1",
-                                         &issue->value));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount ("EUR:0.1",
-                                         &issue->fees.withdraw));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount ("EUR:0.1",
-                                         &issue->fees.deposit));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount ("EUR:0.1",
-                                         &issue->fees.refresh));
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount ("EUR:0.1",
-                                         &issue->fees.refund));
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the commaind being run.
- * @param is interpreter state.
- */
-static void
-insert_deposit_run (void *cls,
-                    const struct TALER_TESTING_Command *cmd,
-                    struct TALER_TESTING_Interpreter *is)
-{
-  struct InsertDepositState *ids = cls;
-  struct DONAUDB_CoinDepositInformation deposit;
-  struct DONAUDB_BatchDeposit bd;
-  struct TALER_CharityPrivateKeyP charity_priv;
-  struct DONAUDB_DenominationKeyInformation issue;
-  struct TALER_DenominationPublicKey dpk;
-  struct TALER_DenominationPrivateKey denom_priv;
-  char *receiver_wire_account;
-
-  (void) cmd;
-  if (NULL == ids->plugin)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      ids->plugin->preflight (ids->plugin->cls))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  fake_issue (&issue);
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_denom_priv_create (&denom_priv,
-                                          &dpk,
-                                          TALER_DENOMINATION_RSA,
-                                          1024));
-  TALER_denom_pub_hash (&dpk,
-                        &issue.denom_hash);
-
-  if ( (GNUNET_OK !=
-        ids->plugin->start (ids->plugin->cls,
-                            "talertestinglib: denomination insertion")) ||
-       (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
-        ids->plugin->insert_denomination_info (ids->plugin->cls,
-                                               &dpk,
-                                               &issue)) ||
-       (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
-        ids->plugin->commit (ids->plugin->cls)) )
-  {
-    TALER_TESTING_interpreter_fail (is);
-    TALER_denom_pub_free (&dpk);
-    TALER_denom_priv_free (&denom_priv);
-    return;
-  }
-
-  /* prepare and store deposit now. */
-  memset (&deposit,
-          0,
-          sizeof (deposit));
-  memset (&bd,
-          0,
-          sizeof (bd));
-  bd.cdis = &deposit;
-  bd.num_cdis = 1;
-
-  GNUNET_assert (
-    GNUNET_YES ==
-    GNUNET_CRYPTO_kdf (&charity_priv,
-                       sizeof (struct TALER_CharityPrivateKeyP),
-                       "charity-priv",
-                       strlen ("charity-priv"),
-                       ids->charity_name,
-                       strlen (ids->charity_name),
-                       NULL,
-                       0));
-  GNUNET_CRYPTO_eddsa_key_get_public (&charity_priv.eddsa_priv,
-                                      &bd.charity_pub.eddsa_pub);
-  GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
-                                    &bd.h_contract_terms.hash);
-  if (GNUNET_OK !=
-      TALER_string_to_amount (ids->amount_with_fee,
-                              &deposit.amount_with_fee))
-  {
-    TALER_TESTING_interpreter_fail (is);
-    TALER_denom_pub_free (&dpk);
-    TALER_denom_priv_free (&denom_priv);
-    return;
-  }
-
-  TALER_denom_pub_hash (&dpk,
-                        &deposit.coin.denom_pub_hash);
-  GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
-                              &deposit.coin.coin_pub,
-                              sizeof (deposit.coin.coin_pub));
-  {
-    struct TALER_CoinPubHashP c_hash;
-    struct TALER_PlanchetDetail pd;
-    struct TALER_BlindedDenominationSignature bds;
-    struct TALER_PlanchetMasterSecretP ps;
-    struct TALER_DonauWithdrawValues alg_values;
-    union TALER_DenominationBlindingKeyP bks;
-
-    alg_values.cipher = TALER_DENOMINATION_RSA;
-    TALER_planchet_blinding_secret_create (&ps,
-                                           &alg_values,
-                                           &bks);
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_denom_blind (&dpk,
-                                      &bks,
-                                      NULL, /* no age restriction active */
-                                      &deposit.coin.coin_pub,
-                                      &alg_values,
-                                      &c_hash,
-                                      &pd.blinded_planchet));
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_denom_sign_blinded (&bds,
-                                             &denom_priv,
-                                             false,
-                                             &pd.blinded_planchet));
-    TALER_blinded_planchet_free (&pd.blinded_planchet);
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_denom_sig_unblind (&deposit.coin.denom_sig,
-                                            &bds,
-                                            &bks,
-                                            &c_hash,
-                                            &alg_values,
-                                            &dpk));
-    TALER_blinded_denom_sig_free (&bds);
-  }
-  GNUNET_asprintf (&receiver_wire_account,
-                   "payto://x-taler-bank/localhost/%s?receiver-name=%s",
-                   ids->charity_account,
-                   ids->charity_account);
-  bd.receiver_wire_account = receiver_wire_account;
-  TALER_payto_hash (bd.receiver_wire_account,
-                    &bd.wire_target_h_payto);
-  memset (&bd.wire_salt,
-          46,
-          sizeof (bd.wire_salt));
-  bd.wallet_timestamp = GNUNET_TIME_timestamp_get ();
-  bd.wire_deadline = GNUNET_TIME_relative_to_timestamp (
-    ids->wire_deadline);
-  /* finally, actually perform the DB operation */
-  {
-    uint64_t known_coin_id;
-    struct TALER_DenominationHashP dph;
-    struct TALER_AgeCommitmentHash agh;
-    bool balance_ok;
-    uint32_t bad_index;
-    bool ctr_conflict;
-
-    if ( (GNUNET_OK !=
-          ids->plugin->start (ids->plugin->cls,
-                              "libtalertesting: insert deposit")) ||
-         (0 >
-          ids->plugin->ensure_coin_known (ids->plugin->cls,
-                                          &deposit.coin,
-                                          &known_coin_id,
-                                          &dph,
-                                          &agh)) ||
-         (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
-          ids->plugin->do_deposit (ids->plugin->cls,
-                                   &bd,
-                                   &ids->donau_timestamp,
-                                   &balance_ok,
-                                   &bad_index,
-                                   &ctr_conflict)) ||
-         (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
-          ids->plugin->commit (ids->plugin->cls)) )
-    {
-      GNUNET_break (0);
-      ids->plugin->rollback (ids->plugin->cls);
-      GNUNET_free (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);
-  TALER_denom_pub_free (&dpk);
-  TALER_denom_priv_free (&denom_priv);
-  GNUNET_free (receiver_wire_account);
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Free the state of a "auditor-dbinit" CMD, and possibly kills its
- * process if it did not terminate correctly.
- *
- * @param cls closure.
- * @param cmd the command being freed.
- */
-static void
-insert_deposit_cleanup (void *cls,
-                        const struct TALER_TESTING_Command *cmd)
-{
-  struct InsertDepositState *ids = cls;
-
-  (void) cmd;
-  if ( (NULL != ids->plugin) &&
-       (! ids->cached) )
-  {
-    // FIXME: historically, we also did:
-    // ids->plugin->drop_tables (ids->plugin->cls);
-    DONAUDB_plugin_unload (ids->plugin);
-    ids->plugin = NULL;
-  }
-  GNUNET_free (ids);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_insert_deposit (
-  const char *label,
-  const struct GNUNET_CONFIGURATION_Handle *db_cfg,
-  const char *charity_name,
-  const char *charity_account,
-  struct GNUNET_TIME_Timestamp donau_timestamp,
-  struct GNUNET_TIME_Relative wire_deadline,
-  const char *amount_with_fee,
-  const char *deposit_fee)
-{
-  static struct DONAUDB_Plugin *pluginc;
-  static const struct GNUNET_CONFIGURATION_Handle *db_cfgc;
-  struct InsertDepositState *ids;
-
-  ids = GNUNET_new (struct InsertDepositState);
-  if (db_cfgc == db_cfg)
-  {
-    ids->plugin = pluginc;
-    ids->cached = true;
-  }
-  else
-  {
-    ids->plugin = DONAUDB_plugin_load (db_cfg);
-    pluginc = ids->plugin;
-    db_cfgc = db_cfg;
-  }
-  ids->charity_name = charity_name;
-  ids->charity_account = charity_account;
-  ids->donau_timestamp = donau_timestamp;
-  ids->wire_deadline = wire_deadline;
-  ids->amount_with_fee = amount_with_fee;
-  ids->deposit_fee = deposit_fee;
-
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ids,
-      .label = label,
-      .run = &insert_deposit_run,
-      .cleanup = &insert_deposit_cleanup
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_insert_deposit.c */
diff --git a/src/testing/testing_api_cmd_offline_sign_extensions.c 
b/src/testing/testing_api_cmd_offline_sign_extensions.c
deleted file mode 100644
index 353409f..0000000
--- a/src/testing/testing_api_cmd_offline_sign_extensions.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 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
-  CHARITYABILITY 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/>
-*/
-
-/**
- * @file testing/testing_api_cmd_offline_sign_extensions.c
- * @brief run the taler-donau-offline command to sign extensions (and 
therefore activate them)
- * @author Özgür Kesim
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "extensionssign" CMD.
- */
-struct ExtensionsSignState
-{
-
-  /**
-   * Process for the "extensionssign" command.
-   */
-  struct GNUNET_OS_Process *extensionssign_proc;
-
-  /**
-   * Configuration file used by the command.
-   */
-  const char *config_filename;
-
-};
-
-
-/**
- * Run the command; calls the `taler-donau-offline' program.
- *
- * @param cls closure.
- * @param cmd the commaind being run.
- * @param is interpreter state.
- */
-static void
-extensionssign_run (void *cls,
-                    const struct TALER_TESTING_Command *cmd,
-                    struct TALER_TESTING_Interpreter *is)
-{
-  struct ExtensionsSignState *ks = cls;
-
-  ks->extensionssign_proc
-    = GNUNET_OS_start_process (
-        GNUNET_OS_INHERIT_STD_ALL,
-        NULL, NULL, NULL,
-        "taler-donau-offline",
-        "taler-donau-offline",
-        "-c", ks->config_filename,
-        "-L", "INFO",
-        "extensions",
-        "sign",
-        "upload",
-        NULL);
-  if (NULL == ks->extensionssign_proc)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  TALER_TESTING_wait_for_sigchld (is);
-}
-
-
-/**
- * Free the state of a "extensionssign" CMD, and possibly kills its
- * process if it did not terminate correctly.
- *
- * @param cls closure.
- * @param cmd the command being freed.
- */
-static void
-extensionssign_cleanup (void *cls,
-                        const struct TALER_TESTING_Command *cmd)
-{
-  struct ExtensionsSignState *ks = cls;
-
-  (void) cmd;
-  if (NULL != ks->extensionssign_proc)
-  {
-    GNUNET_break (0 ==
-                  GNUNET_OS_process_kill (ks->extensionssign_proc,
-                                          SIGKILL));
-    GNUNET_OS_process_wait (ks->extensionssign_proc);
-    GNUNET_OS_process_destroy (ks->extensionssign_proc);
-    ks->extensionssign_proc = NULL;
-  }
-  GNUNET_free (ks);
-}
-
-
-/**
- * Offer "extensionssign" CMD internal data to other commands.
- *
- * @param cls closure.
- * @param[out] ret result
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-extensionssign_traits (void *cls,
-                       const void **ret,
-                       const char *trait,
-                       unsigned int index)
-{
-  struct ExtensionsSignState *ks = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_make_trait_process (&ks->extensionssign_proc),
-    TALER_TESTING_trait_end ()
-  };
-
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_exec_offline_sign_extensions (const char *label,
-                                                const char *config_filename)
-{
-  struct ExtensionsSignState *ks;
-
-  ks = GNUNET_new (struct ExtensionsSignState);
-  ks->config_filename = config_filename;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ks,
-      .label = label,
-      .run = &extensionssign_run,
-      .cleanup = &extensionssign_cleanup,
-      .traits = &extensionssign_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_exec_offline_sign_extensions.c */
diff --git a/src/testing/testing_api_cmd_offline_sign_global_fees.c 
b/src/testing/testing_api_cmd_offline_sign_global_fees.c
deleted file mode 100644
index ee86c94..0000000
--- a/src/testing/testing_api_cmd_offline_sign_global_fees.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 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
-  CHARITYABILITY 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/>
-*/
-
-/**
- * @file testing/testing_api_cmd_offline_sign_global_fees.c
- * @brief run the taler-donau-offline command to download, sign and upload 
global fees
- * @author Marcello Stanisci
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "offlinesign" CMD.
- */
-struct OfflineSignState
-{
-
-  /**
-   * Process for the "offlinesign" command.
-   */
-  struct GNUNET_OS_Process *offlinesign_proc;
-
-  /**
-   * Configuration file used by the command.
-   */
-  const char *config_filename;
-
-  /**
-   * The history fee to sign.
-   */
-  const char *history_fee_s;
-
-  /**
-   * The account fee to sign.
-   */
-  const char *account_fee_s;
-
-  /**
-   * The purse fee to sign.
-   */
-  const char *purse_fee_s;
-
-  /**
-   * When MUST purses time out?
-   */
-  struct GNUNET_TIME_Relative purse_timeout;
-
-  /**
-   * How long do we keep the history?
-   */
-  struct GNUNET_TIME_Relative history_expiration;
-
-  /**
-   * Number of (free) purses per account.
-   */
-  unsigned int num_purses;
-};
-
-
-/**
- * Run the command; calls the `taler-donau-offline' program.
- *
- * @param cls closure.
- * @param cmd the commaind being run.
- * @param is interpreter state.
- */
-static void
-offlinesign_run (void *cls,
-                 const struct TALER_TESTING_Command *cmd,
-                 struct TALER_TESTING_Interpreter *is)
-{
-  struct OfflineSignState *ks = cls;
-  char num_purses[12];
-  char history_expiration[32];
-  char purse_timeout[32];
-
-  GNUNET_snprintf (num_purses,
-                   sizeof (num_purses),
-                   "%u",
-                   ks->num_purses);
-  GNUNET_snprintf (history_expiration,
-                   sizeof (history_expiration),
-                   "%s",
-                   GNUNET_TIME_relative2s (ks->history_expiration,
-                                           false));
-  GNUNET_snprintf (purse_timeout,
-                   sizeof (purse_timeout),
-                   "%s",
-                   GNUNET_TIME_relative2s (ks->purse_timeout,
-                                           false));
-  ks->offlinesign_proc
-    = GNUNET_OS_start_process (
-        GNUNET_OS_INHERIT_STD_ALL,
-        NULL, NULL, NULL,
-        "taler-donau-offline",
-        "taler-donau-offline",
-        "-c", ks->config_filename,
-        "-L", "INFO",
-        "global-fee",
-        "now",
-        ks->history_fee_s,
-        ks->account_fee_s,
-        ks->purse_fee_s,
-        purse_timeout,
-        history_expiration,
-        num_purses,
-        "upload",
-        NULL);
-  if (NULL == ks->offlinesign_proc)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  TALER_TESTING_wait_for_sigchld (is);
-}
-
-
-/**
- * Free the state of a "offlinesign" CMD, and possibly kills its
- * process if it did not terminate correctly.
- *
- * @param cls closure.
- * @param cmd the command being freed.
- */
-static void
-offlinesign_cleanup (void *cls,
-                     const struct TALER_TESTING_Command *cmd)
-{
-  struct OfflineSignState *ks = cls;
-
-  (void) cmd;
-  if (NULL != ks->offlinesign_proc)
-  {
-    GNUNET_break (0 ==
-                  GNUNET_OS_process_kill (ks->offlinesign_proc,
-                                          SIGKILL));
-    GNUNET_OS_process_wait (ks->offlinesign_proc);
-    GNUNET_OS_process_destroy (ks->offlinesign_proc);
-    ks->offlinesign_proc = NULL;
-  }
-  GNUNET_free (ks);
-}
-
-
-/**
- * Offer "offlinesign" CMD internal data to other commands.
- *
- * @param cls closure.
- * @param[out] ret result
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-offlinesign_traits (void *cls,
-                    const void **ret,
-                    const char *trait,
-                    unsigned int index)
-{
-  struct OfflineSignState *ks = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_make_trait_process (&ks->offlinesign_proc),
-    TALER_TESTING_trait_end ()
-  };
-
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_exec_offline_sign_global_fees (
-  const char *label,
-  const char *config_filename,
-  const char *history_fee,
-  const char *account_fee,
-  const char *purse_fee,
-  struct GNUNET_TIME_Relative purse_timeout,
-  struct GNUNET_TIME_Relative history_expiration,
-  unsigned int num_purses)
-{
-  struct OfflineSignState *ks;
-
-  ks = GNUNET_new (struct OfflineSignState);
-  ks->config_filename = config_filename;
-  ks->history_fee_s = history_fee;
-  ks->account_fee_s = account_fee;
-  ks->purse_fee_s = purse_fee;
-  ks->purse_timeout = purse_timeout;
-  ks->history_expiration = history_expiration;
-  ks->num_purses = num_purses;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ks,
-      .label = label,
-      .run = &offlinesign_run,
-      .cleanup = &offlinesign_cleanup,
-      .traits = &offlinesign_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_exec_offline_sign_global_fees.c */
diff --git a/src/testing/testing_api_cmd_offline_sign_keys.c 
b/src/testing/testing_api_cmd_offline_sign_keys.c
deleted file mode 100644
index 967d9ca..0000000
--- a/src/testing/testing_api_cmd_offline_sign_keys.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2020 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
-  CHARITYABILITY 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/>
-*/
-
-/**
- * @file testing/testing_api_cmd_offline_sign_keys.c
- * @brief run the taler-donau-offline command to download, sign and upload keys
- * @author Marcello Stanisci
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "offlinesign" CMD.
- */
-struct OfflineSignState
-{
-
-  /**
-   * Process for the "offlinesign" command.
-   */
-  struct GNUNET_OS_Process *offlinesign_proc;
-
-  /**
-   * Configuration file used by the command.
-   */
-  const char *config_filename;
-
-};
-
-
-/**
- * Run the command; calls the `taler-donau-offline' program.
- *
- * @param cls closure.
- * @param cmd the commaind being run.
- * @param is interpreter state.
- */
-static void
-offlinesign_run (void *cls,
-                 const struct TALER_TESTING_Command *cmd,
-                 struct TALER_TESTING_Interpreter *is)
-{
-  struct OfflineSignState *ks = cls;
-
-  ks->offlinesign_proc
-    = GNUNET_OS_start_process (
-        GNUNET_OS_INHERIT_STD_ALL,
-        NULL, NULL, NULL,
-        "taler-donau-offline",
-        "taler-donau-offline",
-        "-c", ks->config_filename,
-        "-L", "INFO",
-        "download",
-        "sign",
-        "upload",
-        NULL);
-  if (NULL == ks->offlinesign_proc)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  TALER_TESTING_wait_for_sigchld (is);
-}
-
-
-/**
- * Free the state of a "offlinesign" CMD, and possibly kills its
- * process if it did not terminate correctly.
- *
- * @param cls closure.
- * @param cmd the command being freed.
- */
-static void
-offlinesign_cleanup (void *cls,
-                     const struct TALER_TESTING_Command *cmd)
-{
-  struct OfflineSignState *ks = cls;
-
-  (void) cmd;
-  if (NULL != ks->offlinesign_proc)
-  {
-    GNUNET_break (0 ==
-                  GNUNET_OS_process_kill (ks->offlinesign_proc,
-                                          SIGKILL));
-    GNUNET_OS_process_wait (ks->offlinesign_proc);
-    GNUNET_OS_process_destroy (ks->offlinesign_proc);
-    ks->offlinesign_proc = NULL;
-  }
-  GNUNET_free (ks);
-}
-
-
-/**
- * Offer "offlinesign" CMD internal data to other commands.
- *
- * @param cls closure.
- * @param[out] ret result
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-offlinesign_traits (void *cls,
-                    const void **ret,
-                    const char *trait,
-                    unsigned int index)
-{
-  struct OfflineSignState *ks = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_make_trait_process (&ks->offlinesign_proc),
-    TALER_TESTING_trait_end ()
-  };
-
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_exec_offline_sign_keys (const char *label,
-                                          const char *config_filename)
-{
-  struct OfflineSignState *ks;
-
-  ks = GNUNET_new (struct OfflineSignState);
-  ks->config_filename = config_filename;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ks,
-      .label = label,
-      .run = &offlinesign_run,
-      .cleanup = &offlinesign_cleanup,
-      .traits = &offlinesign_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_exec_offline_sign_keys.c */
diff --git a/src/testing/testing_api_cmd_reserve_close.c 
b/src/testing/testing_api_cmd_reserve_close.c
deleted file mode 100644
index 7436d98..0000000
--- a/src/testing/testing_api_cmd_reserve_close.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
-  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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_reserve_close.c
- * @brief Implement the /reserve/$RID/close test command.
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "close" CMD.
- */
-struct CloseState
-{
-  /**
-   * Label to the command which created the reserve to check,
-   * needed to resort the reserve key.
-   */
-  const char *reserve_reference;
-
-  /**
-   * Handle to the "reserve close" operation.
-   */
-  struct DONAU_ReservesCloseHandle *rsh;
-
-  /**
-   * payto://-URI where to wire the funds.
-   */
-  const char *target_account;
-
-  /**
-   * Private key of the reserve being analyzed.
-   */
-  const struct TALER_ReservePrivateKeyP *reserve_priv;
-
-  /**
-   * Public key of the reserve being analyzed.
-   */
-  struct TALER_ReservePublicKeyP reserve_pub;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Set to the KYC requirement payto hash *if* the donau replied with a
-   * request for KYC.
-   */
-  struct TALER_PaytoHashP h_payto;
-
-  /**
-   * Set to the KYC requirement row *if* the donau replied with
-   * a request for KYC.
-   */
-  uint64_t requirement_row;
-};
-
-
-/**
- * Check that the reserve balance and HTTP response code are
- * both acceptable.
- *
- * @param cls closure.
- * @param rs HTTP response details
- */
-static void
-reserve_close_cb (void *cls,
-                  const struct DONAU_ReserveCloseResult *rs)
-{
-  struct CloseState *ss = cls;
-  struct TALER_TESTING_Interpreter *is = ss->is;
-
-  ss->rsh = NULL;
-  if (ss->expected_response_code != rs->hr.http_status)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected HTTP response code: %d in %s:%u\n",
-                rs->hr.http_status,
-                __FILE__,
-                __LINE__);
-    json_dumpf (rs->hr.reply,
-                stderr,
-                JSON_INDENT (2));
-    TALER_TESTING_interpreter_fail (ss->is);
-    return;
-  }
-  switch (rs->hr.http_status)
-  {
-  case MHD_HTTP_OK:
-    break;
-  case MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS:
-    /* nothing to check */
-    ss->requirement_row
-      = rs->details.unavailable_for_legal_reasons.requirement_row;
-    ss->h_payto
-      = rs->details.unavailable_for_legal_reasons.h_payto;
-    break;
-  default:
-    break;
-  }
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command being executed.
- * @param is the interpreter state.
- */
-static void
-close_run (void *cls,
-           const struct TALER_TESTING_Command *cmd,
-           struct TALER_TESTING_Interpreter *is)
-{
-  struct CloseState *ss = cls;
-  const struct TALER_TESTING_Command *create_reserve;
-
-  ss->is = is;
-  create_reserve
-    = TALER_TESTING_interpreter_lookup_command (is,
-                                                ss->reserve_reference);
-
-  if (NULL == create_reserve)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_reserve_priv (create_reserve,
-                                            &ss->reserve_priv))
-  {
-    GNUNET_break (0);
-    TALER_LOG_ERROR ("Failed to find reserve_priv for close query\n");
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_CRYPTO_eddsa_key_get_public (&ss->reserve_priv->eddsa_priv,
-                                      &ss->reserve_pub.eddsa_pub);
-  ss->rsh = DONAU_reserves_close (
-    TALER_TESTING_interpreter_get_context (is),
-    TALER_TESTING_get_donau_url (is),
-    ss->reserve_priv,
-    ss->target_account,
-    &reserve_close_cb,
-    ss);
-}
-
-
-/**
- * Cleanup the state from a "reserve close" CMD, and possibly
- * cancel a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-close_cleanup (void *cls,
-               const struct TALER_TESTING_Command *cmd)
-{
-  struct CloseState *ss = cls;
-
-  if (NULL != ss->rsh)
-  {
-    TALER_TESTING_command_incomplete (ss->is,
-                                      cmd->label);
-    DONAU_reserves_close_cancel (ss->rsh);
-    ss->rsh = NULL;
-  }
-  GNUNET_free (ss);
-}
-
-
-/**
- * Offer internal data to a "close" CMD state to other
- * commands.
- *
- * @param cls closure
- * @param[out] ret result (could be anything)
- * @param trait name of the trait
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-close_traits (void *cls,
-              const void **ret,
-              const char *trait,
-              unsigned int index)
-{
-  struct CloseState *cs = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_make_trait_legi_requirement_row (
-      &cs->requirement_row),
-    TALER_TESTING_make_trait_h_payto (
-      &cs->h_payto),
-    TALER_TESTING_trait_end ()
-  };
-
-  if (cs->expected_response_code != MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS)
-    return GNUNET_NO;
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_reserve_close (const char *label,
-                                 const char *reserve_reference,
-                                 const char *target_account,
-                                 unsigned int expected_response_code)
-{
-  struct CloseState *ss;
-
-  GNUNET_assert (NULL != reserve_reference);
-  ss = GNUNET_new (struct CloseState);
-  ss->reserve_reference = reserve_reference;
-  ss->target_account = target_account;
-  ss->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ss,
-      .label = label,
-      .run = &close_run,
-      .cleanup = &close_cleanup,
-      .traits = &close_traits
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_reserve_get.c 
b/src/testing/testing_api_cmd_reserve_get.c
deleted file mode 100644
index 988659a..0000000
--- a/src/testing/testing_api_cmd_reserve_get.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
-  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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_reserve_get.c
- * @brief Implement the GET /reserve/$RID test command.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "poll" CMD.
- */
-struct PollState
-{
-
-  /**
-   * How long do we give the donau to respond?
-   */
-  struct GNUNET_TIME_Relative timeout;
-
-  /**
-   * Label to the command which created the reserve to check,
-   * needed to resort the reserve key.
-   */
-  const char *poll_reference;
-
-  /**
-   * Timeout to wait for at most.
-   */
-  struct GNUNET_SCHEDULER_Task *tt;
-
-  /**
-   * The interpreter we are using.
-   */
-  struct TALER_TESTING_Interpreter *is;
-};
-
-
-/**
- * State for a "status" CMD.
- */
-struct StatusState
-{
-
-  /**
-   * How long do we give the donau to respond?
-   */
-  struct GNUNET_TIME_Relative timeout;
-
-  /**
-   * Poller waiting for us.
-   */
-  struct PollState *ps;
-
-  /**
-   * Label to the command which created the reserve to check,
-   * needed to resort the reserve key.
-   */
-  const char *reserve_reference;
-
-  /**
-   * Handle to the "reserve status" operation.
-   */
-  struct DONAU_ReservesGetHandle *rsh;
-
-  /**
-   * Expected reserve balance.
-   */
-  const char *expected_balance;
-
-  /**
-   * Public key of the reserve being analyzed.
-   */
-  const struct TALER_ReservePublicKeyP *reserve_pubp;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-};
-
-
-/**
- * Check that the reserve balance and HTTP response code are
- * both acceptable.
- *
- * @param cls closure.
- * @param rs HTTP response details
- */
-static void
-reserve_status_cb (void *cls,
-                   const struct DONAU_ReserveSummary *rs)
-{
-  struct StatusState *ss = cls;
-  struct TALER_TESTING_Interpreter *is = ss->is;
-  struct TALER_Amount eb;
-
-  ss->rsh = NULL;
-  if (ss->expected_response_code != rs->hr.http_status)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected HTTP response code: %d in %s:%u\n",
-                rs->hr.http_status,
-                __FILE__,
-                __LINE__);
-    json_dumpf (rs->hr.reply,
-                stderr,
-                0);
-    TALER_TESTING_interpreter_fail (ss->is);
-    return;
-  }
-  if (MHD_HTTP_OK == ss->expected_response_code)
-  {
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_string_to_amount (ss->expected_balance,
-                                           &eb));
-    if (0 != TALER_amount_cmp (&eb,
-                               &rs->details.ok.balance))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Unexpected amount %s in reserve, wanted %s\n",
-                  TALER_amount_to_string (&rs->details.ok.balance),
-                  ss->expected_balance);
-      TALER_TESTING_interpreter_fail (ss->is);
-      return;
-    }
-  }
-  if (NULL != ss->ps)
-  {
-    /* force continuation on long poller */
-    GNUNET_SCHEDULER_cancel (ss->ps->tt);
-    ss->ps->tt = NULL;
-    TALER_TESTING_interpreter_next (is);
-    return;
-  }
-  if (GNUNET_TIME_relative_is_zero (ss->timeout))
-    TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command being executed.
- * @param is the interpreter state.
- */
-static void
-status_run (void *cls,
-            const struct TALER_TESTING_Command *cmd,
-            struct TALER_TESTING_Interpreter *is)
-{
-  struct StatusState *ss = cls;
-  const struct TALER_TESTING_Command *create_reserve;
-  const char *donau_url;
-
-  ss->is = is;
-  donau_url = TALER_TESTING_get_donau_url (is);
-  if (NULL == donau_url)
-  {
-    GNUNET_break (0);
-    return;
-  }
-  create_reserve
-    = TALER_TESTING_interpreter_lookup_command (is,
-                                                ss->reserve_reference);
-  GNUNET_assert (NULL != create_reserve);
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_reserve_pub (create_reserve,
-                                           &ss->reserve_pubp))
-  {
-    GNUNET_break (0);
-    TALER_LOG_ERROR ("Failed to find reserve_pub for status query\n");
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  ss->rsh = DONAU_reserves_get (
-    TALER_TESTING_interpreter_get_context (is),
-    donau_url,
-    ss->reserve_pubp,
-    ss->timeout,
-    &reserve_status_cb,
-    ss);
-  if (! GNUNET_TIME_relative_is_zero (ss->timeout))
-  {
-    TALER_TESTING_interpreter_next (is);
-    return;
-  }
-}
-
-
-/**
- * Cleanup the state from a "reserve status" CMD, and possibly
- * cancel a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-status_cleanup (void *cls,
-                const struct TALER_TESTING_Command *cmd)
-{
-  struct StatusState *ss = cls;
-
-  if (NULL != ss->rsh)
-  {
-    TALER_TESTING_command_incomplete (ss->is,
-                                      cmd->label);
-    DONAU_reserves_get_cancel (ss->rsh);
-    ss->rsh = NULL;
-  }
-  GNUNET_free (ss);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_status (const char *label,
-                          const char *reserve_reference,
-                          const char *expected_balance,
-                          unsigned int expected_response_code)
-{
-  struct StatusState *ss;
-
-  GNUNET_assert (NULL != reserve_reference);
-  ss = GNUNET_new (struct StatusState);
-  ss->reserve_reference = reserve_reference;
-  ss->expected_balance = expected_balance;
-  ss->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ss,
-      .label = label,
-      .run = &status_run,
-      .cleanup = &status_cleanup
-    };
-
-    return cmd;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_reserve_poll (const char *label,
-                                const char *reserve_reference,
-                                const char *expected_balance,
-                                struct GNUNET_TIME_Relative timeout,
-                                unsigned int expected_response_code)
-{
-  struct StatusState *ss;
-
-  GNUNET_assert (NULL != reserve_reference);
-  ss = GNUNET_new (struct StatusState);
-  ss->reserve_reference = reserve_reference;
-  ss->expected_balance = expected_balance;
-  ss->expected_response_code = expected_response_code;
-  ss->timeout = timeout;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ss,
-      .label = label,
-      .run = &status_run,
-      .cleanup = &status_cleanup
-    };
-
-    return cmd;
-  }
-}
-
-
-/**
- * Long poller timed out. Fail the test.
- *
- * @param cls a `struct PollState`
- */
-static void
-finish_timeout (void *cls)
-{
-  struct PollState *ps = cls;
-
-  ps->tt = NULL;
-  GNUNET_break (0);
-  TALER_TESTING_interpreter_fail (ps->is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command being executed.
- * @param is the interpreter state.
- */
-static void
-finish_run (void *cls,
-            const struct TALER_TESTING_Command *cmd,
-            struct TALER_TESTING_Interpreter *is)
-{
-  struct PollState *ps = cls;
-  const struct TALER_TESTING_Command *poll_reserve;
-  struct StatusState *ss;
-
-  ps->is = is;
-  poll_reserve
-    = TALER_TESTING_interpreter_lookup_command (is,
-                                                ps->poll_reference);
-  GNUNET_assert (NULL != poll_reserve);
-  GNUNET_assert (poll_reserve->run == &status_run);
-  ss = poll_reserve->cls;
-  if (NULL == ss->rsh)
-  {
-    TALER_TESTING_interpreter_next (is);
-    return;
-  }
-  GNUNET_assert (NULL == ss->ps);
-  ss->ps = ps;
-  ps->tt = GNUNET_SCHEDULER_add_delayed (ps->timeout,
-                                         &finish_timeout,
-                                         ps);
-}
-
-
-/**
- * Cleanup the state from a "reserve finish" CMD.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-finish_cleanup (void *cls,
-                const struct TALER_TESTING_Command *cmd)
-{
-  struct PollState *ps = cls;
-
-  if (NULL != ps->tt)
-  {
-    GNUNET_SCHEDULER_cancel (ps->tt);
-    ps->tt = NULL;
-  }
-  GNUNET_free (ps);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_reserve_poll_finish (const char *label,
-                                       struct GNUNET_TIME_Relative timeout,
-                                       const char *poll_reference)
-{
-  struct PollState *ps;
-
-  GNUNET_assert (NULL != poll_reference);
-  ps = GNUNET_new (struct PollState);
-  ps->timeout = timeout;
-  ps->poll_reference = poll_reference;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ps,
-      .label = label,
-      .run = &finish_run,
-      .cleanup = &finish_cleanup
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_reserve_history.c 
b/src/testing/testing_api_cmd_reserve_history.c
deleted file mode 100644
index cd75095..0000000
--- a/src/testing/testing_api_cmd_reserve_history.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
-  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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_reserve_history.c
- * @brief Implement the /reserve/history test command.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "history" CMD.
- */
-struct HistoryState
-{
-
-  /**
-   * Public key of the reserve being analyzed.
-   */
-  struct TALER_ReservePublicKeyP reserve_pub;
-
-  /**
-   * Label to the command which created the reserve to check,
-   * needed to resort the reserve key.
-   */
-  const char *reserve_reference;
-
-  /**
-   * Handle to the "reserve history" operation.
-   */
-  struct DONAU_ReservesHistoryHandle *rsh;
-
-  /**
-   * Expected reserve balance.
-   */
-  const char *expected_balance;
-
-  /**
-   * Private key of the reserve being analyzed.
-   */
-  const struct TALER_ReservePrivateKeyP *reserve_priv;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Reserve history entry that corresponds to this operation.
-   * Will be of type #DONAU_RTT_HISTORY.
-   */
-  struct DONAU_ReserveHistoryEntry reserve_history;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-};
-
-
-/**
- * Closure for analysis_cb().
- */
-struct AnalysisContext
-{
-  /**
-   * Reserve public key we are looking at.
-   */
-  const struct TALER_ReservePublicKeyP *reserve_pub;
-
-  /**
-   * Length of the @e history array.
-   */
-  unsigned int history_length;
-
-  /**
-   * Array of history items to match.
-   */
-  const struct DONAU_ReserveHistoryEntry *history;
-
-  /**
-   * Array of @e history_length of matched entries.
-   */
-  bool *found;
-
-  /**
-   * Set to true if an entry could not be found.
-   */
-  bool failure;
-};
-
-
-/**
- * Check if @a cmd changed the reserve, if so, find the
- * entry in our history and set the respective index in found
- * to true. If the entry is not found, set failure.
- *
- * @param cls our `struct AnalysisContext *`
- * @param cmd command to analyze for impact on history
- */
-static void
-analyze_command (void *cls,
-                 const struct TALER_TESTING_Command *cmd)
-{
-  struct AnalysisContext *ac = cls;
-  const struct TALER_ReservePublicKeyP *reserve_pub = ac->reserve_pub;
-  const struct DONAU_ReserveHistoryEntry *history = ac->history;
-  unsigned int history_length = ac->history_length;
-  bool *found = ac->found;
-
-  if (TALER_TESTING_cmd_is_batch (cmd))
-  {
-    struct TALER_TESTING_Command *cur;
-    struct TALER_TESTING_Command *bcmd;
-
-    cur = TALER_TESTING_cmd_batch_get_current (cmd);
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_batch_cmds (cmd,
-                                            &bcmd))
-    {
-      GNUNET_break (0);
-      ac->failure = true;
-      return;
-    }
-    for (unsigned int i = 0; NULL != bcmd[i].label; i++)
-    {
-      struct TALER_TESTING_Command *step = &bcmd[i];
-
-      analyze_command (ac,
-                       step);
-      if (ac->failure)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Entry for batch step `%s' missing in history\n",
-                    step->label);
-        return;
-      }
-      if (step == cur)
-        break; /* if *we* are in a batch, make sure not to analyze commands 
past 'now' */
-    }
-    return;
-  }
-
-  {
-    const struct TALER_ReservePublicKeyP *rp;
-
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_reserve_pub (cmd,
-                                             &rp))
-      return; /* command does nothing for reserves */
-    if (0 !=
-        GNUNET_memcmp (rp,
-                       reserve_pub))
-      return; /* command affects some _other_ reserve */
-    for (unsigned int j = 0; true; j++)
-    {
-      const struct DONAU_ReserveHistoryEntry *he;
-      bool matched = false;
-
-      if (GNUNET_OK !=
-          TALER_TESTING_get_trait_reserve_history (cmd,
-                                                   j,
-                                                   &he))
-      {
-        /* NOTE: only for debugging... */
-        if (0 == j)
-          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                      "Command `%s' has the reserve_pub, but lacks reserve 
history trait\n",
-                      cmd->label);
-        return; /* command does nothing for reserves */
-      }
-      for (unsigned int i = 0; i<history_length; i++)
-      {
-        if (found[i])
-          continue; /* already found, skip */
-        if (0 ==
-            TALER_TESTING_history_entry_cmp (he,
-                                             &history[i]))
-        {
-          found[i] = true;
-          matched = true;
-          break;
-        }
-      }
-      if (! matched)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Command `%s' reserve history entry #%u not found\n",
-                    cmd->label,
-                    j);
-        ac->failure = true;
-        return;
-      }
-    }
-  }
-}
-
-
-/**
- * Check that the reserve balance and HTTP response code are
- * both acceptable.
- *
- * @param cls closure.
- * @param rs HTTP response details
- */
-static void
-reserve_history_cb (void *cls,
-                    const struct DONAU_ReserveHistory *rs)
-{
-  struct HistoryState *ss = cls;
-  struct TALER_TESTING_Interpreter *is = ss->is;
-  struct TALER_Amount eb;
-
-  ss->rsh = NULL;
-  if (MHD_HTTP_OK == rs->hr.http_status)
-  {
-    struct DONAU_Keys *keys;
-    const struct DONAU_GlobalFee *gf;
-
-    ss->reserve_history.type = DONAU_RTT_HISTORY;
-    keys = TALER_TESTING_get_keys (is);
-    GNUNET_assert (NULL != keys);
-    gf = DONAU_get_global_fee (keys,
-                               rs->ts);
-    GNUNET_assert (NULL != gf);
-    ss->reserve_history.amount = gf->fees.history;
-    ss->reserve_history.details.history_details.request_timestamp = rs->ts;
-    ss->reserve_history.details.history_details.reserve_sig = *rs->reserve_sig;
-  }
-  if (ss->expected_response_code != rs->hr.http_status)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected HTTP response code: %d in %s:%u\n",
-                rs->hr.http_status,
-                __FILE__,
-                __LINE__);
-    json_dumpf (rs->hr.reply,
-                stderr,
-                0);
-    TALER_TESTING_interpreter_fail (ss->is);
-    return;
-  }
-  if (MHD_HTTP_OK != rs->hr.http_status)
-  {
-    TALER_TESTING_interpreter_next (is);
-    return;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount (ss->expected_balance,
-                                         &eb));
-
-  if (0 != TALER_amount_cmp (&eb,
-                             &rs->details.ok.balance))
-  {
-    GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected amount in reserve: %s\n",
-                TALER_amount_to_string (&rs->details.ok.balance));
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Expected balance of: %s\n",
-                TALER_amount_to_string (&eb));
-    TALER_TESTING_interpreter_fail (ss->is);
-    return;
-  }
-  {
-    bool found[rs->details.ok.history_len];
-    struct AnalysisContext ac = {
-      .reserve_pub = &ss->reserve_pub,
-      .history = rs->details.ok.history,
-      .history_length = rs->details.ok.history_len,
-      .found = found
-    };
-
-    memset (found,
-            0,
-            sizeof (found));
-    TALER_TESTING_iterate (is,
-                           true,
-                           &analyze_command,
-                           &ac);
-    if (ac.failure)
-    {
-      json_dumpf (rs->hr.reply,
-                  stderr,
-                  JSON_INDENT (2));
-      TALER_TESTING_interpreter_fail (ss->is);
-      return;
-    }
-    for (unsigned int i = 0; i<rs->details.ok.history_len; i++)
-    {
-      if (found[i])
-        continue;
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "History entry at index %u of type %d not justified by 
command history\n",
-                  i,
-                  rs->details.ok.history[i].type);
-      json_dumpf (rs->hr.reply,
-                  stderr,
-                  JSON_INDENT (2));
-      TALER_TESTING_interpreter_fail (ss->is);
-      return;
-    }
-  }
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command being executed.
- * @param is the interpreter state.
- */
-static void
-history_run (void *cls,
-             const struct TALER_TESTING_Command *cmd,
-             struct TALER_TESTING_Interpreter *is)
-{
-  struct HistoryState *ss = cls;
-  const struct TALER_TESTING_Command *create_reserve;
-
-  ss->is = is;
-  create_reserve
-    = TALER_TESTING_interpreter_lookup_command (is,
-                                                ss->reserve_reference);
-  if (NULL == create_reserve)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_reserve_priv (create_reserve,
-                                            &ss->reserve_priv))
-  {
-    GNUNET_break (0);
-    TALER_LOG_ERROR ("Failed to find reserve_priv for history query\n");
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_CRYPTO_eddsa_key_get_public (&ss->reserve_priv->eddsa_priv,
-                                      &ss->reserve_pub.eddsa_pub);
-  ss->rsh = DONAU_reserves_history (
-    TALER_TESTING_interpreter_get_context (is),
-    TALER_TESTING_get_donau_url (is),
-    TALER_TESTING_get_keys (is),
-    ss->reserve_priv,
-    &reserve_history_cb,
-    ss);
-}
-
-
-/**
- * Offer internal data from a "history" CMD, to other commands.
- *
- * @param cls closure.
- * @param[out] ret result.
- * @param trait name of the trait.
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success.
- */
-static enum GNUNET_GenericReturnValue
-history_traits (void *cls,
-                const void **ret,
-                const char *trait,
-                unsigned int index)
-{
-  struct HistoryState *hs = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    /* history entry MUST be first due to response code logic below! */
-    TALER_TESTING_make_trait_reserve_history (0,
-                                              &hs->reserve_history),
-    TALER_TESTING_make_trait_reserve_pub (&hs->reserve_pub),
-    TALER_TESTING_trait_end ()
-  };
-
-  return TALER_TESTING_get_trait ((hs->expected_response_code == MHD_HTTP_OK)
-                                  ? &traits[0]   /* we have reserve history */
-                                  : &traits[1],  /* skip reserve history */
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-/**
- * Cleanup the state from a "reserve history" CMD, and possibly
- * cancel a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-history_cleanup (void *cls,
-                 const struct TALER_TESTING_Command *cmd)
-{
-  struct HistoryState *ss = cls;
-
-  if (NULL != ss->rsh)
-  {
-    TALER_TESTING_command_incomplete (ss->is,
-                                      cmd->label);
-    DONAU_reserves_history_cancel (ss->rsh);
-    ss->rsh = NULL;
-  }
-  GNUNET_free (ss);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_reserve_history (const char *label,
-                                   const char *reserve_reference,
-                                   const char *expected_balance,
-                                   unsigned int expected_response_code)
-{
-  struct HistoryState *ss;
-
-  GNUNET_assert (NULL != reserve_reference);
-  ss = GNUNET_new (struct HistoryState);
-  ss->reserve_reference = reserve_reference;
-  ss->expected_balance = expected_balance;
-  ss->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ss,
-      .label = label,
-      .run = &history_run,
-      .cleanup = &history_cleanup,
-      .traits = &history_traits
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_reserve_open.c 
b/src/testing/testing_api_cmd_reserve_open.c
deleted file mode 100644
index b053e6e..0000000
--- a/src/testing/testing_api_cmd_reserve_open.c
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
-  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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_reserve_open.c
- * @brief Implement the /reserve/$RID/open test command.
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * Information we track per coin used to pay for opening the
- * reserve.
- */
-struct CoinDetail
-{
-  /**
-   * Name of the command and index of the coin to use.
-   */
-  const char *name;
-
-  /**
-   * Amount to charge to this coin.
-   */
-  struct TALER_Amount amount;
-};
-
-
-/**
- * State for a "open" CMD.
- */
-struct OpenState
-{
-  /**
-   * Label to the command which created the reserve to check,
-   * needed to resort the reserve key.
-   */
-  const char *reserve_reference;
-
-  /**
-   * Requested expiration time.
-   */
-  struct GNUNET_TIME_Relative req_expiration_time;
-
-  /**
-   * Requested minimum number of purses.
-   */
-  uint32_t min_purses;
-
-  /**
-   * Amount to pay for the opening from the reserve balance.
-   */
-  struct TALER_Amount reserve_pay;
-
-  /**
-   * Handle to the "reserve open" operation.
-   */
-  struct DONAU_ReservesOpenHandle *rsh;
-
-  /**
-   * Expected reserve balance.
-   */
-  const char *expected_balance;
-
-  /**
-   * Length of the @e cd array.
-   */
-  unsigned int cpl;
-
-  /**
-   * Coin details, array of length @e cpl.
-   */
-  struct CoinDetail *cd;
-
-  /**
-   * Private key of the reserve being analyzed.
-   */
-  const struct TALER_ReservePrivateKeyP *reserve_priv;
-
-  /**
-   * Public key of the reserve being analyzed.
-   */
-  struct TALER_ReservePublicKeyP reserve_pub;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-};
-
-
-/**
- * Check that the reserve balance and HTTP response code are
- * both acceptable.
- *
- * @param cls closure.
- * @param rs HTTP response details
- */
-static void
-reserve_open_cb (void *cls,
-                 const struct DONAU_ReserveOpenResult *rs)
-{
-  struct OpenState *ss = cls;
-  struct TALER_TESTING_Interpreter *is = ss->is;
-
-  ss->rsh = NULL;
-  if (ss->expected_response_code != rs->hr.http_status)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected HTTP response code: %d in %s:%u\n",
-                rs->hr.http_status,
-                __FILE__,
-                __LINE__);
-    json_dumpf (rs->hr.reply,
-                stderr,
-                JSON_INDENT (2));
-    TALER_TESTING_interpreter_fail (ss->is);
-    return;
-  }
-  if (MHD_HTTP_OK != rs->hr.http_status)
-  {
-    TALER_TESTING_interpreter_next (is);
-    return;
-  }
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command being executed.
- * @param is the interpreter state.
- */
-static void
-open_run (void *cls,
-          const struct TALER_TESTING_Command *cmd,
-          struct TALER_TESTING_Interpreter *is)
-{
-  struct OpenState *ss = cls;
-  const struct TALER_TESTING_Command *create_reserve;
-  struct DONAU_PurseDeposit cp[GNUNET_NZL (ss->cpl)];
-
-  ss->is = is;
-  create_reserve
-    = TALER_TESTING_interpreter_lookup_command (is,
-                                                ss->reserve_reference);
-
-  if (NULL == create_reserve)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_reserve_priv (create_reserve,
-                                            &ss->reserve_priv))
-  {
-    GNUNET_break (0);
-    TALER_LOG_ERROR ("Failed to find reserve_priv for open query\n");
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_CRYPTO_eddsa_key_get_public (&ss->reserve_priv->eddsa_priv,
-                                      &ss->reserve_pub.eddsa_pub);
-  for (unsigned int i = 0; i<ss->cpl; i++)
-  {
-    struct DONAU_PurseDeposit *cpi = &cp[i];
-    const struct TALER_TESTING_Command *cmdi;
-    const struct TALER_AgeCommitmentProof *age_commitment_proof;
-    const struct TALER_CoinSpendPrivateKeyP *coin_priv;
-    const struct TALER_DenominationSignature *denom_sig;
-    const struct DONAU_DenomPublicKey *denom_pub;
-    char *cref;
-    unsigned int cidx;
-
-    if (GNUNET_OK !=
-        TALER_TESTING_parse_coin_reference (ss->cd[i].name,
-                                            &cref,
-                                            &cidx))
-    {
-      GNUNET_break (0);
-      TALER_LOG_ERROR ("Failed to parse coin reference `%s'\n",
-                       ss->cd[i].name);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    cmdi = TALER_TESTING_interpreter_lookup_command (is,
-                                                     cref);
-    GNUNET_free (cref);
-    if (NULL == cmdi)
-    {
-      GNUNET_break (0);
-      TALER_LOG_ERROR ("Command `%s' not found\n",
-                       ss->cd[i].name);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    if ( (GNUNET_OK !=
-          TALER_TESTING_get_trait_age_commitment_proof (cmdi,
-                                                        cidx,
-                                                        &age_commitment_proof))
-         ||
-         (GNUNET_OK !=
-          TALER_TESTING_get_trait_coin_priv (cmdi,
-                                             cidx,
-                                             &coin_priv)) ||
-         (GNUNET_OK !=
-          TALER_TESTING_get_trait_denom_sig (cmdi,
-                                             cidx,
-                                             &denom_sig)) ||
-         (GNUNET_OK !=
-          TALER_TESTING_get_trait_denom_pub (cmdi,
-                                             cidx,
-                                             &denom_pub)) )
-    {
-      GNUNET_break (0);
-      TALER_LOG_ERROR ("Coin trait not found in `%s'\n",
-                       ss->cd[i].name);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    cpi->age_commitment_proof = age_commitment_proof;
-    cpi->coin_priv = *coin_priv;
-    cpi->denom_sig = *denom_sig;
-    cpi->amount = ss->cd[i].amount;
-    cpi->h_denom_pub = denom_pub->h_key;
-  }
-  ss->rsh = DONAU_reserves_open (
-    TALER_TESTING_interpreter_get_context (is),
-    TALER_TESTING_get_donau_url (is),
-    TALER_TESTING_get_keys (is),
-    ss->reserve_priv,
-    &ss->reserve_pay,
-    ss->cpl,
-    cp,
-    GNUNET_TIME_relative_to_timestamp (ss->req_expiration_time),
-    ss->min_purses,
-    &reserve_open_cb,
-    ss);
-}
-
-
-/**
- * Cleanup the state from a "reserve open" CMD, and possibly
- * cancel a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-open_cleanup (void *cls,
-              const struct TALER_TESTING_Command *cmd)
-{
-  struct OpenState *ss = cls;
-
-  if (NULL != ss->rsh)
-  {
-    TALER_TESTING_command_incomplete (ss->is,
-                                      cmd->label);
-    DONAU_reserves_open_cancel (ss->rsh);
-    ss->rsh = NULL;
-  }
-  GNUNET_free (ss);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_reserve_open (const char *label,
-                                const char *reserve_reference,
-                                const char *reserve_pay,
-                                struct GNUNET_TIME_Relative expiration_time,
-                                uint32_t min_purses,
-                                unsigned int expected_response_code,
-                                ...)
-{
-  struct OpenState *ss;
-  va_list ap;
-  const char *name;
-  unsigned int i;
-
-  GNUNET_assert (NULL != reserve_reference);
-  ss = GNUNET_new (struct OpenState);
-  ss->reserve_reference = reserve_reference;
-  ss->req_expiration_time = expiration_time;
-  ss->min_purses = min_purses;
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount (reserve_pay,
-                                         &ss->reserve_pay));
-  ss->expected_response_code = expected_response_code;
-  va_start (ap,
-            expected_response_code);
-  while (NULL != (name = va_arg (ap, const char *)))
-    ss->cpl++;
-  va_end (ap);
-  GNUNET_assert (0 == (ss->cpl % 2));
-  ss->cpl /= 2; /* name and amount per coin */
-  ss->cd = GNUNET_new_array (ss->cpl,
-                             struct CoinDetail);
-  i = 0;
-  va_start (ap,
-            expected_response_code);
-  while (NULL != (name = va_arg (ap, const char *)))
-  {
-    struct CoinDetail *cd = &ss->cd[i];
-    cd->name = name;
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_string_to_amount (va_arg (ap,
-                                                   const char *),
-                                           &cd->amount));
-    i++;
-  }
-  va_end (ap);
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ss,
-      .label = label,
-      .run = &open_run,
-      .cleanup = &open_cleanup
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_reserve_status.c 
b/src/testing/testing_api_cmd_reserve_status.c
deleted file mode 100644
index f7dcf5b..0000000
--- a/src/testing/testing_api_cmd_reserve_status.c
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2014-2020 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_reserve_status.c
- * @brief Implement the /reserve/$RID/status test command.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "status" CMD.
- */
-struct StatusState
-{
-  /**
-   * Label to the command which created the reserve to check,
-   * needed to resort the reserve key.
-   */
-  const char *reserve_reference;
-
-  /**
-   * Handle to the "reserve status" operation.
-   */
-  struct DONAU_ReservesStatusHandle *rsh;
-
-  /**
-   * Expected reserve balance.
-   */
-  const char *expected_balance;
-
-  /**
-   * Private key of the reserve being analyzed.
-   */
-  const struct TALER_ReservePrivateKeyP *reserve_priv;
-
-  /**
-   * Public key of the reserve being analyzed.
-   */
-  struct TALER_ReservePublicKeyP reserve_pub;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-};
-
-/**
- * Closure for analysis_cb().
- */
-struct AnalysisContext
-{
-  /**
-   * Reserve public key we are looking at.
-   */
-  const struct TALER_ReservePublicKeyP *reserve_pub;
-
-  /**
-   * Length of the @e history array.
-   */
-  unsigned int history_length;
-
-  /**
-   * Array of history items to match.
-   */
-  const struct DONAU_ReserveHistoryEntry *history;
-
-  /**
-   * Array of @e history_length of matched entries.
-   */
-  bool *found;
-
-  /**
-   * Set to true if an entry could not be found.
-   */
-  bool failure;
-};
-
-
-/**
- * Check if @a cmd changed the reserve, if so, find the
- * entry in our history and set the respective index in found
- * to true. If the entry is not found, set failure.
- *
- * @param cls our `struct AnalysisContext *`
- * @param cmd command to analyze for impact on history
- */
-static void
-analyze_command (void *cls,
-                 const struct TALER_TESTING_Command *cmd)
-{
-  struct AnalysisContext *ac = cls;
-  const struct TALER_ReservePublicKeyP *reserve_pub = ac->reserve_pub;
-  const struct DONAU_ReserveHistoryEntry *history = ac->history;
-  unsigned int history_length = ac->history_length;
-  bool *found = ac->found;
-
-  if (TALER_TESTING_cmd_is_batch (cmd))
-  {
-    struct TALER_TESTING_Command *cur;
-    struct TALER_TESTING_Command *bcmd;
-
-    cur = TALER_TESTING_cmd_batch_get_current (cmd);
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_batch_cmds (cmd,
-                                            &bcmd))
-    {
-      GNUNET_break (0);
-      ac->failure = true;
-      return;
-    }
-    for (unsigned int i = 0; NULL != bcmd[i].label; i++)
-    {
-      struct TALER_TESTING_Command *step = &bcmd[i];
-
-      if (step == cur)
-        break; /* if *we* are in a batch, make sure not to analyze commands 
past 'now' */
-      analyze_command (ac,
-                       step);
-      if (ac->failure)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Entry for batch step `%s' missing in history\n",
-                    step->label);
-        return;
-      }
-    }
-    return;
-  }
-
-  {
-    const struct TALER_ReservePublicKeyP *rp;
-
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_reserve_pub (cmd,
-                                             &rp))
-      return; /* command does nothing for reserves */
-    if (0 !=
-        GNUNET_memcmp (rp,
-                       reserve_pub))
-      return; /* command affects some _other_ reserve */
-    for (unsigned int j = 0; true; j++)
-    {
-      const struct DONAU_ReserveHistoryEntry *he;
-      bool matched = false;
-
-      if (GNUNET_OK !=
-          TALER_TESTING_get_trait_reserve_history (cmd,
-                                                   j,
-                                                   &he))
-      {
-        /* NOTE: only for debugging... */
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Command `%s' has the reserve_pub trait, but does not 
reserve history trait\n",
-                    cmd->label);
-        return; /* command does nothing for reserves */
-      }
-      for (unsigned int i = 0; i<history_length; i++)
-      {
-        if (found[i])
-          continue; /* already found, skip */
-        if (0 ==
-            TALER_TESTING_history_entry_cmp (he,
-                                             &history[i]))
-        {
-          found[i] = true;
-          matched = true;
-          break;
-        }
-      }
-      if (! matched)
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Command `%s' reserve history entry #%u not found\n",
-                    cmd->label,
-                    j);
-        ac->failure = true;
-        return;
-      }
-    }
-  }
-}
-
-
-/**
- * Check that the reserve balance and HTTP response code are
- * both acceptable.
- *
- * @param cls closure.
- * @param rs HTTP response details
- */
-static void
-reserve_status_cb (void *cls,
-                   const struct DONAU_ReserveStatus *rs)
-{
-  struct StatusState *ss = cls;
-  struct TALER_TESTING_Interpreter *is = ss->is;
-  struct TALER_Amount eb;
-
-  ss->rsh = NULL;
-  if (ss->expected_response_code != rs->hr.http_status)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected HTTP response code: %d in %s:%u\n",
-                rs->hr.http_status,
-                __FILE__,
-                __LINE__);
-    json_dumpf (rs->hr.reply,
-                stderr,
-                JSON_INDENT (2));
-    TALER_TESTING_interpreter_fail (ss->is);
-    return;
-  }
-  if (MHD_HTTP_OK != rs->hr.http_status)
-  {
-    TALER_TESTING_interpreter_next (is);
-    return;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_string_to_amount (ss->expected_balance,
-                                         &eb));
-
-  if (0 != TALER_amount_cmp (&eb,
-                             &rs->details.ok.balance))
-  {
-    GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Unexpected amount in reserve: %s\n",
-                TALER_amount_to_string (&rs->details.ok.balance));
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Expected balance of: %s\n",
-                TALER_amount_to_string (&eb));
-    TALER_TESTING_interpreter_fail (ss->is);
-    return;
-  }
-  {
-    bool found[rs->details.ok.history_len];
-    struct AnalysisContext ac = {
-      .reserve_pub = &ss->reserve_pub,
-      .history = rs->details.ok.history,
-      .history_length = rs->details.ok.history_len,
-      .found = found
-    };
-
-    memset (found,
-            0,
-            sizeof (found));
-    TALER_TESTING_iterate (is,
-                           true,
-                           &analyze_command,
-                           &ac);
-    if (ac.failure)
-    {
-      json_dumpf (rs->hr.reply,
-                  stderr,
-                  JSON_INDENT (2));
-      TALER_TESTING_interpreter_fail (ss->is);
-      return;
-    }
-    for (unsigned int i = 0; i<rs->details.ok.history_len; i++)
-    {
-      if (found[i])
-        continue;
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "History entry at index %u of type %d not justified by 
command status\n",
-                  i,
-                  rs->details.ok.history[i].type);
-      json_dumpf (rs->hr.reply,
-                  stderr,
-                  JSON_INDENT (2));
-      TALER_TESTING_interpreter_fail (ss->is);
-      return;
-    }
-  }
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command being executed.
- * @param is the interpreter state.
- */
-static void
-status_run (void *cls,
-            const struct TALER_TESTING_Command *cmd,
-            struct TALER_TESTING_Interpreter *is)
-{
-  struct StatusState *ss = cls;
-  const struct TALER_TESTING_Command *create_reserve;
-
-  ss->is = is;
-  create_reserve
-    = TALER_TESTING_interpreter_lookup_command (is,
-                                                ss->reserve_reference);
-
-  if (NULL == create_reserve)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_reserve_priv (create_reserve,
-                                            &ss->reserve_priv))
-  {
-    GNUNET_break (0);
-    TALER_LOG_ERROR ("Failed to find reserve_priv for status query\n");
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_CRYPTO_eddsa_key_get_public (&ss->reserve_priv->eddsa_priv,
-                                      &ss->reserve_pub.eddsa_pub);
-  ss->rsh = DONAU_reserves_status (
-    TALER_TESTING_interpreter_get_context (is),
-    TALER_TESTING_get_donau_url (is),
-    TALER_TESTING_get_keys (is),
-    ss->reserve_priv,
-    &reserve_status_cb,
-    ss);
-}
-
-
-/**
- * Cleanup the state from a "reserve status" CMD, and possibly
- * cancel a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-status_cleanup (void *cls,
-                const struct TALER_TESTING_Command *cmd)
-{
-  struct StatusState *ss = cls;
-
-  if (NULL != ss->rsh)
-  {
-    TALER_TESTING_command_incomplete (ss->is,
-                                      cmd->label);
-    DONAU_reserves_status_cancel (ss->rsh);
-    ss->rsh = NULL;
-  }
-  GNUNET_free (ss);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_reserve_status (const char *label,
-                                  const char *reserve_reference,
-                                  const char *expected_balance,
-                                  unsigned int expected_response_code)
-{
-  struct StatusState *ss;
-
-  GNUNET_assert (NULL != reserve_reference);
-  ss = GNUNET_new (struct StatusState);
-  ss->reserve_reference = reserve_reference;
-  ss->expected_balance = expected_balance;
-  ss->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ss,
-      .label = label,
-      .run = &status_run,
-      .cleanup = &status_cleanup
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_revoke.c 
b/src/testing/testing_api_cmd_revoke.c
deleted file mode 100644
index dd892cc..0000000
--- a/src/testing/testing_api_cmd_revoke.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2014-2018 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_revoke.c
- * @brief Implement the revoke test command.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "revoke" CMD.
- */
-struct RevokeState
-{
-  /**
-   * Expected HTTP status code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Command that offers a denomination to revoke.
-   */
-  const char *coin_reference;
-
-  /**
-   * The interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * The revoke process handle.
-   */
-  struct GNUNET_OS_Process *revoke_proc;
-
-  /**
-   * Configuration file name.
-   */
-  const char *config_filename;
-
-  /**
-   * Encoding of the denomination (to revoke) public key hash.
-   */
-  char *dhks;
-
-};
-
-
-/**
- * Cleanup the state.
- *
- * @param cls closure, must be a `struct RevokeState`.
- * @param cmd the command which is being cleaned up.
- */
-static void
-revoke_cleanup (void *cls,
-                const struct TALER_TESTING_Command *cmd)
-{
-  struct RevokeState *rs = cls;
-
-  if (NULL != rs->revoke_proc)
-  {
-    GNUNET_break (0 ==
-                  GNUNET_OS_process_kill (rs->revoke_proc,
-                                          SIGKILL));
-    GNUNET_OS_process_wait (rs->revoke_proc);
-    GNUNET_OS_process_destroy (rs->revoke_proc);
-    rs->revoke_proc = NULL;
-  }
-  GNUNET_free (rs->dhks);
-  GNUNET_free (rs);
-}
-
-
-/**
- * Offer internal data from a "revoke" CMD to other CMDs.
- *
- * @param cls closure
- * @param[out] ret result (could be anything)
- * @param trait name of the trait
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-revoke_traits (void *cls,
-               const void **ret,
-               const char *trait,
-               unsigned int index)
-{
-  struct RevokeState *rs = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    /* Needed by the handler which waits the proc'
-     * death and calls the next command */
-    TALER_TESTING_make_trait_process (&rs->revoke_proc),
-    TALER_TESTING_trait_end ()
-  };
-
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-/**
- * Run the "revoke" command.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-revoke_run (void *cls,
-            const struct TALER_TESTING_Command *cmd,
-            struct TALER_TESTING_Interpreter *is)
-{
-  struct RevokeState *rs = cls;
-  const struct TALER_TESTING_Command *coin_cmd;
-  const struct DONAU_DenomPublicKey *denom_pub;
-
-  rs->is = is;
-  /* Get denom pub from trait */
-  coin_cmd = TALER_TESTING_interpreter_lookup_command (is,
-                                                       rs->coin_reference);
-  if (NULL == coin_cmd)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_TESTING_get_trait_denom_pub (coin_cmd,
-                                                    0,
-                                                    &denom_pub));
-
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Trying to revoke denom '%s..'\n",
-              TALER_B2S (&denom_pub->h_key));
-
-  rs->dhks = GNUNET_STRINGS_data_to_string_alloc (
-    &denom_pub->h_key,
-    sizeof (struct GNUNET_HashCode));
-  rs->revoke_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL,
-                                             NULL, NULL, NULL,
-                                             "taler-donau-offline",
-                                             "taler-donau-offline",
-                                             "-c", rs->config_filename,
-                                             "revoke-denomination", rs->dhks,
-                                             "upload",
-                                             NULL);
-
-  if (NULL == rs->revoke_proc)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Revoke is ongoing..\n");
-  TALER_TESTING_wait_for_sigchld (is);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_revoke (const char *label,
-                          unsigned int expected_response_code,
-                          const char *coin_reference,
-                          const char *config_filename)
-{
-
-  struct RevokeState *rs;
-
-  rs = GNUNET_new (struct RevokeState);
-  rs->expected_response_code = expected_response_code;
-  rs->coin_reference = coin_reference;
-  rs->config_filename = config_filename;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = rs,
-      .label = label,
-      .run = &revoke_run,
-      .cleanup = &revoke_cleanup,
-      .traits = &revoke_traits
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_revoke_denom_key.c 
b/src/testing/testing_api_cmd_revoke_denom_key.c
deleted file mode 100644
index a4649e2..0000000
--- a/src/testing/testing_api_cmd_revoke_denom_key.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2014-2020 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_revoke_denom_key.c
- * @brief Implement the revoke test command.
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "revoke" CMD.
- */
-struct RevokeState
-{
-  /**
-   * Expected HTTP status code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Command that offers a denomination to revoke.
-   */
-  const char *coin_reference;
-
-  /**
-   * The interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Handle for the operation.
-   */
-  struct DONAU_ManagementRevokeDenominationKeyHandle *kh;
-
-  /**
-   * Should we use a bogus signature?
-   */
-  bool bad_sig;
-
-};
-
-
-/**
- * Function called with information about the post revocation operation result.
- *
- * @param cls closure with a `struct RevokeState *`
- * @param rdr response data
- */
-static void
-success_cb (
-  void *cls,
-  const struct DONAU_ManagementRevokeDenominationResponse *rdr)
-{
-  struct RevokeState *rs = cls;
-  const struct DONAU_HttpResponse *hr = &rdr->hr;
-
-  rs->kh = NULL;
-  if (rs->expected_response_code != hr->http_status)
-  {
-    TALER_TESTING_unexpected_status (rs->is,
-                                     hr->http_status,
-                                     rs->expected_response_code);
-    return;
-  }
-  TALER_TESTING_interpreter_next (rs->is);
-}
-
-
-/**
- * Cleanup the state.
- *
- * @param cls closure, must be a `struct RevokeState`.
- * @param cmd the command which is being cleaned up.
- */
-static void
-revoke_cleanup (void *cls,
-                const struct TALER_TESTING_Command *cmd)
-{
-  struct RevokeState *rs = cls;
-
-  if (NULL != rs->kh)
-  {
-    DONAU_management_revoke_denomination_key_cancel (rs->kh);
-    rs->kh = NULL;
-  }
-  GNUNET_free (rs);
-}
-
-
-/**
- * Offer internal data from a "revoke" CMD to other CMDs.
- *
- * @param cls closure
- * @param[out] ret result (could be anything)
- * @param trait name of the trait
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success
- */
-static int
-revoke_traits (void *cls,
-               const void **ret,
-               const char *trait,
-               unsigned int index)
-{
-  struct RevokeState *rs = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_trait_end ()
-  };
-
-  (void) rs;
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-/**
- * Run the "revoke" command for a denomination key.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-revoke_run (void *cls,
-            const struct TALER_TESTING_Command *cmd,
-            struct TALER_TESTING_Interpreter *is)
-{
-  struct RevokeState *rs = cls;
-  const struct TALER_TESTING_Command *coin_cmd;
-  const struct DONAU_DenomPublicKey *denom_pub;
-  struct TALER_MasterSignatureP master_sig;
-  const char *donau_url;
-
-  {
-    const struct TALER_TESTING_Command *donau_cmd;
-
-    donau_cmd = TALER_TESTING_interpreter_get_command (is,
-                                                       "donau");
-    if (NULL == donau_cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_TESTING_get_trait_donau_url (donau_cmd,
-                                                      &donau_url));
-  }
-  rs->is = is;
-  /* Get denom pub from trait */
-  coin_cmd = TALER_TESTING_interpreter_lookup_command (is,
-                                                       rs->coin_reference);
-
-  if (NULL == coin_cmd)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_TESTING_get_trait_denom_pub (coin_cmd,
-                                                    0,
-                                                    &denom_pub));
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Trying to revoke denom '%s..'\n",
-              TALER_B2S (&denom_pub->h_key));
-  if (rs->bad_sig)
-  {
-    memset (&master_sig,
-            42,
-            sizeof (master_sig));
-  }
-  else
-  {
-    const struct TALER_TESTING_Command *donau_cmd;
-    const struct TALER_MasterPrivateKeyP *master_priv;
-
-    donau_cmd = TALER_TESTING_interpreter_get_command (is,
-                                                       "donau");
-    if (NULL == donau_cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_TESTING_get_trait_master_priv (donau_cmd,
-                                                        &master_priv));
-    TALER_donau_offline_denomination_revoke_sign (&denom_pub->h_key,
-                                                  master_priv,
-                                                  &master_sig);
-  }
-  rs->kh = DONAU_management_revoke_denomination_key (
-    TALER_TESTING_interpreter_get_context (is),
-    donau_url,
-    &denom_pub->h_key,
-    &master_sig,
-    &success_cb,
-    rs);
-  if (NULL == rs->kh)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_revoke_denom_key (
-  const char *label,
-  unsigned int expected_response_code,
-  bool bad_sig,
-  const char *denom_ref)
-{
-  struct RevokeState *rs;
-
-  rs = GNUNET_new (struct RevokeState);
-  rs->expected_response_code = expected_response_code;
-  rs->coin_reference = denom_ref;
-  rs->bad_sig = bad_sig;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = rs,
-      .label = label,
-      .run = &revoke_run,
-      .cleanup = &revoke_cleanup,
-      .traits = &revoke_traits
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_revoke_sign_key.c 
b/src/testing/testing_api_cmd_revoke_sign_key.c
deleted file mode 100644
index 6693c55..0000000
--- a/src/testing/testing_api_cmd_revoke_sign_key.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
-  This file is part of TALER
-  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 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_revoke_sign_key.c
- * @brief Implement the revoke test command.
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler_testing_lib.h"
-
-
-/**
- * State for a "revoke" CMD.
- */
-struct RevokeState
-{
-  /**
-   * Expected HTTP status code.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Command that offers a signination to revoke.
-   */
-  const char *coin_reference;
-
-  /**
-   * The interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Handle for the operation.
-   */
-  struct DONAU_ManagementRevokeSigningKeyHandle *kh;
-
-  /**
-   * Should we use a bogus signature?
-   */
-  bool bad_sig;
-
-};
-
-
-/**
- * Function called with information about the post revocation operation result.
- *
- * @param cls closure with a `struct RevokeState *`
- * @param rsr response data
- */
-static void
-success_cb (
-  void *cls,
-  const struct DONAU_ManagementRevokeSigningKeyResponse *rsr)
-{
-  struct RevokeState *rs = cls;
-  const struct DONAU_HttpResponse *hr = &rsr->hr;
-
-  rs->kh = NULL;
-  if (rs->expected_response_code != hr->http_status)
-  {
-    TALER_TESTING_unexpected_status (rs->is,
-                                     hr->http_status,
-                                     rs->expected_response_code);
-    return;
-  }
-  TALER_TESTING_interpreter_next (rs->is);
-}
-
-
-/**
- * Cleanup the state.
- *
- * @param cls closure, must be a `struct RevokeState`.
- * @param cmd the command which is being cleaned up.
- */
-static void
-revoke_cleanup (void *cls,
-                const struct TALER_TESTING_Command *cmd)
-{
-  struct RevokeState *rs = cls;
-
-  if (NULL != rs->kh)
-  {
-    DONAU_management_revoke_signing_key_cancel (rs->kh);
-    rs->kh = NULL;
-  }
-  GNUNET_free (rs);
-}
-
-
-/**
- * Offer internal data from a "revoke" CMD to other CMDs.
- *
- * @param cls closure
- * @param[out] ret result (could be anything)
- * @param trait name of the trait
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success
- */
-static int
-revoke_traits (void *cls,
-               const void **ret,
-               const char *trait,
-               unsigned int index)
-{
-  struct RevokeState *rs = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    TALER_TESTING_trait_end ()
-  };
-
-  (void) rs;
-  return TALER_TESTING_get_trait (traits,
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-/**
- * Run the "revoke" command for a signing key.
- *
- * @param cls closure.
- * @param cmd the command to execute.
- * @param is the interpreter state.
- */
-static void
-revoke_run (void *cls,
-            const struct TALER_TESTING_Command *cmd,
-            struct TALER_TESTING_Interpreter *is)
-{
-  struct RevokeState *rs = cls;
-  const struct TALER_TESTING_Command *coin_cmd;
-  const struct DONAU_DonauPublicKeyP *donau_pub;
-  struct TALER_MasterSignatureP master_sig;
-  const char *donau_url;
-
-  {
-    const struct TALER_TESTING_Command *donau_cmd;
-
-    donau_cmd = TALER_TESTING_interpreter_get_command (is,
-                                                       "donau");
-    if (NULL == donau_cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_TESTING_get_trait_donau_url (donau_cmd,
-                                                      &donau_url));
-  }
-  rs->is = is;
-  /* Get sign pub from trait */
-  coin_cmd = TALER_TESTING_interpreter_lookup_command (is,
-                                                       rs->coin_reference);
-
-  if (NULL == coin_cmd)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_TESTING_get_trait_donau_pub (coin_cmd,
-                                                    0,
-                                                    &donau_pub));
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Trying to revoke sign '%s..'\n",
-              TALER_B2S (donau_pub));
-  if (rs->bad_sig)
-  {
-    memset (&master_sig,
-            42,
-            sizeof (master_sig));
-  }
-  else
-  {
-    const struct TALER_TESTING_Command *donau_cmd;
-    const struct TALER_MasterPrivateKeyP *master_priv;
-
-    donau_cmd = TALER_TESTING_interpreter_get_command (is,
-                                                       "donau");
-    if (NULL == donau_cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_TESTING_get_trait_master_priv (donau_cmd,
-                                                        &master_priv));
-    TALER_donau_offline_signkey_revoke_sign (donau_pub,
-                                             master_priv,
-                                             &master_sig);
-  }
-  rs->kh = DONAU_management_revoke_signing_key (
-    TALER_TESTING_interpreter_get_context (is),
-    donau_url,
-    donau_pub,
-    &master_sig,
-    &success_cb,
-    rs);
-  if (NULL == rs->kh)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_revoke_sign_key (
-  const char *label,
-  unsigned int expected_response_code,
-  bool bad_sig,
-  const char *sign_ref)
-{
-  struct RevokeState *rs;
-
-  rs = GNUNET_new (struct RevokeState);
-  rs->expected_response_code = expected_response_code;
-  rs->coin_reference = sign_ref;
-  rs->bad_sig = bad_sig;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = rs,
-      .label = label,
-      .run = &revoke_run,
-      .cleanup = &revoke_cleanup,
-      .traits = &revoke_traits
-    };
-
-    return cmd;
-  }
-}
diff --git a/src/testing/testing_api_cmd_stat.c 
b/src/testing/testing_api_cmd_stat.c
deleted file mode 100644
index 56a5d81..0000000
--- a/src/testing/testing_api_cmd_stat.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-  This file is part of TALER
-  (C) 2018 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_stat.c
- * @brief command(s) to get performance statistics on other commands
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * Run a "stat" CMD.
- *
- * @param cls closure.
- * @param cmd the command being run.
- * @param is the interpreter state.
- */
-static void
-stat_run (void *cls,
-          const struct TALER_TESTING_Command *cmd,
-          struct TALER_TESTING_Interpreter *is);
-
-
-/**
- * Add the time @a cmd took to the respective duration in @a timings.
- *
- * @param timings where to add up times
- * @param cmd command to evaluate
- */
-static void
-stat_cmd (struct TALER_TESTING_Timer *timings,
-          const struct TALER_TESTING_Command *cmd)
-{
-  struct GNUNET_TIME_Relative duration;
-  struct GNUNET_TIME_Relative lat;
-
-  if (GNUNET_TIME_absolute_cmp (cmd->start_time,
-                                >,
-                                cmd->finish_time))
-  {
-    /* This is a problem, except of course for
-       this command itself, as we clearly did not yet
-       finish... */
-    if (cmd->run != &stat_run)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Bad timings for `%s'\n",
-                  cmd->label);
-      GNUNET_break (0);
-    }
-    return;
-  }
-  duration = GNUNET_TIME_absolute_get_difference (cmd->start_time,
-                                                  cmd->finish_time);
-  lat = GNUNET_TIME_absolute_get_difference (cmd->last_req_time,
-                                             cmd->finish_time);
-  for (unsigned int i = 0;
-       NULL != timings[i].prefix;
-       i++)
-  {
-    if (0 == strncmp (timings[i].prefix,
-                      cmd->label,
-                      strlen (timings[i].prefix)))
-    {
-      timings[i].total_duration
-        = GNUNET_TIME_relative_add (duration,
-                                    timings[i].total_duration);
-      timings[i].success_latency
-        = GNUNET_TIME_relative_add (lat,
-                                    timings[i].success_latency);
-      timings[i].num_commands++;
-      timings[i].num_retries += cmd->num_tries;
-      break;
-    }
-  }
-}
-
-
-/**
- * Obtain statistics for @a timings of @a cmd
- *
- * @param[in,out] cls what timings to get
- * @param cmd command to process
- */
-static void
-do_stat (void *cls,
-         const struct TALER_TESTING_Command *cmd)
-{
-  struct TALER_TESTING_Timer *timings = cls;
-
-  if (TALER_TESTING_cmd_is_batch (cmd))
-  {
-    struct TALER_TESTING_Command *bcmd;
-
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_batch_cmds (cmd,
-                                            &bcmd))
-    {
-      GNUNET_break (0);
-      return;
-    }
-    for (unsigned int j = 0;
-         NULL != bcmd[j].label;
-         j++)
-      do_stat (timings,
-               &bcmd[j]);
-    return;
-  }
-  stat_cmd (timings,
-            cmd);
-}
-
-
-/**
- * Run a "stat" CMD.
- *
- * @param cls closure.
- * @param cmd the command being run.
- * @param is the interpreter state.
- */
-static void
-stat_run (void *cls,
-          const struct TALER_TESTING_Command *cmd,
-          struct TALER_TESTING_Interpreter *is)
-{
-  struct TALER_TESTING_Timer *timings = cls;
-
-  TALER_TESTING_iterate (is,
-                         true,
-                         &do_stat,
-                         timings);
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_stat (struct TALER_TESTING_Timer *timers)
-{
-  struct TALER_TESTING_Command cmd = {
-    .label = "stat",
-    .run = &stat_run,
-    .cls = (void *) timers
-  };
-
-  return cmd;
-}
-
-
-/* end of testing_api_cmd_stat.c  */
diff --git a/src/testing/testing_api_cmd_transfer_get.c 
b/src/testing/testing_api_cmd_transfer_get.c
deleted file mode 100644
index 2a4b969..0000000
--- a/src/testing/testing_api_cmd_transfer_get.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2014-2020 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
-  CHARITYABILITY 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/>
-*/
-
-/**
- * @file testing/testing_api_cmd_transfer_get.c
- * @brief Implement the testing CMDs for the /transfer GET operation.
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-/**
- * State for a "track transfer" CMD.
- */
-struct TrackTransferState
-{
-
-  /**
-   * Expected amount for the WTID being tracked.
-   */
-  const char *expected_total_amount;
-
-  /**
-   * Expected fee for this WTID.
-   */
-  const char *expected_wire_fee;
-
-  /**
-   * Our command.
-   */
-  const struct TALER_TESTING_Command *cmd;
-
-  /**
-   * Reference to any operation that can provide a WTID.
-   * Will be the WTID to track.
-   */
-  const char *wtid_reference;
-
-  /**
-   * Reference to any operation that can provide wire details.
-   * Those wire details will then be matched against the credit
-   * bank account of the tracked WTID.  This way we can test that
-   * a wire transfer paid back one particular bank account.
-   */
-  const char *wire_details_reference;
-
-  /**
-   * Reference to any operation that can provide an amount.
-   * This way we can check that the transferred amount matches
-   * our expectations.
-   */
-  const char *total_amount_reference;
-
-  /**
-   * Handle to a pending "track transfer" operation.
-   */
-  struct DONAU_TransfersGetHandle *tth;
-
-  /**
-   * Interpreter state.
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Expected HTTP response code.
-   */
-  unsigned int expected_response_code;
-
-};
-
-
-/**
- * Cleanup the state for a "track transfer" CMD, and possibly
- * cancel a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-track_transfer_cleanup (void *cls,
-                        const struct TALER_TESTING_Command *cmd)
-{
-
-  struct TrackTransferState *tts = cls;
-
-  if (NULL != tts->tth)
-  {
-    TALER_TESTING_command_incomplete (tts->is,
-                                      cmd->label);
-    DONAU_transfers_get_cancel (tts->tth);
-    tts->tth = NULL;
-  }
-  GNUNET_free (tts);
-}
-
-
-/**
- * Check whether the HTTP response code from a "track transfer"
- * operation is acceptable, and all other values like total amount,
- * wire fees and hashed wire details as well.
- *
- * @param cls closure.
- * @param tgr response details
- */
-static void
-track_transfer_cb (void *cls,
-                   const struct DONAU_TransfersGetResponse *tgr)
-{
-  struct TrackTransferState *tts = cls;
-  const struct DONAU_HttpResponse *hr = &tgr->hr;
-  struct TALER_TESTING_Interpreter *is = tts->is;
-  struct TALER_Amount expected_amount;
-
-  tts->tth = NULL;
-  if (tts->expected_response_code != hr->http_status)
-  {
-    TALER_TESTING_unexpected_status (is,
-                                     hr->http_status,
-                                     tts->expected_response_code);
-    return;
-  }
-
-  switch (hr->http_status)
-  {
-  case MHD_HTTP_OK:
-    {
-      const struct DONAU_TransferData *ta
-        = &tgr->details.ok.td;
-
-      if (NULL == tts->expected_total_amount)
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-      if (NULL == tts->expected_wire_fee)
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-
-      if (GNUNET_OK !=
-          TALER_string_to_amount (tts->expected_total_amount,
-                                  &expected_amount))
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-      if (0 != TALER_amount_cmp (&ta->total_amount,
-                                 &expected_amount))
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Total amount mismatch to command %s - "
-                    "%s vs %s\n",
-                    tts->cmd->label,
-                    TALER_amount_to_string (&ta->total_amount),
-                    TALER_amount_to_string (&expected_amount));
-        json_dumpf (hr->reply,
-                    stderr,
-                    0);
-        fprintf (stderr, "\n");
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-
-      if (GNUNET_OK !=
-          TALER_string_to_amount (tts->expected_wire_fee,
-                                  &expected_amount))
-      {
-        GNUNET_break (0);
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-
-      if (0 != TALER_amount_cmp (&ta->wire_fee,
-                                 &expected_amount))
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Wire fee mismatch to command %s\n",
-                    tts->cmd->label);
-        json_dumpf (hr->reply,
-                    stderr,
-                    0);
-        TALER_TESTING_interpreter_fail (is);
-        return;
-      }
-
-      /**
-       * Optionally checking: (1) wire-details for this transfer
-       * match the ones from a referenced "deposit" operation -
-       * or any operation that could provide wire-details.  (2)
-       * Total amount for this transfer matches the one from any
-       * referenced command that could provide one.
-       */
-      if (NULL != tts->wire_details_reference)
-      {
-        const struct TALER_TESTING_Command *wire_details_cmd;
-        const char *payto_uri;
-        struct TALER_PaytoHashP h_payto;
-
-        wire_details_cmd
-          = TALER_TESTING_interpreter_lookup_command (is,
-                                                      tts->
-                                                      wire_details_reference);
-        if (NULL == wire_details_cmd)
-        {
-          GNUNET_break (0);
-          TALER_TESTING_interpreter_fail (is);
-          return;
-        }
-        if (GNUNET_OK !=
-            TALER_TESTING_get_trait_payto_uri (wire_details_cmd,
-                                               &payto_uri))
-        {
-          GNUNET_break (0);
-          TALER_TESTING_interpreter_fail (is);
-          return;
-        }
-        TALER_payto_hash (payto_uri,
-                          &h_payto);
-        if (0 != GNUNET_memcmp (&h_payto,
-                                &ta->h_payto))
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                      "Wire hash missmath to command %s\n",
-                      tts->cmd->label);
-          json_dumpf (hr->reply,
-                      stderr,
-                      0);
-          TALER_TESTING_interpreter_fail (is);
-          return;
-        }
-      }
-      if (NULL != tts->total_amount_reference)
-      {
-        const struct TALER_TESTING_Command *total_amount_cmd;
-        const struct TALER_Amount *total_amount_from_reference;
-
-        total_amount_cmd
-          = TALER_TESTING_interpreter_lookup_command (is,
-                                                      tts->
-                                                      total_amount_reference);
-        if (NULL == total_amount_cmd)
-        {
-          GNUNET_break (0);
-          TALER_TESTING_interpreter_fail (is);
-          return;
-        }
-        if (GNUNET_OK !=
-            TALER_TESTING_get_trait_amount (total_amount_cmd,
-                                            &total_amount_from_reference))
-        {
-          GNUNET_break (0);
-          TALER_TESTING_interpreter_fail (is);
-          return;
-        }
-        if (0 != TALER_amount_cmp (&ta->total_amount,
-                                   total_amount_from_reference))
-        {
-          GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                      "Amount mismatch in command %s\n",
-                      tts->cmd->label);
-          json_dumpf (hr->reply,
-                      stderr,
-                      0);
-          TALER_TESTING_interpreter_fail (is);
-          return;
-        }
-      }
-      break;
-    } /* case OK */
-  } /* switch on status */
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the command under execution.
- * @param is the interpreter state.
- */
-static void
-track_transfer_run (void *cls,
-                    const struct TALER_TESTING_Command *cmd,
-                    struct TALER_TESTING_Interpreter *is)
-{
-  /* looking for a wtid to track .. */
-  struct TrackTransferState *tts = cls;
-  struct TALER_WireTransferIdentifierRawP wtid;
-  const struct TALER_WireTransferIdentifierRawP *wtid_ptr;
-
-  tts->cmd = cmd;
-  /* If no reference is given, we'll use a all-zeros
-   * WTID */
-  memset (&wtid,
-          0,
-          sizeof (wtid));
-  wtid_ptr = &wtid;
-  tts->is = is;
-  if (NULL != tts->wtid_reference)
-  {
-    const struct TALER_TESTING_Command *wtid_cmd;
-
-    wtid_cmd = TALER_TESTING_interpreter_lookup_command (tts->is,
-                                                         tts->wtid_reference);
-    if (NULL == wtid_cmd)
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (tts->is);
-      return;
-    }
-
-    if (GNUNET_OK !=
-        TALER_TESTING_get_trait_wtid (wtid_cmd,
-                                      &wtid_ptr))
-    {
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (tts->is);
-      return;
-    }
-    GNUNET_assert (NULL != wtid_ptr);
-  }
-  tts->tth = DONAU_transfers_get (
-    TALER_TESTING_interpreter_get_context (is),
-    TALER_TESTING_get_donau_url (is),
-    TALER_TESTING_get_keys (is),
-    wtid_ptr,
-    &track_transfer_cb,
-    tts);
-  GNUNET_assert (NULL != tts->tth);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_track_transfer_empty (const char *label,
-                                        const char *wtid_reference,
-                                        unsigned int expected_response_code)
-{
-  struct TrackTransferState *tts;
-
-  tts = GNUNET_new (struct TrackTransferState);
-  tts->wtid_reference = wtid_reference;
-  tts->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = tts,
-      .label = label,
-      .run = &track_transfer_run,
-      .cleanup = &track_transfer_cleanup
-    };
-
-    return cmd;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_track_transfer (const char *label,
-                                  const char *wtid_reference,
-                                  unsigned int expected_response_code,
-                                  const char *expected_total_amount,
-                                  const char *expected_wire_fee)
-{
-  struct TrackTransferState *tts;
-
-  tts = GNUNET_new (struct TrackTransferState);
-  tts->wtid_reference = wtid_reference;
-  tts->expected_response_code = expected_response_code;
-  tts->expected_total_amount = expected_total_amount;
-  tts->expected_wire_fee = expected_wire_fee;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = tts,
-      .label = label,
-      .run = &track_transfer_run,
-      .cleanup = &track_transfer_cleanup
-    };
-
-    return cmd;
-  }
-}
-
-
-/* end of testing_api_cmd_gransfer_get.c */
diff --git a/src/testing/testing_api_cmd_wait.c 
b/src/testing/testing_api_cmd_wait.c
deleted file mode 100644
index 3aa3759..0000000
--- a/src/testing/testing_api_cmd_wait.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-  This file is part of TALER
-  (C) 2018 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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_wait.c
- * @brief command(s) to wait on some process
- * @author Christian Grothoff
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_testing_lib.h"
-
-
-/**
- * Cleanup the state from a "wait service" CMD.
- *
- * @param cls closure.
- * @param cmd the command which is being cleaned up.
- */
-static void
-wait_service_cleanup (void *cls,
-                      const struct TALER_TESTING_Command *cmd)
-{
-  (void) cls;
-  (void) cmd;
-  /* nothing to clean.  */
-  return;
-}
-
-
-/**
- * No traits to offer, just provide a stub to be called when
- * some CMDs iterates through the list of all the commands.
- *
- * @param cls closure.
- * @param[out] ret result.
- * @param trait name of the trait.
- * @param index index number of the trait to return.
- * @return #GNUNET_OK on success.
- */
-static int
-wait_service_traits (void *cls,
-                     const void **ret,
-                     const char *trait,
-                     unsigned int index)
-{
-  (void) cls;
-  (void) ret;
-  (void) trait;
-  (void) index;
-  return GNUNET_NO;
-}
-
-
-/**
- * Run a "wait service" CMD.
- *
- * @param cls closure.
- * @param cmd the command being run.
- * @param is the interpreter state.
- */
-static void
-wait_service_run (void *cls,
-                  const struct TALER_TESTING_Command *cmd,
-                  struct TALER_TESTING_Interpreter *is)
-{
-  unsigned int iter = 0;
-  const char *url = cmd->cls;
-  char *wget_cmd;
-
-  (void) cls;
-  GNUNET_asprintf (&wget_cmd,
-                   "wget -q -t 1 -T 1 %s -o /dev/null -O /dev/null",
-                   url);
-  do
-  {
-    fprintf (stderr, ".");
-
-    if (10 == iter++)
-    {
-      TALER_LOG_ERROR ("Could not reach the proxied service\n");
-      TALER_TESTING_interpreter_fail (is);
-      GNUNET_free (wget_cmd);
-      return;
-    }
-  }
-  while (0 != system (wget_cmd));
-
-  GNUNET_free (wget_cmd);
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * This CMD simply tries to connect via HTTP to the
- * service addressed by @a url.  It attempts 10 times
- * before giving up and make the test fail.
- *
- * @param label label for the command.
- * @param url complete URL to connect to.
- */
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_wait_service (const char *label,
-                                const char *url)
-{
-  struct TALER_TESTING_Command cmd = {
-    .label = label,
-    .run = wait_service_run,
-    .cleanup = wait_service_cleanup,
-    .traits = wait_service_traits,
-    .cls = (void *) url
-  };
-
-  return cmd;
-}
-
-
-/* end of testing_api_cmd_sleep.c  */
diff --git a/src/testing/testing_api_cmd_withdraw.c 
b/src/testing/testing_api_cmd_withdraw.c
deleted file mode 100644
index 492a68c..0000000
--- a/src/testing/testing_api_cmd_withdraw.c
+++ /dev/null
@@ -1,696 +0,0 @@
-/*
-  This file is part of TALER
-  Copyright (C) 2018-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
-  CHARITYABILITY 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/>
-*/
-/**
- * @file testing/testing_api_cmd_withdraw.c
- * @brief main interpreter loop for testcases
- * @author Christian Grothoff
- * @author Marcello Stanisci
- */
-#include "taler/platform.h"
-#include "taler/taler_json_lib.h"
-#include <microhttpd.h>
-#include <gnunet/gnunet_curl_lib.h>
-#include "taler_signatures.h"
-#include "taler/taler_extensions.h"
-#include "taler_testing_lib.h"
-#include "backoff.h"
-
-
-/**
- * How often do we retry before giving up?
- */
-#define NUM_RETRIES 15
-
-/**
- * How long do we wait AT LEAST if the donau says the reserve is unknown?
- */
-#define UNKNOWN_MIN_BACKOFF GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_MILLISECONDS, 10)
-
-/**
- * How long do we wait AT MOST if the donau says the reserve is unknown?
- */
-#define UNKNOWN_MAX_BACKOFF GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_MILLISECONDS, 100)
-
-/**
- * State for a "withdraw" CMD.
- */
-struct WithdrawState
-{
-
-  /**
-   * Which reserve should we withdraw from?
-   */
-  const char *reserve_reference;
-
-  /**
-   * Reference to a withdraw or reveal operation from which we should
-   * re-use the private coin key, or NULL for regular withdrawal.
-   */
-  const char *reuse_coin_key_ref;
-
-  /**
-   * Our command.
-   */
-  const struct TALER_TESTING_Command *cmd;
-
-  /**
-   * String describing the denomination value we should withdraw.
-   * A corresponding denomination key must exist in the donau's
-   * offerings.  Can be NULL if @e pk is set instead.
-   */
-  struct TALER_Amount amount;
-
-  /**
-   * If @e amount is NULL, this specifies the denomination key to
-   * use.  Otherwise, this will be set (by the interpreter) to the
-   * denomination PK matching @e amount.
-   */
-  struct DONAU_DenomPublicKey *pk;
-
-  /**
-   * Donau base URL.  Only used as offered trait.
-   */
-  char *donau_url;
-
-  /**
-   * URI if the reserve we are withdrawing from.
-   */
-  char *reserve_payto_uri;
-
-  /**
-   * Private key of the reserve we are withdrawing from.
-   */
-  struct TALER_ReservePrivateKeyP reserve_priv;
-
-  /**
-   * Public key of the reserve we are withdrawing from.
-   */
-  struct TALER_ReservePublicKeyP reserve_pub;
-
-  /**
-   * Private key of the coin.
-   */
-  struct TALER_CoinSpendPrivateKeyP coin_priv;
-
-  /**
-   * Blinding key used during the operation.
-   */
-  union TALER_DenominationBlindingKeyP bks;
-
-  /**
-   * Values contributed from the donau during the
-   * withdraw protocol.
-   */
-  struct TALER_DonauWithdrawValues donau_vals;
-
-  /**
-   * Interpreter state (during command).
-   */
-  struct TALER_TESTING_Interpreter *is;
-
-  /**
-   * Set (by the interpreter) to the donau's signature over the
-   * coin's public key.
-   */
-  struct TALER_DenominationSignature sig;
-
-  /**
-   * Private key material of the coin, set by the interpreter.
-   */
-  struct TALER_PlanchetMasterSecretP ps;
-
-  /**
-   * An age > 0 signifies age restriction is required
-   */
-  uint8_t age;
-
-  /**
-   * If age > 0, put here the corresponding age commitment with its proof and
-   * its hash, respectivelly.
-   */
-  struct TALER_AgeCommitmentProof age_commitment_proof;
-  struct TALER_AgeCommitmentHash h_age_commitment;
-
-  /**
-   * Reserve history entry that corresponds to this operation.
-   * Will be of type #DONAU_RTT_WITHDRAWAL.
-   */
-  struct DONAU_ReserveHistoryEntry reserve_history;
-
-  /**
-   * Withdraw handle (while operation is running).
-   */
-  struct DONAU_WithdrawHandle *wsh;
-
-  /**
-   * Task scheduled to try later.
-   */
-  struct GNUNET_SCHEDULER_Task *retry_task;
-
-  /**
-   * How long do we wait until we retry?
-   */
-  struct GNUNET_TIME_Relative backoff;
-
-  /**
-   * Total withdraw backoff applied.
-   */
-  struct GNUNET_TIME_Relative total_backoff;
-
-  /**
-   * Set to the KYC requirement payto hash *if* the donau replied with a
-   * request for KYC.
-   */
-  struct TALER_PaytoHashP h_payto;
-
-  /**
-   * Set to the KYC requirement row *if* the donau replied with
-   * a request for KYC.
-   */
-  uint64_t requirement_row;
-
-  /**
-   * Expected HTTP response code to the request.
-   */
-  unsigned int expected_response_code;
-
-  /**
-   * Was this command modified via
-   * #TALER_TESTING_cmd_withdraw_with_retry to
-   * enable retries? How often should we still retry?
-   */
-  unsigned int do_retry;
-};
-
-
-/**
- * Run the command.
- *
- * @param cls closure.
- * @param cmd the commaind being run.
- * @param is interpreter state.
- */
-static void
-withdraw_run (void *cls,
-              const struct TALER_TESTING_Command *cmd,
-              struct TALER_TESTING_Interpreter *is);
-
-
-/**
- * Task scheduled to re-try #withdraw_run.
- *
- * @param cls a `struct WithdrawState`
- */
-static void
-do_retry (void *cls)
-{
-  struct WithdrawState *ws = cls;
-
-  ws->retry_task = NULL;
-  TALER_TESTING_touch_cmd (ws->is);
-  withdraw_run (ws,
-                NULL,
-                ws->is);
-}
-
-
-/**
- * "reserve withdraw" operation callback; checks that the
- * response code is expected and store the donau signature
- * in the state.
- *
- * @param cls closure.
- * @param wr withdraw response details
- */
-static void
-reserve_withdraw_cb (void *cls,
-                     const struct DONAU_WithdrawResponse *wr)
-{
-  struct WithdrawState *ws = cls;
-  struct TALER_TESTING_Interpreter *is = ws->is;
-
-  ws->wsh = NULL;
-  if (ws->expected_response_code != wr->hr.http_status)
-  {
-    if (0 != ws->do_retry)
-    {
-      if (TALER_EC_DONAU_GENERIC_RESERVE_UNKNOWN != wr->hr.ec)
-        ws->do_retry--; /* we don't count reserve unknown as failures here */
-      if ( (0 == wr->hr.http_status) ||
-           (TALER_EC_GENERIC_DB_SOFT_FAILURE == wr->hr.ec) ||
-           (TALER_EC_DONAU_WITHDRAW_INSUFFICIENT_FUNDS == wr->hr.ec) ||
-           (TALER_EC_DONAU_GENERIC_RESERVE_UNKNOWN == wr->hr.ec) ||
-           (MHD_HTTP_INTERNAL_SERVER_ERROR == wr->hr.http_status) )
-      {
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "Retrying withdraw failed with %u/%d\n",
-                    wr->hr.http_status,
-                    (int) wr->hr.ec);
-        /* on DB conflicts, do not use backoff */
-        if (TALER_EC_GENERIC_DB_SOFT_FAILURE == wr->hr.ec)
-          ws->backoff = GNUNET_TIME_UNIT_ZERO;
-        else if (TALER_EC_DONAU_GENERIC_RESERVE_UNKNOWN != wr->hr.ec)
-          ws->backoff = DONAU_LIB_BACKOFF (ws->backoff);
-        else
-          ws->backoff = GNUNET_TIME_relative_max (UNKNOWN_MIN_BACKOFF,
-                                                  ws->backoff);
-        ws->backoff = GNUNET_TIME_relative_min (ws->backoff,
-                                                UNKNOWN_MAX_BACKOFF);
-        ws->total_backoff = GNUNET_TIME_relative_add (ws->total_backoff,
-                                                      ws->backoff);
-        TALER_TESTING_inc_tries (ws->is);
-        ws->retry_task = GNUNET_SCHEDULER_add_delayed (ws->backoff,
-                                                       &do_retry,
-                                                       ws);
-        return;
-      }
-    }
-    TALER_TESTING_unexpected_status_with_body (is,
-                                               wr->hr.http_status,
-                                               ws->expected_response_code,
-                                               wr->hr.reply);
-    return;
-  }
-  switch (wr->hr.http_status)
-  {
-  case MHD_HTTP_OK:
-    TALER_denom_sig_deep_copy (&ws->sig,
-                               &wr->details.ok.sig);
-    ws->coin_priv = wr->details.ok.coin_priv;
-    ws->bks = wr->details.ok.bks;
-    ws->donau_vals = wr->details.ok.donau_vals;
-    if (0 != ws->total_backoff.rel_value_us)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                  "Total withdraw backoff for %s was %s\n",
-                  ws->cmd->label,
-                  GNUNET_STRINGS_relative_time_to_string (ws->total_backoff,
-                                                          true));
-    }
-    break;
-  case MHD_HTTP_FORBIDDEN:
-    /* nothing to check */
-    break;
-  case MHD_HTTP_NOT_FOUND:
-    /* nothing to check */
-    break;
-  case MHD_HTTP_CONFLICT:
-    /* nothing to check */
-    break;
-  case MHD_HTTP_GONE:
-    /* theoretically could check that the key was actually */
-    break;
-  case MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS:
-    /* KYC required */
-    ws->requirement_row =
-      wr->details.unavailable_for_legal_reasons.requirement_row;
-    ws->h_payto
-      = wr->details.unavailable_for_legal_reasons.h_payto;
-    break;
-  default:
-    /* Unsupported status code (by test harness) */
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                "Withdraw test command does not support status code %u\n",
-                wr->hr.http_status);
-    GNUNET_break (0);
-    break;
-  }
-  TALER_TESTING_interpreter_next (is);
-}
-
-
-/**
- * Run the command.
- */
-static void
-withdraw_run (void *cls,
-              const struct TALER_TESTING_Command *cmd,
-              struct TALER_TESTING_Interpreter *is)
-{
-  struct WithdrawState *ws = cls;
-  const struct TALER_ReservePrivateKeyP *rp;
-  const struct TALER_TESTING_Command *create_reserve;
-  const struct DONAU_DenomPublicKey *dpk;
-
-  if (NULL != cmd)
-    ws->cmd = cmd;
-  ws->is = is;
-  create_reserve
-    = TALER_TESTING_interpreter_lookup_command (
-        is,
-        ws->reserve_reference);
-  if (NULL == create_reserve)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (GNUNET_OK !=
-      TALER_TESTING_get_trait_reserve_priv (create_reserve,
-                                            &rp))
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-  if (NULL == ws->donau_url)
-    ws->donau_url
-      = GNUNET_strdup (TALER_TESTING_get_donau_url (is));
-  ws->reserve_priv = *rp;
-  GNUNET_CRYPTO_eddsa_key_get_public (&ws->reserve_priv.eddsa_priv,
-                                      &ws->reserve_pub.eddsa_pub);
-  ws->reserve_payto_uri
-    = TALER_reserve_make_payto (ws->donau_url,
-                                &ws->reserve_pub);
-
-  if (NULL == ws->reuse_coin_key_ref)
-  {
-    TALER_planchet_master_setup_random (&ws->ps);
-  }
-  else
-  {
-    const struct TALER_PlanchetMasterSecretP *ps;
-    const struct TALER_TESTING_Command *cref;
-    char *cstr;
-    unsigned int index;
-
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_TESTING_parse_coin_reference (
-                     ws->reuse_coin_key_ref,
-                     &cstr,
-                     &index));
-    cref = TALER_TESTING_interpreter_lookup_command (is,
-                                                     cstr);
-    GNUNET_assert (NULL != cref);
-    GNUNET_free (cstr);
-    GNUNET_assert (GNUNET_OK ==
-                   TALER_TESTING_get_trait_planchet_secret (cref,
-                                                            &ps));
-    ws->ps = *ps;
-  }
-
-  if (NULL == ws->pk)
-  {
-    dpk = TALER_TESTING_find_pk (TALER_TESTING_get_keys (is),
-                                 &ws->amount,
-                                 ws->age > 0);
-    if (NULL == dpk)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Failed to determine denomination key at %s\n",
-                  (NULL != cmd) ? cmd->label : "<retried command>");
-      GNUNET_break (0);
-      TALER_TESTING_interpreter_fail (is);
-      return;
-    }
-    /* We copy the denomination key, as re-querying /keys
-     * would free the old one. */
-    ws->pk = DONAU_copy_denomination_key (dpk);
-  }
-  else
-  {
-    ws->amount = ws->pk->value;
-  }
-
-  ws->reserve_history.type = DONAU_RTT_WITHDRAWAL;
-  GNUNET_assert (0 <=
-                 TALER_amount_add (&ws->reserve_history.amount,
-                                   &ws->amount,
-                                   &ws->pk->fees.withdraw));
-  ws->reserve_history.details.withdraw.fee = ws->pk->fees.withdraw;
-  {
-    struct DONAU_WithdrawCoinInput wci = {
-      .pk = ws->pk,
-      .ps = &ws->ps,
-      .ach = 0 < ws->age ? &ws->h_age_commitment : NULL
-    };
-    ws->wsh = DONAU_withdraw (
-      TALER_TESTING_interpreter_get_context (is),
-      TALER_TESTING_get_donau_url (is),
-      TALER_TESTING_get_keys (is),
-      rp,
-      &wci,
-      &reserve_withdraw_cb,
-      ws);
-  }
-  if (NULL == ws->wsh)
-  {
-    GNUNET_break (0);
-    TALER_TESTING_interpreter_fail (is);
-    return;
-  }
-}
-
-
-/**
- * Free the state of a "withdraw" CMD, and possibly cancel
- * a pending operation thereof.
- *
- * @param cls closure.
- * @param cmd the command being freed.
- */
-static void
-withdraw_cleanup (void *cls,
-                  const struct TALER_TESTING_Command *cmd)
-{
-  struct WithdrawState *ws = cls;
-
-  if (NULL != ws->wsh)
-  {
-    TALER_TESTING_command_incomplete (ws->is,
-                                      cmd->label);
-    DONAU_withdraw_cancel (ws->wsh);
-    ws->wsh = NULL;
-  }
-  if (NULL != ws->retry_task)
-  {
-    GNUNET_SCHEDULER_cancel (ws->retry_task);
-    ws->retry_task = NULL;
-  }
-  TALER_denom_sig_free (&ws->sig);
-  if (NULL != ws->pk)
-  {
-    DONAU_destroy_denomination_key (ws->pk);
-    ws->pk = NULL;
-  }
-  if (ws->age > 0)
-    TALER_age_commitment_proof_free (&ws->age_commitment_proof);
-  GNUNET_free (ws->donau_url);
-  GNUNET_free (ws->reserve_payto_uri);
-  GNUNET_free (ws);
-}
-
-
-/**
- * Offer internal data to a "withdraw" CMD state to other
- * commands.
- *
- * @param cls closure
- * @param[out] ret result (could be anything)
- * @param trait name of the trait
- * @param index index number of the object to offer.
- * @return #GNUNET_OK on success
- */
-static enum GNUNET_GenericReturnValue
-withdraw_traits (void *cls,
-                 const void **ret,
-                 const char *trait,
-                 unsigned int index)
-{
-  struct WithdrawState *ws = cls;
-  struct TALER_TESTING_Trait traits[] = {
-    /* history entry MUST be first due to response code logic below! */
-    TALER_TESTING_make_trait_reserve_history (0,
-                                              &ws->reserve_history),
-    TALER_TESTING_make_trait_coin_priv (0 /* only one coin */,
-                                        &ws->coin_priv),
-    TALER_TESTING_make_trait_planchet_secret (&ws->ps),
-    TALER_TESTING_make_trait_blinding_key (0 /* only one coin */,
-                                           &ws->bks),
-    TALER_TESTING_make_trait_donau_wd_value (0 /* only one coin */,
-                                             &ws->donau_vals),
-    TALER_TESTING_make_trait_denom_pub (0 /* only one coin */,
-                                        ws->pk),
-    TALER_TESTING_make_trait_denom_sig (0 /* only one coin */,
-                                        &ws->sig),
-    TALER_TESTING_make_trait_reserve_priv (&ws->reserve_priv),
-    TALER_TESTING_make_trait_reserve_pub (&ws->reserve_pub),
-    TALER_TESTING_make_trait_amount (&ws->amount),
-    TALER_TESTING_make_trait_legi_requirement_row (&ws->requirement_row),
-    TALER_TESTING_make_trait_h_payto (&ws->h_payto),
-    TALER_TESTING_make_trait_payto_uri (ws->reserve_payto_uri),
-    TALER_TESTING_make_trait_donau_url (ws->donau_url),
-    TALER_TESTING_make_trait_age_commitment_proof (0,
-                                                   0 < ws->age
-                                                   ? &ws->age_commitment_proof
-                                                   : NULL),
-    TALER_TESTING_make_trait_h_age_commitment (0,
-                                               0 < ws->age
-                                               ? &ws->h_age_commitment
-                                               : NULL),
-    TALER_TESTING_trait_end ()
-  };
-
-  return TALER_TESTING_get_trait ((ws->expected_response_code == MHD_HTTP_OK)
-                                  ? &traits[0]   /* we have reserve history */
-                                  : &traits[1],  /* skip reserve history */
-                                  ret,
-                                  trait,
-                                  index);
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_withdraw_amount (const char *label,
-                                   const char *reserve_reference,
-                                   const char *amount,
-                                   uint8_t age,
-                                   unsigned int expected_response_code)
-{
-  struct WithdrawState *ws;
-
-  ws = GNUNET_new (struct WithdrawState);
-  ws->age = age;
-  if (0 < age)
-  {
-    struct GNUNET_HashCode seed;
-    struct TALER_AgeMask mask;
-
-    mask = TALER_extensions_get_age_restriction_mask ();
-    GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
-                                &seed,
-                                sizeof(seed));
-
-    if (GNUNET_OK !=
-        TALER_age_restriction_commit (
-          &mask,
-          age,
-          &seed,
-          &ws->age_commitment_proof))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "Failed to generate age commitment for age %d at %s\n",
-                  age,
-                  label);
-      GNUNET_assert (0);
-    }
-    TALER_age_commitment_hash (&ws->age_commitment_proof.commitment,
-                               &ws->h_age_commitment);
-  }
-
-  ws->reserve_reference = reserve_reference;
-  if (GNUNET_OK !=
-      TALER_string_to_amount (amount,
-                              &ws->amount))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Failed to parse amount `%s' at %s\n",
-                amount,
-                label);
-    GNUNET_assert (0);
-  }
-  ws->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ws,
-      .label = label,
-      .run = &withdraw_run,
-      .cleanup = &withdraw_cleanup,
-      .traits = &withdraw_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_withdraw_amount_reuse_key (
-  const char *label,
-  const char *reserve_reference,
-  const char *amount,
-  uint8_t age,
-  const char *coin_ref,
-  unsigned int expected_response_code)
-{
-  struct TALER_TESTING_Command cmd;
-
-  cmd = TALER_TESTING_cmd_withdraw_amount (label,
-                                           reserve_reference,
-                                           amount,
-                                           age,
-                                           expected_response_code);
-  {
-    struct WithdrawState *ws = cmd.cls;
-
-    ws->reuse_coin_key_ref = coin_ref;
-  }
-  return cmd;
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_withdraw_denomination (
-  const char *label,
-  const char *reserve_reference,
-  const struct DONAU_DenomPublicKey *dk,
-  unsigned int expected_response_code)
-{
-  struct WithdrawState *ws;
-
-  if (NULL == dk)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Denomination key not specified at %s\n",
-                label);
-    GNUNET_assert (0);
-  }
-  ws = GNUNET_new (struct WithdrawState);
-  ws->reserve_reference = reserve_reference;
-  ws->pk = DONAU_copy_denomination_key (dk);
-  ws->expected_response_code = expected_response_code;
-  {
-    struct TALER_TESTING_Command cmd = {
-      .cls = ws,
-      .label = label,
-      .run = &withdraw_run,
-      .cleanup = &withdraw_cleanup,
-      .traits = &withdraw_traits
-    };
-
-    return cmd;
-  }
-}
-
-
-struct TALER_TESTING_Command
-TALER_TESTING_cmd_withdraw_with_retry (struct TALER_TESTING_Command cmd)
-{
-  struct WithdrawState *ws;
-
-  GNUNET_assert (&withdraw_run == cmd.run);
-  ws = cmd.cls;
-  ws->do_retry = NUM_RETRIES;
-  return cmd;
-}
-
-
-/* end of testing_api_cmd_withdraw.c */
diff --git a/src/util/donau-config.c b/src/util/donau-config.c
index 6337e4f..174cf99 100644
--- a/src/util/donau-config.c
+++ b/src/util/donau-config.c
@@ -56,7 +56,7 @@ main (int argc,
                             argv,
                             "donau-config [OPTIONS]",
                             gettext_noop (
-                              "Manipulate Taler configuration files"),
+                              "Manipulate Donau configuration files"),
                             options,
                             &GNUNET_CONFIGURATION_config_tool_run,
                             &cs);

-- 
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]