summaryrefslogtreecommitdiff
path: root/src/exchange-lib
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-29 01:15:41 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-29 01:15:41 +0200
commit85350ced32108f2ec69fbf62e0a7c3b256840fb1 (patch)
treeca8370f99feae0fb55dad2b5b13f0175e242fdcd /src/exchange-lib
parent5d58316d884e660ff9a83a6e7a4bd34ae4c8e734 (diff)
downloadexchange-85350ced32108f2ec69fbf62e0a7c3b256840fb1.tar.gz
exchange-85350ced32108f2ec69fbf62e0a7c3b256840fb1.tar.bz2
exchange-85350ced32108f2ec69fbf62e0a7c3b256840fb1.zip
rename proposal_data to contract_terms (see #4879)
Diffstat (limited to 'src/exchange-lib')
-rw-r--r--src/exchange-lib/baseline/deposit.req2
-rw-r--r--src/exchange-lib/exchange_api_common.c10
-rw-r--r--src/exchange-lib/exchange_api_deposit.c18
-rw-r--r--src/exchange-lib/exchange_api_refund.c12
-rw-r--r--src/exchange-lib/exchange_api_track_transaction.c12
-rw-r--r--src/exchange-lib/exchange_api_track_transfer.c4
-rw-r--r--src/exchange-lib/test_exchange_api.c78
7 files changed, 68 insertions, 68 deletions
diff --git a/src/exchange-lib/baseline/deposit.req b/src/exchange-lib/baseline/deposit.req
index 6518e76fe..a400796f1 100644
--- a/src/exchange-lib/baseline/deposit.req
+++ b/src/exchange-lib/baseline/deposit.req
@@ -5,4 +5,4 @@ Content-Type: application/json
Content-Length: 1658
Expect: 100-continue
-{"ub_sig":"51SPJSSDESGPR80A40M74WV140520818ECG26E9M8S0M6CSH6X334GSN8RW30D9G8MT46CA660W34GSG6MT4AD9K8GT3ECSH6MVK0E2374V38H1M8MR4CDJ66MWK4E1S6MR3GCT28CV32H1Q8N23GCHG70S36C1K8MS3GCSN8RV36D9S710KGD9K6GWKEGJ28GRM4CJ56X1K6DJ18D2KGHA46D13GDA66GVK4GHJ8N13AE9J8RVK6GT184S48E1K6X336G9Q8N142CJ4692M6EA16GRKJD9N6523ADA36X13GG9G70TK6DHN68R36CT18GR4CDSJ6CW3GCT364W46CSR8RV42GJ474SMADSH851K4H9Q8GS42CHS8RV3GCSJ64V46DSN8RSM6HHN6N246D9S6934AH9P6X23JGSH652K0DJ5612KJGA26N242CH35452081918G2J2G0","timestamp":"/Date(1442821652)/","f":{"currency":"EUR","value":5,"fraction":0},"wire":{"type":"TEST","bank":"dest bank","account":42},"coin_pub":"JXWK4NS0H2W4V4BETQ90CCEDADP6QQ3MV3YZ7RV2KXEM8PWXE8Q0","H_wire":"YQED9FDYPKK2QQYB3FS19Y15ZMKBAXJP2C73CXASAF1KM6ZYY723TEJ3HBR6D864A7X5W58G92QJ0A9PFMZNB81ZP9NJAQQCCABM4RG","h_proposal_data":"1CMEEFQ5S4QJGGAMVYFV07XQRHQA311CR2MTRNC5M9KZV6ETDV1SY00WJFEV2CG9BXQTEQPZAF8A54C2HX32TZCN20VBGPFPS2Z16B0","merchant_pub":"C36TEXQXFW00170C2EJ66ZR0000CX9VPZNZG00109NX020000000","denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30GT58S2K2HJ16H336C9N8CVK4E9N6H1MADHH61330HHM6N1K8E1H8RVKJH256D1M6E1K8RWKJGSH8S2M6DJ170TK2H266GTK8DSS64RKJDJ26D144DJ474SK0GHQ711MAD9G752M2CJ58S1KJDA570SK2E9G8N23GCJ28S146DHH610K2H1Q8CW3GGA16S146H9G68TKACSQ6914CE1H691K2E9N6RWM8H9P8CWM2H9S8GSK0H9P6D1K6H9G6X0M4C2171144HJ46N334H9J692M4H9M8MR4CCJ46GRKEGA46533CDJ38MV4CH9K892MAH1P8S2K6D9K6N246E256H244G9Q6D346GJ56S23JGHJ690KADHJ8H242H2575132CSM6X1M4G9N6RR48E9H8MVM8E9354520818CMG26C1H60R30C935452081918G2J2G0","refund_deadline":"/Date(0)/","coin_sig":"X16E0DP8C2BJNVNX09G24FFC5GA4W7RN2YXZP9WJTAN9BY6B4GMA39QNYR51XNNEZ3H1J7TP0K9G55JZ8V7WS7CZMD7E64HWYBFWM00"}
+{"ub_sig":"51SPJSSDESGPR80A40M74WV140520818ECG26E9M8S0M6CSH6X334GSN8RW30D9G8MT46CA660W34GSG6MT4AD9K8GT3ECSH6MVK0E2374V38H1M8MR4CDJ66MWK4E1S6MR3GCT28CV32H1Q8N23GCHG70S36C1K8MS3GCSN8RV36D9S710KGD9K6GWKEGJ28GRM4CJ56X1K6DJ18D2KGHA46D13GDA66GVK4GHJ8N13AE9J8RVK6GT184S48E1K6X336G9Q8N142CJ4692M6EA16GRKJD9N6523ADA36X13GG9G70TK6DHN68R36CT18GR4CDSJ6CW3GCT364W46CSR8RV42GJ474SMADSH851K4H9Q8GS42CHS8RV3GCSJ64V46DSN8RSM6HHN6N246D9S6934AH9P6X23JGSH652K0DJ5612KJGA26N242CH35452081918G2J2G0","timestamp":"/Date(1442821652)/","f":{"currency":"EUR","value":5,"fraction":0},"wire":{"type":"TEST","bank":"dest bank","account":42},"coin_pub":"JXWK4NS0H2W4V4BETQ90CCEDADP6QQ3MV3YZ7RV2KXEM8PWXE8Q0","H_wire":"YQED9FDYPKK2QQYB3FS19Y15ZMKBAXJP2C73CXASAF1KM6ZYY723TEJ3HBR6D864A7X5W58G92QJ0A9PFMZNB81ZP9NJAQQCCABM4RG","h_contract_terms":"1CMEEFQ5S4QJGGAMVYFV07XQRHQA311CR2MTRNC5M9KZV6ETDV1SY00WJFEV2CG9BXQTEQPZAF8A54C2HX32TZCN20VBGPFPS2Z16B0","merchant_pub":"C36TEXQXFW00170C2EJ66ZR0000CX9VPZNZG00109NX020000000","denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30GT58S2K2HJ16H336C9N8CVK4E9N6H1MADHH61330HHM6N1K8E1H8RVKJH256D1M6E1K8RWKJGSH8S2M6DJ170TK2H266GTK8DSS64RKJDJ26D144DJ474SK0GHQ711MAD9G752M2CJ58S1KJDA570SK2E9G8N23GCJ28S146DHH610K2H1Q8CW3GGA16S146H9G68TKACSQ6914CE1H691K2E9N6RWM8H9P8CWM2H9S8GSK0H9P6D1K6H9G6X0M4C2171144HJ46N334H9J692M4H9M8MR4CCJ46GRKEGA46533CDJ38MV4CH9K892MAH1P8S2K6D9K6N246E256H244G9Q6D346GJ56S23JGHJ690KADHJ8H242H2575132CSM6X1M4G9N6RR48E9H8MVM8E9354520818CMG26C1H60R30C935452081918G2J2G0","refund_deadline":"/Date(0)/","coin_sig":"X16E0DP8C2BJNVNX09G24FFC5GA4W7RN2YXZP9WJTAN9BY6B4GMA39QNYR51XNNEZ3H1J7TP0K9G55JZ8V7WS7CZMD7E64HWYBFWM00"}
diff --git a/src/exchange-lib/exchange_api_common.c b/src/exchange-lib/exchange_api_common.c
index d9d0a6d56..99086a71f 100644
--- a/src/exchange-lib/exchange_api_common.c
+++ b/src/exchange-lib/exchange_api_common.c
@@ -93,8 +93,8 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("coin_sig",
&sig),
- GNUNET_JSON_spec_fixed_auto ("h_proposal_data",
- &dr.h_proposal_data),
+ GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
+ &dr.h_contract_terms),
GNUNET_JSON_spec_fixed_auto ("h_wire",
&dr.h_wire),
GNUNET_JSON_spec_absolute_time_nbo ("timestamp",
@@ -183,8 +183,8 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("merchant_sig",
&sig),
- GNUNET_JSON_spec_fixed_auto ("h_proposal_data",
- &rr.h_proposal_data),
+ GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
+ &rr.h_contract_terms),
GNUNET_JSON_spec_fixed_auto ("merchant_pub",
&rr.merchant),
GNUNET_JSON_spec_uint64 ("rtransaction_id",
@@ -217,7 +217,7 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
return GNUNET_SYSERR;
}
/* NOTE: theoretically, we could also check that the given
- merchant_pub and h_proposal_data appear in the
+ merchant_pub and h_contract_terms appear in the
history under deposits. However, there is really no benefit
for the exchange to lie here, so not checking is probably OK
(an auditor ought to check, though). Then again, we similarly
diff --git a/src/exchange-lib/exchange_api_deposit.c b/src/exchange-lib/exchange_api_deposit.c
index 80729f096..4937b14aa 100644
--- a/src/exchange-lib/exchange_api_deposit.c
+++ b/src/exchange-lib/exchange_api_deposit.c
@@ -274,7 +274,7 @@ handle_deposit_finished (void *cls,
* @param dki public key information
* @param amount the amount to be deposited
* @param h_wire hash of the merchant’s account details
- * @param h_proposal_data hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
+ * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
* @param coin_pub coin’s public key
* @param denom_pub denomination key with which the coin is signed
* @param denom_sig exchange’s unblinded signature of the coin
@@ -288,7 +288,7 @@ static int
verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki,
const struct TALER_Amount *amount,
const struct GNUNET_HashCode *h_wire,
- const struct GNUNET_HashCode *h_proposal_data,
+ const struct GNUNET_HashCode *h_contract_terms,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_DenominationSignature *denom_sig,
const struct TALER_DenominationPublicKey *denom_pub,
@@ -302,7 +302,7 @@ verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki,
dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
dr.purpose.size = htonl (sizeof (struct TALER_DepositRequestPS));
- dr.h_proposal_data = *h_proposal_data;
+ dr.h_contract_terms = *h_contract_terms;
dr.h_wire = *h_wire;
dr.timestamp = GNUNET_TIME_absolute_hton (timestamp);
dr.refund_deadline = GNUNET_TIME_absolute_hton (refund_deadline);
@@ -371,7 +371,7 @@ verify_signatures (const struct TALER_EXCHANGE_DenomPublicKey *dki,
* @param wire_deadline date until which the merchant would like the exchange to settle the balance (advisory, the exchange cannot be
* forced to settle in the past or upon very short notice, but of course a well-behaved exchange will limit aggregation based on the advice received)
* @param wire_details the merchant’s account details, in a format supported by the exchange
- * @param h_proposal_data hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
+ * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
* @param coin_pub coin’s public key
* @param denom_pub denomination key with which the coin is signed
* @param denom_sig exchange’s unblinded signature of the coin
@@ -389,7 +389,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_Amount *amount,
struct GNUNET_TIME_Absolute wire_deadline,
json_t *wire_details,
- const struct GNUNET_HashCode *h_proposal_data,
+ const struct GNUNET_HashCode *h_contract_terms,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
const struct TALER_DenominationSignature *denom_sig,
const struct TALER_DenominationPublicKey *denom_pub,
@@ -430,7 +430,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
verify_signatures (dki,
amount,
&h_wire,
- h_proposal_data,
+ h_contract_terms,
coin_pub,
denom_sig,
denom_pub,
@@ -444,7 +444,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
}
deposit_obj = json_pack ("{s:o, s:O," /* f/wire */
- " s:o, s:o," /* H_wire, h_proposal_data */
+ " s:o, s:o," /* H_wire, h_contract_terms */
" s:o, s:o," /* coin_pub, denom_pub */
" s:o, s:o," /* ub_sig, timestamp */
" s:o," /* merchant_pub */
@@ -453,7 +453,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
"f", TALER_JSON_from_amount (amount),
"wire", wire_details,
"H_wire", GNUNET_JSON_from_data_auto (&h_wire),
- "h_proposal_data", GNUNET_JSON_from_data_auto (h_proposal_data),
+ "h_contract_terms", GNUNET_JSON_from_data_auto (h_contract_terms),
"coin_pub", GNUNET_JSON_from_data_auto (coin_pub),
"denom_pub", GNUNET_JSON_from_rsa_public_key (denom_pub->rsa_public_key),
"ub_sig", GNUNET_JSON_from_rsa_signature (denom_sig->rsa_signature),
@@ -476,7 +476,7 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange,
dh->url = MAH_path_to_url (exchange, "/deposit");
dh->depconf.purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS));
dh->depconf.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT);
- dh->depconf.h_proposal_data = *h_proposal_data;
+ dh->depconf.h_contract_terms = *h_contract_terms;
dh->depconf.h_wire = h_wire;
dh->depconf.timestamp = GNUNET_TIME_absolute_hton (timestamp);
dh->depconf.refund_deadline = GNUNET_TIME_absolute_hton (refund_deadline);
diff --git a/src/exchange-lib/exchange_api_refund.c b/src/exchange-lib/exchange_api_refund.c
index dc6d5d7a2..a39dd23a8 100644
--- a/src/exchange-lib/exchange_api_refund.c
+++ b/src/exchange-lib/exchange_api_refund.c
@@ -220,7 +220,7 @@ handle_refund_finished (void *cls,
* (as that fee is still being subtracted), and smaller than the amount
* (with deposit fee) of the original deposit contribution of this coin
* @param refund_fee fee applicable to this coin for the refund
- * @param h_proposal_data hash of the contact of the merchant with the customer that is being refunded
+ * @param h_contract_terms hash of the contact of the merchant with the customer that is being refunded
* @param coin_pub coin’s public key of the coin from the original deposit operation
* @param rtransaction_id transaction id for the transaction between merchant and customer (of refunding operation);
* this is needed as we may first do a partial refund and later a full refund. If both
@@ -236,7 +236,7 @@ struct TALER_EXCHANGE_RefundHandle *
TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_Amount *amount,
const struct TALER_Amount *refund_fee,
- const struct GNUNET_HashCode *h_proposal_data,
+ const struct GNUNET_HashCode *h_contract_terms,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
uint64_t rtransaction_id,
const struct TALER_MerchantPrivateKeyP *merchant_priv,
@@ -254,7 +254,7 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
MAH_handle_is_ready (exchange));
rr.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND);
rr.purpose.size = htonl (sizeof (struct TALER_RefundRequestPS));
- rr.h_proposal_data = *h_proposal_data;
+ rr.h_contract_terms = *h_contract_terms;
rr.coin_pub = *coin_pub;
GNUNET_CRYPTO_eddsa_key_get_public (&merchant_priv->eddsa_priv,
&rr.merchant.eddsa_pub);
@@ -268,12 +268,12 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
&rr.purpose,
&merchant_sig.eddsa_sig));
refund_obj = json_pack ("{s:o, s:o," /* amount/fee */
- " s:o, s:o," /* h_proposal_data, coin_pub */
+ " s:o, s:o," /* h_contract_terms, coin_pub */
" s:I," /* rtransaction id */
" s:o, s:o}", /* merchant_pub, merchant_sig */
"refund_amount", TALER_JSON_from_amount (amount),
"refund_fee", TALER_JSON_from_amount (refund_fee),
- "h_proposal_data", GNUNET_JSON_from_data_auto (h_proposal_data),
+ "h_contract_terms", GNUNET_JSON_from_data_auto (h_contract_terms),
"coin_pub", GNUNET_JSON_from_data_auto (coin_pub),
"rtransaction_id", (json_int_t) rtransaction_id,
"merchant_pub", GNUNET_JSON_from_data_auto (&rr.merchant),
@@ -292,7 +292,7 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange,
rh->url = MAH_path_to_url (exchange, "/refund");
rh->depconf.purpose.size = htonl (sizeof (struct TALER_RefundConfirmationPS));
rh->depconf.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND);
- rh->depconf.h_proposal_data = *h_proposal_data;
+ rh->depconf.h_contract_terms = *h_contract_terms;
rh->depconf.coin_pub = *coin_pub;
rh->depconf.merchant = rr.merchant;
rh->depconf.rtransaction_id = GNUNET_htonll (rtransaction_id);
diff --git a/src/exchange-lib/exchange_api_track_transaction.c b/src/exchange-lib/exchange_api_track_transaction.c
index 34cf4ea9e..5f7ede6a4 100644
--- a/src/exchange-lib/exchange_api_track_transaction.c
+++ b/src/exchange-lib/exchange_api_track_transaction.c
@@ -254,7 +254,7 @@ handle_deposit_wtid_finished (void *cls,
* @param exchange the exchange to query
* @param merchant_priv the merchant's private key
* @param h_wire hash of merchant's wire transfer details
- * @param h_proposal_data hash of the proposal data from the contract
+ * @param h_contract_terms hash of the proposal data from the contract
* between merchant and customer
* @param coin_pub public key of the coin
* @param cb function to call with the result
@@ -265,7 +265,7 @@ struct TALER_EXCHANGE_TrackTransactionHandle *
TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange,
const struct TALER_MerchantPrivateKeyP *merchant_priv,
const struct GNUNET_HashCode *h_wire,
- const struct GNUNET_HashCode *h_proposal_data,
+ const struct GNUNET_HashCode *h_contract_terms,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
TALER_EXCHANGE_TrackTransactionCallback cb,
void *cb_cls)
@@ -285,7 +285,7 @@ TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange,
}
dtp.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION);
dtp.purpose.size = htonl (sizeof (dtp));
- dtp.h_proposal_data = *h_proposal_data;
+ dtp.h_contract_terms = *h_contract_terms;
dtp.h_wire = *h_wire;
GNUNET_CRYPTO_eddsa_key_get_public (&merchant_priv->eddsa_priv,
&dtp.merchant.eddsa_pub);
@@ -295,11 +295,11 @@ TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_CRYPTO_eddsa_sign (&merchant_priv->eddsa_priv,
&dtp.purpose,
&merchant_sig.eddsa_sig));
- deposit_wtid_obj = json_pack ("{s:o, s:o," /* H_wire, h_proposal_data */
+ deposit_wtid_obj = json_pack ("{s:o, s:o," /* H_wire, h_contract_terms */
" s:o," /* coin_pub */
" s:o, s:o}", /* merchant_pub, merchant_sig */
"H_wire", GNUNET_JSON_from_data_auto (h_wire),
- "h_proposal_data", GNUNET_JSON_from_data_auto (h_proposal_data),
+ "h_contract_terms", GNUNET_JSON_from_data_auto (h_contract_terms),
"coin_pub", GNUNET_JSON_from_data_auto (coin_pub),
"merchant_pub", GNUNET_JSON_from_data_auto (&dtp.merchant),
"merchant_sig", GNUNET_JSON_from_data_auto (&merchant_sig));
@@ -317,7 +317,7 @@ TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange,
dwh->depconf.purpose.size = htonl (sizeof (struct TALER_ConfirmWirePS));
dwh->depconf.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE);
dwh->depconf.h_wire = *h_wire;
- dwh->depconf.h_proposal_data = *h_proposal_data;
+ dwh->depconf.h_contract_terms = *h_contract_terms;
dwh->depconf.coin_pub = *coin_pub;
eh = curl_easy_init ();
diff --git a/src/exchange-lib/exchange_api_track_transfer.c b/src/exchange-lib/exchange_api_track_transfer.c
index 92e846ce3..c08282028 100644
--- a/src/exchange-lib/exchange_api_track_transfer.c
+++ b/src/exchange-lib/exchange_api_track_transfer.c
@@ -134,7 +134,7 @@ check_track_transfer_response_ok (struct TALER_EXCHANGE_TrackTransferHandle *wdh
struct TALER_TrackTransferDetails *detail = &details[i];
struct json_t *detail_j = json_array_get (details_j, i);
struct GNUNET_JSON_Specification spec_detail[] = {
- GNUNET_JSON_spec_fixed_auto ("h_proposal_data", &detail->h_proposal_data),
+ GNUNET_JSON_spec_fixed_auto ("h_contract_terms", &detail->h_contract_terms),
GNUNET_JSON_spec_fixed_auto ("coin_pub", &detail->coin_pub),
TALER_JSON_spec_amount ("deposit_value", &detail->coin_value),
TALER_JSON_spec_amount ("deposit_fee", &detail->coin_fee),
@@ -152,7 +152,7 @@ check_track_transfer_response_ok (struct TALER_EXCHANGE_TrackTransferHandle *wdh
return GNUNET_SYSERR;
}
/* build up big hash for signature checking later */
- dd.h_proposal_data = detail->h_proposal_data;
+ dd.h_contract_terms = detail->h_contract_terms;
dd.execution_time = GNUNET_TIME_absolute_hton (exec_time);
dd.coin_pub = detail->coin_pub;
TALER_amount_hton (&dd.deposit_value,
diff --git a/src/exchange-lib/test_exchange_api.c b/src/exchange-lib/test_exchange_api.c
index 4c10ea8f6..c6cecc572 100644
--- a/src/exchange-lib/test_exchange_api.c
+++ b/src/exchange-lib/test_exchange_api.c
@@ -388,7 +388,7 @@ struct Command
/**
* JSON string describing what a proposal is about.
*/
- const char *proposal_data;
+ const char *contract_terms;
/**
* Relative time (to add to 'now') to compute the refund deadline.
@@ -2185,7 +2185,7 @@ interpreter_run (void *cls)
return;
case OC_DEPOSIT:
{
- struct GNUNET_HashCode h_proposal_data;
+ struct GNUNET_HashCode h_contract_terms;
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
const struct TALER_EXCHANGE_DenomPublicKey *coin_pk;
const struct TALER_DenominationSignature *coin_pk_sig;
@@ -2196,7 +2196,7 @@ interpreter_run (void *cls)
struct GNUNET_TIME_Absolute timestamp;
struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
struct TALER_MerchantPublicKeyP merchant_pub;
- json_t *proposal_data;
+ json_t *contract_terms;
json_t *wire;
GNUNET_assert (NULL !=
@@ -2239,22 +2239,22 @@ interpreter_run (void *cls)
fail (is);
return;
}
- proposal_data = json_loads (cmd->details.deposit.proposal_data,
+ contract_terms = json_loads (cmd->details.deposit.contract_terms,
JSON_REJECT_DUPLICATES,
NULL);
- if (NULL == proposal_data)
+ if (NULL == contract_terms)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to parse proposal data `%s' at %u/%s\n",
- cmd->details.deposit.proposal_data,
+ cmd->details.deposit.contract_terms,
is->ip,
cmd->label);
fail (is);
return;
}
- TALER_JSON_hash (proposal_data,
- &h_proposal_data);
- json_decref (proposal_data);
+ TALER_JSON_hash (contract_terms,
+ &h_contract_terms);
+ json_decref (contract_terms);
wire = json_loads (cmd->details.deposit.wire_details,
JSON_REJECT_DUPLICATES,
NULL);
@@ -2297,7 +2297,7 @@ interpreter_run (void *cls)
memset (&dr, 0, sizeof (dr));
dr.purpose.size = htonl (sizeof (struct TALER_DepositRequestPS));
dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
- dr.h_proposal_data = h_proposal_data;
+ dr.h_contract_terms = h_contract_terms;
TALER_JSON_hash (wire,
&dr.h_wire);
dr.timestamp = GNUNET_TIME_absolute_hton (timestamp);
@@ -2318,7 +2318,7 @@ interpreter_run (void *cls)
&amount,
wire_deadline,
wire,
- &h_proposal_data,
+ &h_contract_terms,
&coin_pub,
coin_pk_sig,
&coin_pk->key,
@@ -2510,9 +2510,9 @@ interpreter_run (void *cls)
case OC_DEPOSIT_WTID:
{
struct GNUNET_HashCode h_wire;
- struct GNUNET_HashCode h_proposal_data;
+ struct GNUNET_HashCode h_contract_terms;
json_t *wire;
- json_t *proposal_data;
+ json_t *contract_terms;
const struct Command *coin;
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -2532,18 +2532,18 @@ interpreter_run (void *cls)
TALER_JSON_hash (wire,
&h_wire);
json_decref (wire);
- proposal_data = json_loads (ref->details.deposit.proposal_data,
+ contract_terms = json_loads (ref->details.deposit.contract_terms,
JSON_REJECT_DUPLICATES,
NULL);
- GNUNET_assert (NULL != proposal_data);
- TALER_JSON_hash (proposal_data,
- &h_proposal_data);
- json_decref (proposal_data);
+ GNUNET_assert (NULL != contract_terms);
+ TALER_JSON_hash (contract_terms,
+ &h_contract_terms);
+ json_decref (contract_terms);
cmd->details.deposit_wtid.dwh
= TALER_EXCHANGE_track_transaction (exchange,
&ref->details.deposit.merchant_priv,
&h_wire,
- &h_proposal_data,
+ &h_contract_terms,
&coin_pub,
&deposit_wtid_cb,
is);
@@ -2618,8 +2618,8 @@ interpreter_run (void *cls)
case OC_REFUND:
{
const struct Command *coin;
- struct GNUNET_HashCode h_proposal_data;
- json_t *proposal_data;
+ struct GNUNET_HashCode h_contract_terms;
+ json_t *contract_terms;
struct TALER_CoinSpendPublicKeyP coin_pub;
struct TALER_Amount refund_fee;
@@ -2648,13 +2648,13 @@ interpreter_run (void *cls)
ref = find_command (is,
cmd->details.refund.deposit_ref);
GNUNET_assert (NULL != ref);
- proposal_data = json_loads (ref->details.deposit.proposal_data,
+ contract_terms = json_loads (ref->details.deposit.contract_terms,
JSON_REJECT_DUPLICATES,
NULL);
- GNUNET_assert (NULL != proposal_data);
- TALER_JSON_hash (proposal_data,
- &h_proposal_data);
- json_decref (proposal_data);
+ GNUNET_assert (NULL != contract_terms);
+ TALER_JSON_hash (contract_terms,
+ &h_contract_terms);
+ json_decref (contract_terms);
coin = find_command (is,
ref->details.deposit.coin_ref);
@@ -2666,7 +2666,7 @@ interpreter_run (void *cls)
= TALER_EXCHANGE_refund (exchange,
&amount,
&refund_fee,
- &h_proposal_data,
+ &h_contract_terms,
&coin_pub,
cmd->details.refund.rtransaction_id,
&ref->details.deposit.merchant_priv,
@@ -3147,7 +3147,7 @@ run (void *cls)
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
/* Try to overdraw funds ... */
{ .oc = OC_WITHDRAW_SIGN,
@@ -3163,7 +3163,7 @@ run (void *cls)
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":43 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
/* Try to double-spend the 5 EUR coin at the same merchant (but different
transaction ID) */
{ .oc = OC_DEPOSIT,
@@ -3172,7 +3172,7 @@ run (void *cls)
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":1 } ] }" },
/* Try to double-spend the 5 EUR coin at the same merchant (but different
proposal) */
{ .oc = OC_DEPOSIT,
@@ -3181,7 +3181,7 @@ run (void *cls)
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-1",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\":[{ \"name\":\"ice cream\", \"value\":2 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\":[{ \"name\":\"ice cream\", \"value\":2 } ] }" },
/* ***************** /refresh testing ******************** */
@@ -3206,7 +3206,7 @@ run (void *cls)
.details.deposit.amount = "EUR:1",
.details.deposit.coin_ref = "refresh-withdraw-coin-1",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:1\" } ] }" },
+ .details.deposit.contract_terms = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:1\" } ] }" },
/* Melt the rest of the coin's value (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
@@ -3247,7 +3247,7 @@ run (void *cls)
.details.deposit.coin_ref = "refresh-reveal-1-idempotency",
.details.deposit.coin_idx = 0,
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }" },
/* Test successfully spending coins from the refresh operation:
finally EUR:0.1 */
@@ -3258,7 +3258,7 @@ run (void *cls)
.details.deposit.coin_ref = "refresh-reveal-1",
.details.deposit.coin_idx = 4,
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":43 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"ice cream\", \"value\":3 } ] }" },
/* Test running a failing melt operation (same operation again must fail) */
{ .oc = OC_REFRESH_MELT,
@@ -3379,7 +3379,7 @@ run (void *cls)
.details.deposit.amount = "EUR:5",
.details.deposit.coin_ref = "withdraw-coin-r1",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:5\" } ] }",
+ .details.deposit.contract_terms = "{ \"items\" : [ { \"name\":\"ice cream\", \"value\":\"EUR:5\" } ] }",
.details.deposit.refund_deadline = { 60LL * 1000 * 1000 } /* 60 s */,
},
/* Run transfers. Should do nothing as refund deadline blocks it */
@@ -3404,7 +3404,7 @@ run (void *cls)
.details.deposit.amount = "EUR:4.99",
.details.deposit.coin_ref = "withdraw-coin-r1",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\" : [ { \"name\":\"more ice cream\", \"value\":\"EUR:5\" } ] }",
+ .details.deposit.contract_terms = "{ \"items\" : [ { \"name\":\"more ice cream\", \"value\":\"EUR:5\" } ] }",
},
/* Run transfers. This will do the transfer as refund deadline was 0 */
{ .oc = OC_RUN_AGGREGATOR,
@@ -3491,7 +3491,7 @@ run (void *cls)
.details.deposit.amount = "EUR:0.5",
.details.deposit.coin_ref = "payback-withdraw-coin-2a",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"more ice cream\", \"value\":1 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"more ice cream\", \"value\":1 } ] }" },
{ .oc = OC_REVOKE,
.label = "revoke-2",
.expected_response_code = MHD_HTTP_OK,
@@ -3512,7 +3512,7 @@ run (void *cls)
.details.deposit.amount = "EUR:1",
.details.deposit.coin_ref = "payback-withdraw-coin-2b",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"more ice cream\", \"value\":1 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"more ice cream\", \"value\":1 } ] }" },
/* Test deposit fails after payback, with proof in payback */
/* FIXME: #3887: right now, the exchange will never return the
@@ -3523,7 +3523,7 @@ run (void *cls)
.details.deposit.amount = "EUR:0.5",
.details.deposit.coin_ref = "payback-withdraw-coin-2a",
.details.deposit.wire_details = "{ \"type\":\"test\", \"bank_uri\":\"http://localhost:8082/\", \"account_number\":42 }",
- .details.deposit.proposal_data = "{ \"items\": [ { \"name\":\"extra ice cream\", \"value\":1 } ] }" },
+ .details.deposit.contract_terms = "{ \"items\": [ { \"name\":\"extra ice cream\", \"value\":1 } ] }" },
/* Test that revoked coins cannot be withdrawn */