tip -> reward

This commit is contained in:
Christian Grothoff 2023-07-10 10:34:27 +02:00
parent c57c3463d1
commit f4abc1c369
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
6 changed files with 20 additions and 17 deletions

View File

@ -20,8 +20,8 @@ KYC_AML_TRIGGER = true
# in the database. Should be a high-entropy nonce. # in the database. Should be a high-entropy nonce.
ATTRIBUTE_ENCRYPTION_KEY = SET_ME_PLEASE ATTRIBUTE_ENCRYPTION_KEY = SET_ME_PLEASE
# Set to NO to disable tipping. # Set to NO to disable rewards.
ENABLE_TIPPING = YES ENABLE_REWARDS = YES
# How long do we allow /keys to be cached at most? The actual # How long do we allow /keys to be cached at most? The actual
# limit is the minimum of this value and the first expected # limit is the minimum of this value and the first expected

View File

@ -161,9 +161,9 @@ char *TEH_currency;
char *TEH_kyc_aml_trigger; char *TEH_kyc_aml_trigger;
/** /**
* Option set to #GNUNET_YES if tipping is enabled. * Option set to #GNUNET_YES if rewards are enabled.
*/ */
int TEH_enable_tipping; int TEH_enable_rewards;
/** /**
* What is the largest amount we allow a peer to * What is the largest amount we allow a peer to
@ -1943,15 +1943,15 @@ exchange_serve_process_config (void)
"Amount in section `exchange' under `AML_THRESHOLD' uses the wrong currency!\n"); "Amount in section `exchange' under `AML_THRESHOLD' uses the wrong currency!\n");
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
TEH_enable_tipping TEH_enable_rewards
= GNUNET_CONFIGURATION_get_value_yesno ( = GNUNET_CONFIGURATION_get_value_yesno (
TEH_cfg, TEH_cfg,
"exchange", "exchange",
"ENABLE_TIPPING"); "ENABLE_REWARDS");
if (GNUNET_SYSERR == TEH_enable_tipping) if (GNUNET_SYSERR == TEH_enable_rewards)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Need YES or NO in section `exchange' under `ENABLE_TIPPING'\n"); "Need YES or NO in section `exchange' under `ENABLE_REWARDS'\n");
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
if (GNUNET_OK != if (GNUNET_OK !=

View File

@ -65,9 +65,9 @@ extern int TEH_check_invariants_flag;
extern int TEH_allow_keys_timetravel; extern int TEH_allow_keys_timetravel;
/** /**
* Option set to #GNUNET_YES if tipping is enabled. * Option set to #GNUNET_YES if rewards are allowed.
*/ */
extern int TEH_enable_tipping; extern int TEH_enable_rewards;
/** /**
* Main directory with revocation data. * Main directory with revocation data.

View File

@ -1859,8 +1859,11 @@ create_krd (struct TEH_KeyStateHandle *ksh,
TEH_currency), TEH_currency),
GNUNET_JSON_pack_string ("asset_type", GNUNET_JSON_pack_string ("asset_type",
asset_type), asset_type),
// FIXME: legacy, remove soon!
GNUNET_JSON_pack_bool ("tipping_allowed", GNUNET_JSON_pack_bool ("tipping_allowed",
GNUNET_YES == TEH_enable_tipping), GNUNET_YES == TEH_enable_rewards),
GNUNET_JSON_pack_bool ("rewards_allowed",
GNUNET_YES == TEH_enable_rewards),
GNUNET_JSON_pack_data_auto ("master_public_key", GNUNET_JSON_pack_data_auto ("master_public_key",
&TEH_master_public_key), &TEH_master_public_key),
GNUNET_JSON_pack_time_rel ("reserve_closing_delay", GNUNET_JSON_pack_time_rel ("reserve_closing_delay",

View File

@ -374,9 +374,9 @@ struct TALER_EXCHANGE_Keys
unsigned int rc; unsigned int rc;
/** /**
* Set to true if tipping is allowed at this exchange. * Set to true if rewards are allowed at this exchange.
*/ */
bool tipping_allowed; bool rewards_allowed;
}; };

View File

@ -639,8 +639,8 @@ decode_keys_json (const json_t *resp_obj,
&auditors_array), &auditors_array),
GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ( GNUNET_JSON_spec_bool (
"tipping_allowed", "rewards_allowed",
&key_data->tipping_allowed), &key_data->rewards_allowed),
NULL), NULL),
GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_object_const ("extensions", GNUNET_JSON_spec_object_const ("extensions",
@ -1983,8 +1983,8 @@ TALER_EXCHANGE_keys_to_json (const struct TALER_EXCHANGE_Keys *kd)
recoup)), recoup)),
GNUNET_JSON_pack_array_steal ("auditors", GNUNET_JSON_pack_array_steal ("auditors",
auditors), auditors),
GNUNET_JSON_pack_bool ("tipping_allowed", GNUNET_JSON_pack_bool ("rewards_allowed",
kd->tipping_allowed), kd->rewards_allowed),
GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_allow_null (
GNUNET_JSON_pack_object_incref ("extensions", GNUNET_JSON_pack_object_incref ("extensions",
kd->extensions)), kd->extensions)),