diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-09-11 15:33:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-09-11 15:33:01 +0200 |
commit | dae8235928105f24f3178cdd2bcfa67ac0fb21c3 (patch) | |
tree | db60f58b780d8dffd43e3408cb978e654f46eca8 /src/lib | |
parent | 3b99f24648f477a2b7afd890657bb2675e211d31 (diff) | |
download | exchange-dae8235928105f24f3178cdd2bcfa67ac0fb21c3.tar.gz exchange-dae8235928105f24f3178cdd2bcfa67ac0fb21c3.tar.bz2 exchange-dae8235928105f24f3178cdd2bcfa67ac0fb21c3.zip |
improve wallet_Data support in exchange APIs
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/exchange_api_common.c | 8 | ||||
-rw-r--r-- | src/lib/exchange_api_refund.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c index ac0c46174..609a2f7ef 100644 --- a/src/lib/exchange_api_common.c +++ b/src/lib/exchange_api_common.c @@ -848,6 +848,8 @@ help_deposit (struct CoinHistoryParseContext *pc, 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 TALER_MerchantPublicKeyP merchant_pub; struct GNUNET_TIME_Timestamp refund_deadline = {0}; @@ -860,6 +862,10 @@ help_deposit (struct CoinHistoryParseContext *pc, &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 ( @@ -897,6 +903,7 @@ help_deposit (struct CoinHistoryParseContext *pc, &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, @@ -2145,6 +2152,7 @@ TALER_EXCHANGE_verify_deposit_signature_ ( &dki->fees.deposit, h_wire, &dcd->h_contract_terms, + &dcd->wallet_data_hash, &cdd->h_age_commitment, ech, &cdd->h_denom_pub, diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c index 83f9612df..3f12f28d6 100644 --- a/src/lib/exchange_api_refund.c +++ b/src/lib/exchange_api_refund.c @@ -234,6 +234,8 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, bool no_hac; 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 TALER_MerchantPublicKeyP merchant_pub; struct GNUNET_TIME_Timestamp refund_deadline; @@ -253,6 +255,10 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, GNUNET_JSON_spec_fixed_auto ("h_policy", &h_policy), &no_h_policy), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_fixed_auto ("wallet_data_hash", + &wallet_data_hash), + &no_wallet_data_hash), GNUNET_JSON_spec_timestamp ("timestamp", &wallet_timestamp), GNUNET_JSON_spec_timestamp ("refund_deadline", @@ -277,6 +283,8 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, &deposit_fee, &h_wire, &h_contract_terms, + no_wallet_data_hash ? NULL : + &wallet_data_hash, no_hac ? NULL : &h_age_commitment, no_h_policy ? NULL: &h_policy, &h_denom_pub, |