diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-10-14 00:29:32 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-10-14 00:30:52 +0200 |
commit | 5f333f817c0fe4d66d1223833f8b8f7f22ad174c (patch) | |
tree | cbb80400469e0e0af9fe9bf29d0a7b270597f5ec /src | |
parent | 1ee69f6f1d93349a3e576a86c1d93d23ccec28ce (diff) |
add reserve-open-deposit transactions to coin histories
Diffstat (limited to 'src')
-rw-r--r-- | src/auditor/taler-auditor-sync.c | 1 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_responses.c | 25 | ||||
-rw-r--r-- | src/exchangedb/exchangedb_transactions.c | 11 | ||||
-rw-r--r-- | src/exchangedb/plugin_exchangedb_common.c | 8 |
4 files changed, 44 insertions, 1 deletions
diff --git a/src/auditor/taler-auditor-sync.c b/src/auditor/taler-auditor-sync.c index 9666ec33a..16ace8fa5 100644 --- a/src/auditor/taler-auditor-sync.c +++ b/src/auditor/taler-auditor-sync.c @@ -99,7 +99,6 @@ static struct Table tables[] = { { .rt = TALER_EXCHANGEDB_RT_RESERVES_CLOSE}, { .rt = TALER_EXCHANGEDB_RT_RESERVES_OPEN_REQUESTS}, { .rt = TALER_EXCHANGEDB_RT_RESERVES_OPEN_DEPOSITS}, - { .rt = TALER_EXCHANGEDB_RT_RESERVES_CLOSE_REQUESTS}, { .rt = TALER_EXCHANGEDB_RT_RESERVES_OUT}, { .rt = TALER_EXCHANGEDB_RT_AUDITORS}, { .rt = TALER_EXCHANGEDB_RT_AUDITOR_DENOM_SIGS}, diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index 516b36460..77f01de60 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -424,6 +424,31 @@ TEH_RESPONSE_compile_transaction_history ( } break; } + + case TALER_EXCHANGEDB_TT_RESERVE_OPEN: + { + struct TALER_EXCHANGEDB_ReserveOpenListEntry *role + = pos->details.reserve_open; + + if (0 != + json_array_append_new ( + history, + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("type", + "RESERVE-OPEN-DEPOSIT"), + TALER_JSON_pack_amount ("coin_contribution", + &role->coin_contribution), + GNUNET_JSON_pack_data_auto ("reserve_sig", + &role->reserve_sig), + GNUNET_JSON_pack_data_auto ("coin_sig", + &role->coin_sig)))) + { + GNUNET_break (0); + json_decref (history); + return NULL; + } + break; + } } } return history; diff --git a/src/exchangedb/exchangedb_transactions.c b/src/exchangedb/exchangedb_transactions.c index ef46bace6..60b95d6f6 100644 --- a/src/exchangedb/exchangedb_transactions.c +++ b/src/exchangedb/exchangedb_transactions.c @@ -131,6 +131,17 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals ( } deposit_fee = pos->details.purse_deposit->deposit_fee; break; + case TALER_EXCHANGEDB_TT_RESERVE_OPEN: + /* spent += pos->amount_with_fee */ + if (0 > + TALER_amount_add (&spent, + &spent, + &pos->details.reserve_open->coin_contribution)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + break; } } if (have_refund) diff --git a/src/exchangedb/plugin_exchangedb_common.c b/src/exchangedb/plugin_exchangedb_common.c index 10263adff..84198dddf 100644 --- a/src/exchangedb/plugin_exchangedb_common.c +++ b/src/exchangedb/plugin_exchangedb_common.c @@ -152,6 +152,14 @@ TEH_COMMON_free_coin_transaction_list ( GNUNET_free (deposit); break; } + case TALER_EXCHANGEDB_TT_RESERVE_OPEN: + { + struct TALER_EXCHANGEDB_ReserveOpenListEntry *role; + + role = tl->details.reserve_open; + GNUNET_free (role); + break; + } } { struct TALER_EXCHANGEDB_TransactionList *next; |