diff options
| author | Christian Grothoff <christian@grothoff.org> | 2022-10-15 21:26:03 +0200 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2022-10-15 21:26:03 +0200 | 
| commit | a8dac27be8483589bf9c9e5e3f48bf969c87541d (patch) | |
| tree | 9995d1b106e95ebb492ef65ee77611949986141b /src | |
| parent | 6180fa6d910dd03d9d5339fa1e02bf9397ec99e7 (diff) | |
return open/close requests in reserve history
Diffstat (limited to 'src')
| -rw-r--r-- | src/exchange/taler-exchange-httpd_responses.c | 58 | ||||
| -rw-r--r-- | src/include/taler_exchangedb_plugin.h | 3 | 
2 files changed, 60 insertions, 1 deletions
| diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index 2cef1719..a81d1b6e 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -923,6 +923,64 @@ TEH_RESPONSE_compile_reserve_history (          }        }        break; + +    case TALER_EXCHANGEDB_RO_OPEN_REQUEST: +      { +        const struct TALER_EXCHANGEDB_OpenRequest *orq = +          pos->details.open_request; + +        if (0 != +            json_array_append_new ( +              json_history, +              GNUNET_JSON_PACK ( +                GNUNET_JSON_pack_string ("type", +                                         "OPEN"), +                GNUNET_JSON_pack_uint64 ("requested_min_purses", +                                         orq->purse_limit), +                GNUNET_JSON_pack_data_auto ("reserve_sig", +                                            &orq->reserve_sig), +                GNUNET_JSON_pack_timestamp ("request_timestamp", +                                            orq->request_timestamp), +                GNUNET_JSON_pack_timestamp ("requested_expiration", +                                            orq->reserve_expiration), +                TALER_JSON_pack_amount ("open_fee", +                                        &orq->open_fee)))) +        { +          GNUNET_break (0); +          json_decref (json_history); +          return NULL; +        } +      } +      break; + +    case TALER_EXCHANGEDB_RO_CLOSE_REQUEST: +      { +        const struct TALER_EXCHANGEDB_CloseRequest *crq = +          pos->details.close_request; + +        if (0 != +            json_array_append_new ( +              json_history, +              GNUNET_JSON_PACK ( +                GNUNET_JSON_pack_string ("type", +                                         "CLOSE"), +                GNUNET_JSON_pack_data_auto ("reserve_sig", +                                            &crq->reserve_sig), +                GNUNET_is_zero (&crq->target_account_h_payto) +                ? GNUNET_JSON_pack_allow_null ( +                  GNUNET_JSON_pack_string ("h_payto", +                                           NULL)) +                : GNUNET_JSON_pack_data_auto ("h_payto", +                                              &crq->target_account_h_payto), +                GNUNET_JSON_pack_timestamp ("request_timestamp", +                                            crq->request_timestamp)))) +        { +          GNUNET_break (0); +          json_decref (json_history); +          return NULL; +        } +      } +      break;      }    } diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 7a0d5c55..107d88cc 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1296,7 +1296,8 @@ struct TALER_EXCHANGEDB_OpenRequest    struct GNUNET_TIME_Timestamp reserve_expiration;    /** -   * Signature by the reserve approving the open request. +   * Signature by the reserve approving the open request, +   * with purpose #TALER_SIGNATURE_WALLET_RESERVE_OPEN.     */    struct TALER_ReserveSignatureP reserve_sig; | 
