diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-07-20 18:13:48 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-07-20 18:13:48 +0200 |
commit | 430bb0624ae60e78c3e9855bd7827cc407471871 (patch) | |
tree | d35009892e5c07069e112fe36735f4832df32b12 /src/include | |
parent | c424cf99abf8caae1106fe778c251aa469e0a308 (diff) | |
download | exchange-430bb0624ae60e78c3e9855bd7827cc407471871.tar.xz |
[age-withdraw] Added testing commands for age-withdraw and -reveal
Implemented
- TALER_TESTING_cmd_age_withdraw
- TALER_TESTING_cmd_age_withdraw_reveal
Note: No test is using those commands yet.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_exchange_service.h | 49 | ||||
-rw-r--r-- | src/include/taler_testing_lib.h | 4 |
2 files changed, 45 insertions, 8 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 32c5cc410..7bd1b3248 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1514,6 +1514,11 @@ enum TALER_EXCHANGE_ReserveTransactionType TALER_EXCHANGE_RTT_WITHDRAWAL, /** + * Age-Withdrawal from the reserve. + */ + TALER_EXCHANGE_RTT_AGEWITHDRAWAL, + + /** * /recoup operation. */ TALER_EXCHANGE_RTT_RECOUP, @@ -1609,6 +1614,28 @@ struct TALER_EXCHANGE_ReserveHistoryEntry } withdraw; /** + * Information about withdraw operation. + * @e type is #TALER_EXCHANGE_RTT_AGEWITHDRAWAL. + */ + struct + { + /** + * Signature authorizing the withdrawal for outgoing transaction. + */ + json_t *out_authorization_sig; + + /** + * Maximum age commited + */ + uint8_t max_age; + + /** + * Fee that was charged for the withdrawal. + */ + struct TALER_Amount fee; + } age_withdraw; + + /** * Information provided if the reserve was filled via /recoup. * @e type is #TALER_EXCHANGE_RTT_RECOUP. */ @@ -2676,7 +2703,7 @@ struct TALER_EXCHANGE_AgeWithdrawCoinInput * The denomination of the coin. Must support age restriction, i.e * its .keys.age_mask MUST not be 0 */ - const struct TALER_EXCHANGE_DenomPublicKey *denom_pub; + struct TALER_EXCHANGE_DenomPublicKey *denom_pub; }; @@ -2692,6 +2719,11 @@ struct TALER_EXCHANGE_AgeWithdrawCoinPrivateDetails struct TALER_CoinSpendPrivateKeyP coin_priv; /** + * Hash of the public key of the coin. + */ + struct TALER_CoinPubHashP h_coin_pub; + + /** * Value used to blind the key for the signature. * Needed for recoup operations. */ @@ -2713,6 +2745,11 @@ struct TALER_EXCHANGE_AgeWithdrawCoinPrivateDetails * withdraw protocol. */ struct TALER_ExchangeWithdrawValues alg_values; + + /** + * The planchet constructed + */ + struct TALER_PlanchetDetail planchet; }; /** @@ -2761,11 +2798,11 @@ struct TALER_EXCHANGE_AgeWithdrawResponse /** * The computed details of the non-revealed @e num_coins coins to keep. */ - const struct TALER_EXCHANGE_AgeWithdrawCoinPrivateDetails *coins; + const struct TALER_EXCHANGE_AgeWithdrawCoinPrivateDetails *coin_details; /** * The array of blinded hashes of the non-revealed - * (kappa - 1)*@e num_coins coins, needed for the reveal step; + * @e num_coins coins, needed for the reveal step; */ const struct TALER_BlindedCoinHashP *blinded_coin_hs; @@ -2990,9 +3027,9 @@ struct TALER_EXCHANGE_AgeWithdrawRevealResponse struct { /** - * Number of coins returned. + * Number of signatures returned. */ - unsigned int num_coins; + unsigned int num_sigs; /** * Array of @e num_coins blinded denomination signatures, giving each @@ -3000,7 +3037,7 @@ struct TALER_EXCHANGE_AgeWithdrawRevealResponse * order (and should have the same length) in which the original * age-withdraw request specified the respective denomination keys. */ - const struct TALER_BlindedDenominationSignature *denom_sigs; + const struct TALER_BlindedDenominationSignature *blinded_denom_sigs; } ok; } details; diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 3cd0b145f..c99f7c3b3 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -2715,8 +2715,8 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits, op (refund_deadline, const struct GNUNET_TIME_Timestamp) \ op (exchange_pub, const struct TALER_ExchangePublicKeyP) \ op (exchange_sig, const struct TALER_ExchangeSignatureP) \ - op (blinding_key, const union TALER_DenominationBlindingKeyP) - + op (blinding_key, const union TALER_DenominationBlindingKeyP) \ + op (h_blinded_coin, const struct TALER_BlindedCoinHashP) TALER_TESTING_SIMPLE_TRAITS (TALER_TESTING_MAKE_DECL_SIMPLE_TRAIT) |