From d97ef7fcf67cdf986f5cebd854b1688a71c573d5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 30 Oct 2022 18:49:21 +0100 Subject: -fix FTBFS of new taler-helper-auditor-purses --- src/include/taler_auditordb_plugin.h | 136 +++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h index d26e42b78..129b51714 100644 --- a/src/include/taler_auditordb_plugin.h +++ b/src/include/taler_auditordb_plugin.h @@ -233,6 +233,23 @@ struct TALER_AUDITORDB_ProgressPointPurse }; +/** + * Global statistics about purses. + */ +struct TALER_AUDITORDB_PurseBalance +{ + /** + * Balance in all unmerged and unexpired purses. + */ + struct TALER_Amount balance; + + /** + * Total number of open purses. + */ + uint64_t open_purses; +}; + + /** * Structure for remembering the auditor's progress over the various * tables and (auditor) transactions when analyzing reserves. @@ -1195,6 +1212,79 @@ struct TALER_AUDITORDB_Plugin const struct TALER_MasterPublicKeyP *master_pub); + /** + * Insert information about a purse. There must not be an + * existing record for the purse. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param purse_pub public key of the purse + * @param master_pub master public key of the exchange + * @param balance balance of the purse + * @param expiration_date expiration date of the reserve + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*insert_purse_info)( + void *cls, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_MasterPublicKeyP *master_pub, + const struct TALER_Amount *balance, + struct GNUNET_TIME_Timestamp expiration_date); + + + /** + * Update information about a purse. Destructively updates an + * existing record, which must already exist. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param purse_pub public key of the purse + * @param master_pub master public key of the exchange + * @param balance new balance for the purse + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*update_purse_info)( + void *cls, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_MasterPublicKeyP *master_pub, + const struct TALER_Amount *balance); + + + /** + * Get information about a purse. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param reserve_pub public key of the reserve + * @param master_pub master public key of the exchange + * @param[out] rowid which row did we get the information from + * @param[out] balance set to balance of the purse + * @param[out] expiration_date expiration date of the purse + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*get_purse_info)( + void *cls, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_MasterPublicKeyP *master_pub, + uint64_t *rowid, + struct TALER_Amount *balance, + struct GNUNET_TIME_Timestamp *expiration_date); + + + /** + * Delete information about a purse. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param purse_pub public key of the purse + * @param master_pub master public key of the exchange + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*del_purse_info)(void *cls, + const struct TALER_PurseContractPublicKeyP *purse_pub, + const struct TALER_MasterPublicKeyP *master_pub); + + /** * Insert information about all reserves. There must not be an * existing record for the @a master_pub. @@ -1241,6 +1331,52 @@ struct TALER_AUDITORDB_Plugin struct TALER_AUDITORDB_ReserveFeeBalance *rfb); + /** + * Insert information about all purses. There must not be an + * existing record for the @a master_pub. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param master_pub master public key of the exchange + * @param sum purse balance summary to store + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*insert_purse_summary)( + void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + const struct TALER_AUDITORDB_PurseBalance *sum); + + + /** + * Update information about all purses. Destructively updates an + * existing record, which must already exist. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param master_pub master public key of the exchange + * @param sum purse balances summary to store + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*update_purse_summary)( + void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + const struct TALER_AUDITORDB_PurseBalance *sum); + + + /** + * Get summary information about all purses. + * + * @param cls the @e cls of this struct with the plugin-specific state + * @param master_pub master public key of the exchange + * @param[out] sum purse balances summary to initialize + * @return transaction status code + */ + enum GNUNET_DB_QueryStatus + (*get_purse_summary)(void *cls, + const struct TALER_MasterPublicKeyP *master_pub, + struct TALER_AUDITORDB_PurseBalance *sum); + + /** * Insert information about exchange's wire fee balance. There must not be an * existing record for the same @a master_pub. -- cgit v1.2.3