-more reserve history fixes

This commit is contained in:
Christian Grothoff 2022-05-23 15:29:35 +02:00
parent cdd2930a99
commit a509a91f92
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
13 changed files with 27 additions and 38 deletions

View File

@ -176,7 +176,6 @@ reply_create_success (struct MHD_Connection *connection,
&pcc->amount,
&pcc->deposit_total,
pcc->purse_pub,
&pcc->merge_pub,
&pcc->h_contract_terms,
&pub,
&sig)))

View File

@ -97,11 +97,6 @@ struct PurseDepositContext
*/
struct GNUNET_TIME_Timestamp purse_expiration;
/**
* Key with the merge capability (needed for signing).
*/
struct TALER_PurseMergePublicKeyP merge_pub;
/**
* Hash of the contract (needed for signing).
*/
@ -152,7 +147,6 @@ reply_deposit_success (struct MHD_Connection *connection,
&pcc->amount,
&pcc->deposit_total,
pcc->purse_pub,
&pcc->merge_pub,
&pcc->h_contract_terms,
&pub,
&sig)))
@ -175,8 +169,6 @@ reply_deposit_success (struct MHD_Connection *connection,
pcc->purse_expiration),
GNUNET_JSON_pack_data_auto ("h_contract_terms",
&pcc->h_contract_terms),
GNUNET_JSON_pack_data_auto ("merge_pub",
&pcc->merge_pub),
GNUNET_JSON_pack_data_auto ("exchange_sig",
&sig),
GNUNET_JSON_pack_data_auto ("exchange_pub",

View File

@ -165,7 +165,6 @@ reply_purse_success (struct MHD_Connection *connection,
&rpc->amount,
&rpc->deposit_total,
&rpc->purse_pub,
&rpc->merge_pub,
&rpc->h_contract_terms,
&pub,
&sig)))

View File

@ -3071,6 +3071,7 @@ ELSE
WHERE reserve_pub=my_reserve_pub;
-- ... and mark purse as finished.
-- FIXME: combine with UPDATE above?
UPDATE purse_requests
SET finished=true
WHERE purse_pub=in_purse_pub;

View File

@ -3974,7 +3974,6 @@ TALER_exchange_online_purse_created_sign (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig);
@ -3987,7 +3986,6 @@ TALER_exchange_online_purse_created_verify (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
const struct TALER_ExchangePublicKeyP *pub,
const struct TALER_ExchangeSignatureP *sig);

View File

@ -4240,7 +4240,7 @@ TALER_EXCHANGE_purse_get (
/**
* Cancel #TALER_EXCHANGE_purse_deposit() operation.
* Cancel #TALER_EXCHANGE_purse_get() operation.
*
* @param pgh handle of the operation to cancel
*/
@ -4628,11 +4628,6 @@ struct TALER_EXCHANGE_PurseDepositResponse
*/
struct TALER_PrivateContractHashP h_contract_terms;
/**
* Key with the merge capability (needed to verify signature).
*/
struct TALER_PurseMergePublicKeyP merge_pub;
} success;
} details;

View File

@ -170,7 +170,6 @@ handle_purse_create_deposit_finished (void *cls,
&pch->purse_value_after_fees,
&total_deposited,
&pch->purse_pub,
&pch->merge_pub,
&pch->h_contract_terms,
&exchange_pub,
&exchange_sig))

View File

@ -152,8 +152,6 @@ handle_purse_deposit_finished (void *cls,
&exchange_sig),
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
&exchange_pub),
GNUNET_JSON_spec_fixed_auto ("merge_pub",
&dr.details.success.merge_pub),
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
&dr.details.success.h_contract_terms),
GNUNET_JSON_spec_timestamp ("exchange_timestamp",
@ -195,7 +193,6 @@ handle_purse_deposit_finished (void *cls,
&dr.details.success.purse_value_after_fees,
&dr.details.success.total_deposited,
&pch->purse_pub,
&dr.details.success.merge_pub,
&dr.details.success.h_contract_terms,
&exchange_pub,
&exchange_sig))

View File

@ -251,9 +251,9 @@ run (void *cls,
"create-reserve-1",
"EUR:2",
MHD_HTTP_OK),
#if FIXME
#if 1
/* POST history doesn't yet support P2P transfers */
TALER_TESTING_cmd_reserves_status (
TALER_TESTING_cmd_reserve_status (
"push-check-post-merge-reserve-balance-post",
"create-reserve-1",
"EUR:2",

View File

@ -26,10 +26,9 @@
int
TALER_TESTING_history_entry_cmp (const struct
TALER_EXCHANGE_ReserveHistoryEntry *h1,
const struct
TALER_EXCHANGE_ReserveHistoryEntry *h2)
TALER_TESTING_history_entry_cmp (
const struct TALER_EXCHANGE_ReserveHistoryEntry *h1,
const struct TALER_EXCHANGE_ReserveHistoryEntry *h2)
{
if (h1->type != h2->type)
return 1;

View File

@ -159,6 +159,7 @@ deposit_cb (void *cls,
const struct TALER_ReserveSignatureP *reserve_sig;
const struct TALER_ReservePublicKeyP *reserve_pub;
const struct GNUNET_TIME_Timestamp *merge_timestamp;
const struct TALER_PurseMergePublicKeyP *merge_pub;
purse_cmd = TALER_TESTING_interpreter_lookup_command (ds->is,
ds->purse_ref);
@ -179,6 +180,14 @@ deposit_cb (void *cls,
TALER_TESTING_interpreter_fail (ds->is);
return;
}
if (GNUNET_OK !=
TALER_TESTING_get_trait_merge_pub (purse_cmd,
&merge_pub))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ds->is);
return;
}
ds->reserve_pub = *reserve_pub;
if (GNUNET_OK !=
TALER_TESTING_get_trait_timestamp (purse_cmd,
@ -213,7 +222,9 @@ deposit_cb (void *cls,
ds->reserve_history.details.merge_details.h_contract_terms
= dr->details.success.h_contract_terms;
ds->reserve_history.details.merge_details.merge_pub
= dr->details.success.merge_pub;
= *merge_pub;
ds->reserve_history.details.merge_details.purse_pub
= ds->purse_pub;
ds->reserve_history.details.merge_details.reserve_sig
= *reserve_sig;
ds->reserve_history.details.merge_details.merge_timestamp

View File

@ -72,6 +72,11 @@ struct ReservePurseState
*/
struct TALER_PurseMergePrivateKeyP merge_priv;
/**
* Public key of the merge capability.
*/
struct TALER_PurseMergePublicKeyP merge_pub;
/**
* Private key to decrypt the contract.
*/
@ -184,6 +189,8 @@ purse_run (void *cls,
GNUNET_CRYPTO_eddsa_key_get_public (&ds->reserve_priv.eddsa_priv,
&ds->reserve_pub.eddsa_pub);
GNUNET_CRYPTO_eddsa_key_create (&ds->merge_priv.eddsa_priv);
GNUNET_CRYPTO_eddsa_key_get_public (&ds->merge_priv.eddsa_priv,
&ds->merge_pub.eddsa_pub);
GNUNET_CRYPTO_ecdhe_key_create (&ds->contract_priv.ecdhe_priv);
ds->purse_expiration = GNUNET_TIME_absolute_to_timestamp (
GNUNET_TIME_relative_to_absolute (ds->expiration_rel));
@ -266,6 +273,7 @@ purse_traits (void *cls,
TALER_TESTING_make_trait_purse_priv (&ds->purse_priv),
TALER_TESTING_make_trait_purse_pub (&ds->purse_pub),
TALER_TESTING_make_trait_merge_priv (&ds->merge_priv),
TALER_TESTING_make_trait_merge_pub (&ds->merge_pub),
TALER_TESTING_make_trait_contract_priv (&ds->contract_priv),
TALER_TESTING_make_trait_reserve_priv (&ds->reserve_priv),
TALER_TESTING_make_trait_reserve_pub (&ds->reserve_pub),

View File

@ -1300,11 +1300,6 @@ struct TALER_PurseCreateDepositConfirmationPS
*/
struct TALER_PurseContractPublicKeyP purse_pub;
/**
* Public key of the merge capability.
*/
struct TALER_PurseMergePublicKeyP merge_pub;
/**
* Hash of the contract of the purse.
*/
@ -1323,7 +1318,6 @@ TALER_exchange_online_purse_created_sign (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig)
@ -1333,7 +1327,6 @@ TALER_exchange_online_purse_created_sign (
.purpose.size = htonl (sizeof (dc)),
.h_contract_terms = *h_contract_terms,
.purse_pub = *purse_pub,
.merge_pub = *merge_pub,
.purse_expiration = GNUNET_TIME_timestamp_hton (purse_expiration),
.exchange_time = GNUNET_TIME_timestamp_hton (exchange_time)
};
@ -1355,7 +1348,6 @@ TALER_exchange_online_purse_created_verify (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
const struct TALER_ExchangePublicKeyP *pub,
const struct TALER_ExchangeSignatureP *sig)
@ -1365,7 +1357,6 @@ TALER_exchange_online_purse_created_verify (
.purpose.size = htonl (sizeof (dc)),
.h_contract_terms = *h_contract_terms,
.purse_pub = *purse_pub,
.merge_pub = *merge_pub,
.purse_expiration = GNUNET_TIME_timestamp_hton (purse_expiration),
.exchange_time = GNUNET_TIME_timestamp_hton (exchange_time)
};