rename proposal_data to contract_terms (see #4879)
This commit is contained in:
parent
5d58316d88
commit
85350ced32
@ -1564,7 +1564,7 @@ struct WireCheckContext
|
||||
* claimed coin value is within the value of the coin's denomination.
|
||||
*
|
||||
* @param coin_pub public key of the coin (for reporting)
|
||||
* @param h_proposal_data hash of the proposal for which we calculate the amount
|
||||
* @param h_contract_terms hash of the proposal for which we calculate the amount
|
||||
* @param merchant_pub public key of the merchant (who is allowed to issue refunds)
|
||||
* @param dki denomination information about the coin
|
||||
* @param tl_head head of transaction history to verify
|
||||
@ -1574,7 +1574,7 @@ struct WireCheckContext
|
||||
*/
|
||||
static int
|
||||
check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||
const struct TALER_EXCHANGEDB_DenominationKeyInformationP *dki,
|
||||
const struct TALER_EXCHANGEDB_TransactionList *tl_head,
|
||||
@ -1631,8 +1631,8 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
if ( (0 == memcmp (merchant_pub,
|
||||
&tl->details.deposit->merchant_pub,
|
||||
sizeof (struct TALER_MerchantPublicKeyP))) &&
|
||||
(0 == memcmp (h_proposal_data,
|
||||
&tl->details.deposit->h_proposal_data,
|
||||
(0 == memcmp (h_contract_terms,
|
||||
&tl->details.deposit->h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode))) )
|
||||
{
|
||||
struct TALER_Amount amount_without_fee;
|
||||
@ -1726,8 +1726,8 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
if ( (0 == memcmp (merchant_pub,
|
||||
&tl->details.refund->merchant_pub,
|
||||
sizeof (struct TALER_MerchantPublicKeyP))) &&
|
||||
(0 == memcmp (h_proposal_data,
|
||||
&tl->details.refund->h_proposal_data,
|
||||
(0 == memcmp (h_contract_terms,
|
||||
&tl->details.refund->h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode))) )
|
||||
{
|
||||
if (GNUNET_OK !=
|
||||
@ -1822,7 +1822,7 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
"Coin %s contributes %s to contract %s\n",
|
||||
TALER_B2S (coin_pub),
|
||||
TALER_amount2s (merchant_gain),
|
||||
GNUNET_h2s (h_proposal_data));
|
||||
GNUNET_h2s (h_contract_terms));
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
||||
@ -1837,7 +1837,7 @@ check_transaction_history (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
* @param wire_method which wire plugin was used for the transfer?
|
||||
* @param h_wire hash of wire transfer details of the merchant (should be same for all callbacks with the same @e cls)
|
||||
* @param exec_time execution time of the wire transfer (should be same for all callbacks with the same @e cls)
|
||||
* @param h_proposal_data which proposal was this payment about
|
||||
* @param h_contract_terms which proposal was this payment about
|
||||
* @param coin_pub which public key was this payment about
|
||||
* @param coin_value amount contributed by this coin in total (with fee)
|
||||
* @param coin_fee applicable fee for this coin
|
||||
@ -1849,7 +1849,7 @@ wire_transfer_information_cb (void *cls,
|
||||
const char *wire_method,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
struct GNUNET_TIME_Absolute exec_time,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *coin_value,
|
||||
const struct TALER_Amount *coin_fee)
|
||||
@ -1912,7 +1912,7 @@ wire_transfer_information_cb (void *cls,
|
||||
|
||||
/* Check transaction history to see if it supports aggregate valuation */
|
||||
check_transaction_history (coin_pub,
|
||||
h_proposal_data,
|
||||
h_contract_terms,
|
||||
merchant_pub,
|
||||
dki,
|
||||
tl,
|
||||
@ -2991,7 +2991,7 @@ refresh_session_cb (void *cls,
|
||||
* @param coin_pub public key of the coin
|
||||
* @param coin_sig signature from the coin
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param refund_deadline by which the merchant adviced that he might want
|
||||
* to get a refund
|
||||
* @param wire_deadline by which the merchant adviced that he would like the
|
||||
@ -3009,7 +3009,7 @@ deposit_cb (void *cls,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_CoinSpendSignatureP *coin_sig,
|
||||
const struct TALER_Amount *amount_with_fee,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute refund_deadline,
|
||||
struct GNUNET_TIME_Absolute wire_deadline,
|
||||
const json_t *receiver_wire_account,
|
||||
@ -3036,7 +3036,7 @@ deposit_cb (void *cls,
|
||||
/* Verify deposit signature */
|
||||
dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
|
||||
dr.purpose.size = htonl (sizeof (dr));
|
||||
dr.h_proposal_data = *h_proposal_data;
|
||||
dr.h_contract_terms = *h_contract_terms;
|
||||
if (GNUNET_OK !=
|
||||
TALER_JSON_hash (receiver_wire_account,
|
||||
&dr.h_wire))
|
||||
@ -3129,7 +3129,7 @@ deposit_cb (void *cls,
|
||||
* @param coin_pub public key of the coin
|
||||
* @param merchant_pub public key of the merchant
|
||||
* @param merchant_sig signature of the merchant
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param rtransaction_id refund transaction ID chosen by the merchant
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||
@ -3141,7 +3141,7 @@ refund_cb (void *cls,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||
const struct TALER_MerchantSignatureP *merchant_sig,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
uint64_t rtransaction_id,
|
||||
const struct TALER_Amount *amount_with_fee)
|
||||
{
|
||||
@ -3167,7 +3167,7 @@ refund_cb (void *cls,
|
||||
/* verify refund signature */
|
||||
rr.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND);
|
||||
rr.purpose.size = htonl (sizeof (rr));
|
||||
rr.h_proposal_data = *h_proposal_data;
|
||||
rr.h_contract_terms = *h_contract_terms;
|
||||
rr.coin_pub = *coin_pub;
|
||||
rr.merchant = *merchant_pub;
|
||||
rr.rtransaction_id = GNUNET_htonll (rtransaction_id);
|
||||
|
@ -826,7 +826,7 @@ spend_coin (struct Coin *coin,
|
||||
struct GNUNET_TIME_Absolute wire_deadline;
|
||||
struct GNUNET_TIME_Absolute timestamp;
|
||||
struct GNUNET_TIME_Absolute refund_deadline;
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||
struct TALER_DepositRequestPS dr;
|
||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||
@ -835,8 +835,8 @@ spend_coin (struct Coin *coin,
|
||||
GNUNET_CRYPTO_eddsa_key_get_public (&coin->coin_priv.eddsa_priv,
|
||||
&coin_pub.eddsa_pub);
|
||||
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||
&h_proposal_data,
|
||||
sizeof (h_proposal_data));
|
||||
&h_contract_terms,
|
||||
sizeof (h_contract_terms));
|
||||
timestamp = GNUNET_TIME_absolute_get ();
|
||||
wire_deadline = GNUNET_TIME_absolute_add (timestamp,
|
||||
GNUNET_TIME_UNIT_WEEKS);
|
||||
@ -882,7 +882,7 @@ spend_coin (struct Coin *coin,
|
||||
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 (merchant_details,
|
||||
&dr.h_wire);
|
||||
|
||||
@ -908,7 +908,7 @@ spend_coin (struct Coin *coin,
|
||||
&amount,
|
||||
wire_deadline,
|
||||
merchant_details,
|
||||
&h_proposal_data,
|
||||
&h_contract_terms,
|
||||
&coin_pub,
|
||||
&coin->sig,
|
||||
&coin->pk->key,
|
||||
|
@ -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"}
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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 ();
|
||||
|
@ -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,
|
||||
|
@ -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 */
|
||||
|
@ -531,7 +531,7 @@ exchange_serve_process_config ()
|
||||
* @param coin_pub public key of the coin
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @param deposit_fee amount the exchange gets to keep as transaction fees
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param wire_deadline by which the merchant adviced that he would like the
|
||||
* wire transfer to be executed
|
||||
* @param wire wire details for the merchant
|
||||
@ -544,7 +544,7 @@ deposit_cb (void *cls,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *amount_with_fee,
|
||||
const struct TALER_Amount *deposit_fee,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute wire_deadline,
|
||||
const json_t *wire)
|
||||
{
|
||||
@ -617,7 +617,7 @@ deposit_cb (void *cls,
|
||||
* @param coin_pub public key of the coin
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @param deposit_fee amount the exchange gets to keep as transaction fees
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param wire_deadline by which the merchant adviced that he would like the
|
||||
* wire transfer to be executed
|
||||
* @param wire wire details for the merchant
|
||||
@ -630,7 +630,7 @@ aggregate_cb (void *cls,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *amount_with_fee,
|
||||
const struct TALER_Amount *deposit_fee,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute wire_deadline,
|
||||
const json_t *wire)
|
||||
{
|
||||
|
@ -247,7 +247,7 @@ TEH_DB_execute_deposit (struct MHD_Connection *connection,
|
||||
return TEH_RESPONSE_reply_deposit_success (connection,
|
||||
&deposit->coin.coin_pub,
|
||||
&deposit->h_wire,
|
||||
&deposit->h_proposal_data,
|
||||
&deposit->h_contract_terms,
|
||||
deposit->timestamp,
|
||||
deposit->refund_deadline,
|
||||
&deposit->merchant_pub,
|
||||
@ -325,7 +325,7 @@ TEH_DB_execute_deposit (struct MHD_Connection *connection,
|
||||
return TEH_RESPONSE_reply_deposit_success (connection,
|
||||
&deposit->coin.coin_pub,
|
||||
&deposit->h_wire,
|
||||
&deposit->h_proposal_data,
|
||||
&deposit->h_contract_terms,
|
||||
deposit->timestamp,
|
||||
deposit->refund_deadline,
|
||||
&deposit->merchant_pub,
|
||||
@ -392,8 +392,8 @@ TEH_DB_execute_refund (struct MHD_Connection *connection,
|
||||
if ( (0 == memcmp (&tlp->details.deposit->merchant_pub,
|
||||
&refund->merchant_pub,
|
||||
sizeof (struct TALER_MerchantPublicKeyP))) &&
|
||||
(0 == memcmp (&tlp->details.deposit->h_proposal_data,
|
||||
&refund->h_proposal_data,
|
||||
(0 == memcmp (&tlp->details.deposit->h_contract_terms,
|
||||
&refund->h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode))) )
|
||||
{
|
||||
dep = tlp->details.deposit;
|
||||
@ -412,8 +412,8 @@ TEH_DB_execute_refund (struct MHD_Connection *connection,
|
||||
if ( (0 == memcmp (&tlp->details.refund->merchant_pub,
|
||||
&refund->merchant_pub,
|
||||
sizeof (struct TALER_MerchantPublicKeyP))) &&
|
||||
(0 == memcmp (&tlp->details.refund->h_proposal_data,
|
||||
&refund->h_proposal_data,
|
||||
(0 == memcmp (&tlp->details.refund->h_contract_terms,
|
||||
&refund->h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode))) &&
|
||||
(tlp->details.refund->rtransaction_id == refund->rtransaction_id) )
|
||||
{
|
||||
@ -425,8 +425,8 @@ TEH_DB_execute_refund (struct MHD_Connection *connection,
|
||||
if ( (0 == memcmp (&tlp->details.refund->merchant_pub,
|
||||
&refund->merchant_pub,
|
||||
sizeof (struct TALER_MerchantPublicKeyP))) &&
|
||||
(0 == memcmp (&tlp->details.refund->h_proposal_data,
|
||||
&refund->h_proposal_data,
|
||||
(0 == memcmp (&tlp->details.refund->h_contract_terms,
|
||||
&refund->h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode))) &&
|
||||
(tlp->details.refund->rtransaction_id != refund->rtransaction_id) )
|
||||
{
|
||||
@ -1981,7 +1981,7 @@ struct WtidTransactionContext
|
||||
* @param wire_method which wire plugin was used
|
||||
* @param h_wire hash of wire transfer details of the merchant (should be same for all callbacks with the same @e cls)
|
||||
* @param exec_time execution time of the wire transfer (should be same for all callbacks with the same @e cls)
|
||||
* @param h_proposal_data which proposal was this payment about
|
||||
* @param h_contract_terms which proposal was this payment about
|
||||
* @param coin_pub which public key was this payment about
|
||||
* @param deposit_value amount contributed by this coin in total
|
||||
* @param deposit_fee deposit fee charged by exchange for this coin
|
||||
@ -1993,7 +1993,7 @@ handle_transaction_data (void *cls,
|
||||
const char *wire_method,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
struct GNUNET_TIME_Absolute exec_time,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *deposit_value,
|
||||
const struct TALER_Amount *deposit_fee)
|
||||
@ -2058,7 +2058,7 @@ handle_transaction_data (void *cls,
|
||||
wdd = GNUNET_new (struct TEH_TrackTransferDetail);
|
||||
wdd->deposit_value = *deposit_value;
|
||||
wdd->deposit_fee = *deposit_fee;
|
||||
wdd->h_proposal_data = *h_proposal_data;
|
||||
wdd->h_contract_terms = *h_contract_terms;
|
||||
wdd->coin_pub = *coin_pub;
|
||||
GNUNET_CONTAINER_DLL_insert (ctx->wdd_head,
|
||||
ctx->wdd_tail,
|
||||
@ -2182,7 +2182,7 @@ struct DepositWtidContext
|
||||
/**
|
||||
* Hash of the proposal data we are looking up.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
|
||||
/**
|
||||
* Hash of the wire transfer details we are looking up.
|
||||
@ -2245,7 +2245,7 @@ handle_wtid_data (void *cls,
|
||||
else
|
||||
{
|
||||
ctx->res = TEH_RESPONSE_reply_track_transaction (ctx->connection,
|
||||
&ctx->h_proposal_data,
|
||||
&ctx->h_contract_terms,
|
||||
&ctx->h_wire,
|
||||
&ctx->coin_pub,
|
||||
&coin_delta,
|
||||
@ -2261,7 +2261,7 @@ handle_wtid_data (void *cls,
|
||||
* associated with the given deposit.
|
||||
*
|
||||
* @param connection the MHD connection to handle
|
||||
* @param h_proposal_data hash of the proposal data
|
||||
* @param h_contract_terms hash of the proposal data
|
||||
* @param h_wire hash of the wire details
|
||||
* @param coin_pub public key of the coin to link
|
||||
* @param merchant_pub public key of the merchant
|
||||
@ -2269,7 +2269,7 @@ handle_wtid_data (void *cls,
|
||||
*/
|
||||
int
|
||||
TEH_DB_execute_track_transaction (struct MHD_Connection *connection,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub)
|
||||
@ -2285,13 +2285,13 @@ TEH_DB_execute_track_transaction (struct MHD_Connection *connection,
|
||||
TALER_EC_DB_SETUP_FAILED);
|
||||
}
|
||||
ctx.connection = connection;
|
||||
ctx.h_proposal_data = *h_proposal_data;
|
||||
ctx.h_contract_terms = *h_contract_terms;
|
||||
ctx.h_wire = *h_wire;
|
||||
ctx.coin_pub = *coin_pub;
|
||||
ctx.res = GNUNET_SYSERR;
|
||||
ret = TEH_plugin->wire_lookup_deposit_wtid (TEH_plugin->cls,
|
||||
session,
|
||||
h_proposal_data,
|
||||
h_contract_terms,
|
||||
h_wire,
|
||||
coin_pub,
|
||||
merchant_pub,
|
||||
|
@ -222,7 +222,7 @@ TEH_DB_execute_track_transfer (struct MHD_Connection *connection,
|
||||
* associated with the given deposit.
|
||||
*
|
||||
* @param connection the MHD connection to handle
|
||||
* @param h_proposal_data hash of the contract
|
||||
* @param h_contract_terms hash of the contract
|
||||
* @param h_wire hash of the wire details
|
||||
* @param coin_pub public key of the coin to link
|
||||
* @param merchant_pub public key of the merchant
|
||||
@ -230,7 +230,7 @@ TEH_DB_execute_track_transfer (struct MHD_Connection *connection,
|
||||
*/
|
||||
int
|
||||
TEH_DB_execute_track_transaction (struct MHD_Connection *connection,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub);
|
||||
|
@ -54,7 +54,7 @@ verify_and_execute_deposit (struct MHD_Connection *connection,
|
||||
|
||||
dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
|
||||
dr.purpose.size = htonl (sizeof (struct TALER_DepositRequestPS));
|
||||
dr.h_proposal_data = deposit->h_proposal_data;
|
||||
dr.h_contract_terms = deposit->h_contract_terms;
|
||||
dr.h_wire = deposit->h_wire;
|
||||
dr.timestamp = GNUNET_TIME_absolute_hton (deposit->timestamp);
|
||||
dr.refund_deadline = GNUNET_TIME_absolute_hton (deposit->refund_deadline);
|
||||
@ -118,7 +118,7 @@ TEH_DEPOSIT_handler_deposit (struct TEH_RequestHandler *rh,
|
||||
TALER_JSON_spec_denomination_signature ("ub_sig", &deposit.coin.denom_sig),
|
||||
GNUNET_JSON_spec_fixed_auto ("coin_pub", &deposit.coin.coin_pub),
|
||||
GNUNET_JSON_spec_fixed_auto ("merchant_pub", &deposit.merchant_pub),
|
||||
GNUNET_JSON_spec_fixed_auto ("h_proposal_data", &deposit.h_proposal_data),
|
||||
GNUNET_JSON_spec_fixed_auto ("h_contract_terms", &deposit.h_contract_terms),
|
||||
GNUNET_JSON_spec_fixed_auto ("H_wire", &deposit.h_wire),
|
||||
GNUNET_JSON_spec_fixed_auto ("coin_sig", &deposit.csig),
|
||||
GNUNET_JSON_spec_absolute_time ("timestamp", &deposit.timestamp),
|
||||
|
@ -54,7 +54,7 @@ verify_and_execute_refund (struct MHD_Connection *connection,
|
||||
|
||||
rr.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND);
|
||||
rr.purpose.size = htonl (sizeof (struct TALER_RefundRequestPS));
|
||||
rr.h_proposal_data = refund->h_proposal_data;
|
||||
rr.h_contract_terms = refund->h_contract_terms;
|
||||
rr.coin_pub = refund->coin.coin_pub;
|
||||
rr.merchant = refund->merchant_pub;
|
||||
rr.rtransaction_id = GNUNET_htonll (refund->rtransaction_id);
|
||||
@ -122,7 +122,7 @@ TEH_REFUND_handler_refund (struct TEH_RequestHandler *rh,
|
||||
struct GNUNET_JSON_Specification spec[] = {
|
||||
TALER_JSON_spec_amount ("refund_amount", &refund.refund_amount),
|
||||
TALER_JSON_spec_amount ("refund_fee", &refund.refund_fee),
|
||||
GNUNET_JSON_spec_fixed_auto ("h_proposal_data", &refund.h_proposal_data),
|
||||
GNUNET_JSON_spec_fixed_auto ("h_contract_terms", &refund.h_contract_terms),
|
||||
GNUNET_JSON_spec_fixed_auto ("coin_pub", &refund.coin.coin_pub),
|
||||
GNUNET_JSON_spec_fixed_auto ("merchant_pub", &refund.merchant_pub),
|
||||
GNUNET_JSON_spec_uint64 ("rtransaction_id", &refund.rtransaction_id),
|
||||
|
@ -472,7 +472,7 @@ TEH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection)
|
||||
* @param connection connection to the client
|
||||
* @param coin_pub public key of the coin
|
||||
* @param h_wire hash of wire details
|
||||
* @param h_proposal_data hash of contract details
|
||||
* @param h_contract_terms hash of contract details
|
||||
* @param timestamp client's timestamp
|
||||
* @param refund_deadline until when this deposit be refunded
|
||||
* @param merchant merchant public key
|
||||
@ -483,7 +483,7 @@ int
|
||||
TEH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute timestamp,
|
||||
struct GNUNET_TIME_Absolute refund_deadline,
|
||||
const struct TALER_MerchantPublicKeyP *merchant,
|
||||
@ -495,7 +495,7 @@ TEH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
|
||||
|
||||
dc.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT);
|
||||
dc.purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS));
|
||||
dc.h_proposal_data = *h_proposal_data;
|
||||
dc.h_contract_terms = *h_contract_terms;
|
||||
dc.h_wire = *h_wire;
|
||||
dc.timestamp = GNUNET_TIME_absolute_hton (timestamp);
|
||||
dc.refund_deadline = GNUNET_TIME_absolute_hton (refund_deadline);
|
||||
@ -543,7 +543,7 @@ compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl)
|
||||
|
||||
dr.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
|
||||
dr.purpose.size = htonl (sizeof (struct TALER_DepositRequestPS));
|
||||
dr.h_proposal_data = deposit->h_proposal_data;
|
||||
dr.h_contract_terms = deposit->h_contract_terms;
|
||||
dr.h_wire = deposit->h_wire;
|
||||
dr.timestamp = GNUNET_TIME_absolute_hton (deposit->timestamp);
|
||||
dr.refund_deadline = GNUNET_TIME_absolute_hton (deposit->refund_deadline);
|
||||
@ -574,7 +574,7 @@ compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl)
|
||||
"timestamp", GNUNET_JSON_from_time_abs (deposit->timestamp),
|
||||
"refund_deadline", GNUNET_JSON_from_time_abs (deposit->refund_deadline),
|
||||
"merchant_pub", GNUNET_JSON_from_data_auto (&deposit->merchant_pub),
|
||||
"h_proposal_data", GNUNET_JSON_from_data_auto (&deposit->h_proposal_data),
|
||||
"h_contract_terms", GNUNET_JSON_from_data_auto (&deposit->h_contract_terms),
|
||||
"h_wire", GNUNET_JSON_from_data_auto (&deposit->h_wire),
|
||||
"coin_sig", GNUNET_JSON_from_data_auto (&deposit->csig))));
|
||||
break;
|
||||
@ -631,7 +631,7 @@ compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl)
|
||||
}
|
||||
rr.purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND);
|
||||
rr.purpose.size = htonl (sizeof (struct TALER_RefundRequestPS));
|
||||
rr.h_proposal_data = refund->h_proposal_data;
|
||||
rr.h_contract_terms = refund->h_contract_terms;
|
||||
rr.coin_pub = refund->coin.coin_pub;
|
||||
rr.merchant = refund->merchant_pub;
|
||||
rr.rtransaction_id = GNUNET_htonll (refund->rtransaction_id);
|
||||
@ -657,7 +657,7 @@ compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl)
|
||||
"type", "REFUND",
|
||||
"amount", TALER_JSON_from_amount (&value),
|
||||
"refund_fee", TALER_JSON_from_amount (&refund->refund_fee),
|
||||
"h_proposal_data", GNUNET_JSON_from_data_auto (&refund->h_proposal_data),
|
||||
"h_contract_terms", GNUNET_JSON_from_data_auto (&refund->h_contract_terms),
|
||||
"merchant_pub", GNUNET_JSON_from_data_auto (&refund->merchant_pub),
|
||||
"rtransaction_id", (json_int_t) refund->rtransaction_id,
|
||||
"merchant_sig", GNUNET_JSON_from_data_auto (&refund->merchant_sig))));
|
||||
@ -992,7 +992,7 @@ TEH_RESPONSE_reply_refund_success (struct MHD_Connection *connection,
|
||||
|
||||
rc.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND);
|
||||
rc.purpose.size = htonl (sizeof (struct TALER_RefundConfirmationPS));
|
||||
rc.h_proposal_data = refund->h_proposal_data;
|
||||
rc.h_contract_terms = refund->h_contract_terms;
|
||||
rc.coin_pub = refund->coin.coin_pub;
|
||||
rc.merchant = refund->merchant_pub;
|
||||
rc.rtransaction_id = GNUNET_htonll (refund->rtransaction_id);
|
||||
@ -1387,7 +1387,7 @@ TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
|
||||
* them. Generates the 200 reply.
|
||||
*
|
||||
* @param connection connection to the client
|
||||
* @param h_proposal_data hash of the contract
|
||||
* @param h_contract_terms hash of the contract
|
||||
* @param h_wire hash of wire account details
|
||||
* @param coin_pub public key of the coin
|
||||
* @param coin_contribution how much did the coin we asked about
|
||||
@ -1398,7 +1398,7 @@ TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
|
||||
*/
|
||||
int
|
||||
TEH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *coin_contribution,
|
||||
@ -1412,7 +1412,7 @@ TEH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
|
||||
cw.purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE);
|
||||
cw.purpose.size = htonl (sizeof (struct TALER_ConfirmWirePS));
|
||||
cw.h_wire = *h_wire;
|
||||
cw.h_proposal_data = *h_proposal_data;
|
||||
cw.h_contract_terms = *h_contract_terms;
|
||||
cw.wtid = *wtid;
|
||||
cw.coin_pub = *coin_pub;
|
||||
cw.execution_time = GNUNET_TIME_absolute_hton (exec_time);
|
||||
@ -1467,7 +1467,7 @@ TEH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
|
||||
hash_context = GNUNET_CRYPTO_hash_context_start ();
|
||||
for (wdd_pos = wdd_head; NULL != wdd_pos; wdd_pos = wdd_pos->next)
|
||||
{
|
||||
dd.h_proposal_data = wdd_pos->h_proposal_data;
|
||||
dd.h_contract_terms = wdd_pos->h_contract_terms;
|
||||
dd.execution_time = GNUNET_TIME_absolute_hton (exec_time);
|
||||
dd.coin_pub = wdd_pos->coin_pub;
|
||||
TALER_amount_hton (&dd.deposit_value,
|
||||
@ -1480,7 +1480,7 @@ TEH_RESPONSE_reply_track_transfer_details (struct MHD_Connection *connection,
|
||||
GNUNET_assert (0 ==
|
||||
json_array_append_new (deposits,
|
||||
json_pack ("{s:o, s:o, s:o, s:o}",
|
||||
"h_proposal_data", GNUNET_JSON_from_data_auto (&wdd_pos->h_proposal_data),
|
||||
"h_contract_terms", GNUNET_JSON_from_data_auto (&wdd_pos->h_contract_terms),
|
||||
"coin_pub", GNUNET_JSON_from_data_auto (&wdd_pos->coin_pub),
|
||||
"deposit_value", TALER_JSON_from_amount (&wdd_pos->deposit_value),
|
||||
"deposit_fee", TALER_JSON_from_amount (&wdd_pos->deposit_fee))));
|
||||
|
@ -254,7 +254,7 @@ TEH_RESPONSE_reply_invalid_json (struct MHD_Connection *connectionx);
|
||||
* @param connection connection to the client
|
||||
* @param coin_pub public key of the coin
|
||||
* @param h_wire hash of wire details
|
||||
* @param h_proposal_data hash of proposal data
|
||||
* @param h_contract_terms hash of proposal data
|
||||
* @param timestamp client's timestamp
|
||||
* @param refund_deadline until when this deposit be refunded
|
||||
* @param merchant merchant public key
|
||||
@ -265,7 +265,7 @@ int
|
||||
TEH_RESPONSE_reply_deposit_success (struct MHD_Connection *connection,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute timestamp,
|
||||
struct GNUNET_TIME_Absolute refund_deadline,
|
||||
const struct TALER_MerchantPublicKeyP *merchant,
|
||||
@ -361,7 +361,7 @@ TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
|
||||
* them. Generates the 200 reply.
|
||||
*
|
||||
* @param connection connection to the client
|
||||
* @param h_proposal_data hash of the proposal data
|
||||
* @param h_contract_terms hash of the proposal data
|
||||
* @param h_wire hash of wire account details
|
||||
* @param coin_pub public key of the coin
|
||||
* @param coin_contribution contribution of this coin to the total amount transferred
|
||||
@ -371,7 +371,7 @@ TEH_RESPONSE_reply_transfer_pending (struct MHD_Connection *connection,
|
||||
*/
|
||||
int
|
||||
TEH_RESPONSE_reply_track_transaction (struct MHD_Connection *connection,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *coin_contribution,
|
||||
@ -398,7 +398,7 @@ struct TEH_TrackTransferDetail
|
||||
/**
|
||||
* Hash of the proposal data.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
|
||||
/**
|
||||
* Coin's public key.
|
||||
|
@ -90,7 +90,7 @@ check_and_handle_track_transaction_request (struct MHD_Connection *connection,
|
||||
"merchant_sig");
|
||||
}
|
||||
return TEH_DB_execute_track_transaction (connection,
|
||||
&tps->h_proposal_data,
|
||||
&tps->h_contract_terms,
|
||||
&tps->h_wire,
|
||||
&tps->coin_pub,
|
||||
merchant_pub);
|
||||
@ -120,7 +120,7 @@ TEH_TRACKING_handler_track_transaction (struct TEH_RequestHandler *rh,
|
||||
struct TALER_MerchantSignatureP merchant_sig;
|
||||
struct GNUNET_JSON_Specification spec[] = {
|
||||
GNUNET_JSON_spec_fixed_auto ("H_wire", &tps.h_wire),
|
||||
GNUNET_JSON_spec_fixed_auto ("h_proposal_data", &tps.h_proposal_data),
|
||||
GNUNET_JSON_spec_fixed_auto ("h_contract_terms", &tps.h_contract_terms),
|
||||
GNUNET_JSON_spec_fixed_auto ("coin_pub", &tps.coin_pub),
|
||||
GNUNET_JSON_spec_fixed_auto ("merchant_pub", &tps.merchant),
|
||||
GNUNET_JSON_spec_fixed_auto ("merchant_sig", &merchant_sig),
|
||||
|
@ -419,7 +419,7 @@ do_deposit (struct Command *cmd)
|
||||
/* contract is just picked at random;
|
||||
note: we may want to write this back to 'cmd' in the future. */
|
||||
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||
&deposit.h_proposal_data);
|
||||
&deposit.h_contract_terms);
|
||||
if ( (GNUNET_OK !=
|
||||
TALER_string_to_amount (cmd->details.deposit.amount_with_fee,
|
||||
&deposit.amount_with_fee)) ||
|
||||
|
@ -39,7 +39,7 @@
|
||||
/admin/add/incoming {"reserve_pub":"BSEFVVNZ4C3724BPVKTJMQMD73HQREA5FWSS1C1BZ36ZFF2WBTK0","amount":"{\"currency\":\"EUR\",\"value\":5,\"fraction\":3}","execution_date":"\/Date(1436271156447)\/","wire":{"type":"test"}}
|
||||
#
|
||||
# Bogus denomination key
|
||||
/deposit {"f":{"currency":"EUR","value":5,"fraction":0},"h_proposal_data":"NRT9E07FYT147V4VCDG0102P0YX0FZ11ZRG90F4X1HDV95M0J64ZVE4XQGNN9MJ3B5K3JX6TJ181KNGRYSZSTYZ5PQHBM1F9QKQ5B50","wire":{"bank":"dest bank","type":"TEST","account":42},"timestamp":"/Date(1436823947)/","coin_pub":"2KCPBGZ77VGJT4DG99EZAY0GQ5TJ89DF53FWYR5RFRTK0CCXRMFG","denom_pub":"51B7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH354520818CMG26C1H60R30C935452081918G2J2G0","coin_sig":"W1TDFCSW5XQX9ZF4QPVP3JAJFYA7G4X6SY2B49KRNTDMA685M9YNFETV4610RFKZMSQ3RBRCYBJQH1ZQSMTDMW9W8X6C9SGPCA5ST0R","H_wire":"YQED9FDYPKK2QQYB3FS19Y15ZMKBAXJP2C73CXASAF1KM6ZYY723TEJ3HBR6D864A7X5W58G92QJ0A9PFMZNB81ZP9NJAQQCCABM4RG","ub_sig":"51SPJSSDESGPR80A40M74WV140520818ECG26DSQ8913AC1S7513EC9G6914AE228H236HHR68VKCCSK650MAGSM6GV3GCHP6D330H1R8GVKJD9P68W46H9Q8GVK8HA6752M2CSN8N248DHJ8H346E9J8RS4CDA28D33ECJ38S33JC9R6MRM8D9G74WM8HA668T44H1N6RT44GHS8CSK8H1G6D346C9J6CS3EC1N8H2M4HA38CSK2D246CW4CD1P70VMAD1Q891K8H1M64TK6C258MRM6G9R88RM6E2488WK2CSQ6GW3GH9N64RKGH2375136GA66533GCSJ65344CHH84W38HHP75330DA58RSKJCJ364SK0C1R8GVK6DSP61134HA48GT4CE1J6MW36C9G891K2GT68GTMCCSQ890M8E1P88R44DA174VK4E135452081918G2J2G0","merchant_pub":"4032W2ZXFW000KRJQDH3CZR00000000004000030P6YG1NR50000","refund_deadline":"/Date(0)/"}
|
||||
/deposit {"f":{"currency":"EUR","value":5,"fraction":0},"h_contract_terms":"NRT9E07FYT147V4VCDG0102P0YX0FZ11ZRG90F4X1HDV95M0J64ZVE4XQGNN9MJ3B5K3JX6TJ181KNGRYSZSTYZ5PQHBM1F9QKQ5B50","wire":{"bank":"dest bank","type":"TEST","account":42},"timestamp":"/Date(1436823947)/","coin_pub":"2KCPBGZ77VGJT4DG99EZAY0GQ5TJ89DF53FWYR5RFRTK0CCXRMFG","denom_pub":"51B7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH354520818CMG26C1H60R30C935452081918G2J2G0","coin_sig":"W1TDFCSW5XQX9ZF4QPVP3JAJFYA7G4X6SY2B49KRNTDMA685M9YNFETV4610RFKZMSQ3RBRCYBJQH1ZQSMTDMW9W8X6C9SGPCA5ST0R","H_wire":"YQED9FDYPKK2QQYB3FS19Y15ZMKBAXJP2C73CXASAF1KM6ZYY723TEJ3HBR6D864A7X5W58G92QJ0A9PFMZNB81ZP9NJAQQCCABM4RG","ub_sig":"51SPJSSDESGPR80A40M74WV140520818ECG26DSQ8913AC1S7513EC9G6914AE228H236HHR68VKCCSK650MAGSM6GV3GCHP6D330H1R8GVKJD9P68W46H9Q8GVK8HA6752M2CSN8N248DHJ8H346E9J8RS4CDA28D33ECJ38S33JC9R6MRM8D9G74WM8HA668T44H1N6RT44GHS8CSK8H1G6D346C9J6CS3EC1N8H2M4HA38CSK2D246CW4CD1P70VMAD1Q891K8H1M64TK6C258MRM6G9R88RM6E2488WK2CSQ6GW3GH9N64RKGH2375136GA66533GCSJ65344CHH84W38HHP75330DA58RSKJCJ364SK0C1R8GVK6DSP61134HA48GT4CE1J6MW36C9G891K2GT68GTMCCSQ890M8E1P88R44DA174VK4E135452081918G2J2G0","merchant_pub":"4032W2ZXFW000KRJQDH3CZR00000000004000030P6YG1NR50000","refund_deadline":"/Date(0)/"}
|
||||
#
|
||||
# missing coin_ev argument
|
||||
/withdraw/sign {"denom_pub":"51R7ARKCD5HJTTV5F4G0M818E9SP280A40G2GVH04CR30E9S6GVK2DHM8S234C236CR32C9N8RW44E9M712KAH1R60VM2CJ16RT3GGA18RR36CA575144DJ58CTK0E9M8D2M2E9S8GTKGH1Q8S0KACT174S3AD2670R4ADJ664W32C1N8N23CHA58MSK6DJ26WSMAD1P8H132CHP8GWKAG9K8RS46GJ6890M6GT28GSK4GJ66X2KCCA168RM4GA67113GDA28RR4AGA36RVK6GA460VKJDT58CVK6HA488R48E9R6D2KEH258N246HHJ850K4H9R8N0KEC9N68SM2EA48RR3JEA284SM6C9M6D130D228MSK6H1J6MSKCH1K8CR38CJ48MV36GJ38513CE9P60TM6CA56D1K8HHQ75244DA26WW4CG9M8MW3JE9M7133JGH354520818CMG26C1H60R30C935452081918G2J2G0","#oin_ev":"7DPN42W14BWWD2NWNDYP086276CFV0H8VEV43NFWQGZ3Y8WVR5R5HCN8THX43Z61TFN3CH9N6X5Q0P0T9NF2G8ZWBH8KXEQFQ973CMDDHF1FSE2G9289AB9ERHM8X222VB2WS733X36P8EMG4D3T1N2JHFP530C9RPEAPHDQXZABB6CJ63YD0581JVRY365HHF20RW3BNVKXP","reserve_sig":"VPKYWKGE6FB172XX222N1J0TAEXQE6VERN5X4ANJ0D9K1E7JAX01CPR1PT51SKK5JD72H1GRJ0S2ZQSKN22ZBEGKS77GMT6BF6DD030","reserve_pub":"FN7ARB2MJH2EDMMVT2985Y141YTCE503FS27BTNQ6JSCG3GMBJDG"}
|
||||
|
@ -209,7 +209,7 @@ PERF_TALER_EXCHANGEDB_deposit_init (const struct PERF_TALER_EXCHANGEDB_Coin *coi
|
||||
struct TALER_EXCHANGEDB_Deposit *deposit;
|
||||
struct TALER_CoinSpendSignatureP csig;
|
||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
struct GNUNET_HashCode h_wire;
|
||||
const char wire[] = "{"
|
||||
"\"type\":\"SEPA\","
|
||||
@ -225,7 +225,7 @@ PERF_TALER_EXCHANGEDB_deposit_init (const struct PERF_TALER_EXCHANGEDB_Coin *coi
|
||||
GNUNET_assert (NULL !=
|
||||
(deposit = GNUNET_malloc (sizeof (struct TALER_EXCHANGEDB_Deposit) + sizeof (wire))));
|
||||
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||
&h_proposal_data);
|
||||
&h_contract_terms);
|
||||
GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||
&h_wire);
|
||||
{ //csig
|
||||
@ -233,10 +233,10 @@ PERF_TALER_EXCHANGEDB_deposit_init (const struct PERF_TALER_EXCHANGEDB_Coin *coi
|
||||
{
|
||||
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
|
||||
struct GNUNET_HashCode h_wire;
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
} unsigned_data;
|
||||
|
||||
unsigned_data.h_proposal_data = h_proposal_data;
|
||||
unsigned_data.h_contract_terms = h_contract_terms;
|
||||
unsigned_data.h_wire = h_wire;
|
||||
unsigned_data.purpose.size = htonl (sizeof (struct u32_presign));
|
||||
unsigned_data.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST);
|
||||
@ -273,7 +273,7 @@ PERF_TALER_EXCHANGEDB_deposit_init (const struct PERF_TALER_EXCHANGEDB_Coin *coi
|
||||
GNUNET_assert (NULL != coin->public_info.denom_sig.rsa_signature);
|
||||
}
|
||||
deposit->csig = csig;
|
||||
deposit->h_proposal_data = h_proposal_data;
|
||||
deposit->h_contract_terms = h_contract_terms;
|
||||
deposit->h_wire = h_wire;
|
||||
deposit->receiver_wire_account = json_loads (wire, 0, NULL);
|
||||
deposit->timestamp = timestamp;
|
||||
|
@ -529,17 +529,17 @@ postgres_create_tables (void *cls)
|
||||
",refund_deadline INT8 NOT NULL"
|
||||
",wire_deadline INT8 NOT NULL"
|
||||
",merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)"
|
||||
",h_proposal_data BYTEA NOT NULL CHECK (LENGTH(h_proposal_data)=64)"
|
||||
",h_contract_terms BYTEA NOT NULL CHECK (LENGTH(h_contract_terms)=64)"
|
||||
",h_wire BYTEA NOT NULL CHECK (LENGTH(h_wire)=64)"
|
||||
",coin_sig BYTEA NOT NULL CHECK (LENGTH(coin_sig)=64)"
|
||||
",wire TEXT NOT NULL"
|
||||
",tiny BOOLEAN NOT NULL DEFAULT false"
|
||||
",done BOOLEAN NOT NULL DEFAULT false"
|
||||
",UNIQUE (coin_pub, h_proposal_data, merchant_pub)"
|
||||
",UNIQUE (coin_pub, h_contract_terms, merchant_pub)"
|
||||
")");
|
||||
/* Index for get_deposit statement on coin_pub, h_proposal_data and merchant_pub */
|
||||
/* Index for get_deposit statement on coin_pub, h_contract_terms and merchant_pub */
|
||||
SQLEXEC_INDEX("CREATE INDEX deposits_coin_pub_index "
|
||||
"ON deposits(coin_pub, h_proposal_data, merchant_pub)");
|
||||
"ON deposits(coin_pub, h_contract_terms, merchant_pub)");
|
||||
|
||||
/* Table with information about coins that have been refunded. (Technically
|
||||
one of the deposit operations that a coin was involved with is refunded.)*/
|
||||
@ -548,12 +548,12 @@ postgres_create_tables (void *cls)
|
||||
",coin_pub BYTEA NOT NULL REFERENCES known_coins (coin_pub) ON DELETE CASCADE"
|
||||
",merchant_pub BYTEA NOT NULL CHECK(LENGTH(merchant_pub)=32)"
|
||||
",merchant_sig BYTEA NOT NULL CHECK(LENGTH(merchant_sig)=64)"
|
||||
",h_proposal_data BYTEA NOT NULL CHECK(LENGTH(h_proposal_data)=64)"
|
||||
",h_contract_terms BYTEA NOT NULL CHECK(LENGTH(h_contract_terms)=64)"
|
||||
",rtransaction_id INT8 NOT NULL"
|
||||
",amount_with_fee_val INT8 NOT NULL"
|
||||
",amount_with_fee_frac INT4 NOT NULL"
|
||||
",amount_with_fee_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||
",PRIMARY KEY (coin_pub, merchant_pub, h_proposal_data, rtransaction_id)" /* this combo must be unique, and we usually select by coin_pub */
|
||||
",PRIMARY KEY (coin_pub, merchant_pub, h_contract_terms, rtransaction_id)" /* this combo must be unique, and we usually select by coin_pub */
|
||||
") ");
|
||||
|
||||
/* This table contains the data for
|
||||
@ -1055,7 +1055,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
"SELECT"
|
||||
" merchant_pub"
|
||||
",merchant_sig"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",rtransaction_id"
|
||||
",denom.denom_pub"
|
||||
",coin_pub"
|
||||
@ -1075,7 +1075,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
"SELECT"
|
||||
" merchant_pub"
|
||||
",merchant_sig"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",rtransaction_id"
|
||||
",amount_with_fee_val"
|
||||
",amount_with_fee_frac"
|
||||
@ -1141,7 +1141,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
",refund_deadline"
|
||||
",wire_deadline"
|
||||
",merchant_pub"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",h_wire"
|
||||
",coin_sig"
|
||||
",wire"
|
||||
@ -1156,7 +1156,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
"(coin_pub "
|
||||
",merchant_pub "
|
||||
",merchant_sig "
|
||||
",h_proposal_data "
|
||||
",h_contract_terms "
|
||||
",rtransaction_id "
|
||||
",amount_with_fee_val "
|
||||
",amount_with_fee_frac "
|
||||
@ -1175,12 +1175,12 @@ postgres_prepare (PGconn *db_conn)
|
||||
",timestamp"
|
||||
",refund_deadline"
|
||||
",wire_deadline"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",h_wire"
|
||||
" FROM deposits"
|
||||
" WHERE ("
|
||||
" (coin_pub=$1) AND"
|
||||
" (h_proposal_data=$2) AND"
|
||||
" (h_contract_terms=$2) AND"
|
||||
" (merchant_pub=$3)"
|
||||
" )",
|
||||
3, NULL);
|
||||
@ -1198,7 +1198,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
",coin_sig"
|
||||
",refund_deadline"
|
||||
",wire_deadline"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",wire"
|
||||
",done"
|
||||
",deposit_serial_id"
|
||||
@ -1228,7 +1228,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
" WHERE ("
|
||||
" (coin_pub=$1) AND"
|
||||
" (merchant_pub=$2) AND"
|
||||
" (h_proposal_data=$3) AND"
|
||||
" (h_contract_terms=$3) AND"
|
||||
" (h_wire=$4)"
|
||||
" )",
|
||||
4, NULL);
|
||||
@ -1244,7 +1244,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
",denom.fee_deposit_frac"
|
||||
",denom.fee_deposit_curr"
|
||||
",wire_deadline"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",wire"
|
||||
",merchant_pub"
|
||||
",coin_pub"
|
||||
@ -1271,7 +1271,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
",denom.fee_deposit_frac"
|
||||
",denom.fee_deposit_curr"
|
||||
",wire_deadline"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",coin_pub"
|
||||
" FROM deposits"
|
||||
" JOIN known_coins USING (coin_pub)"
|
||||
@ -1304,7 +1304,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
" FROM deposits"
|
||||
" WHERE coin_pub=$1"
|
||||
" AND merchant_pub=$2"
|
||||
" AND h_proposal_data=$3"
|
||||
" AND h_contract_terms=$3"
|
||||
" AND h_wire=$4",
|
||||
5, NULL);
|
||||
|
||||
@ -1321,7 +1321,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
",timestamp"
|
||||
",refund_deadline"
|
||||
",merchant_pub"
|
||||
",h_proposal_data"
|
||||
",h_contract_terms"
|
||||
",h_wire"
|
||||
",wire"
|
||||
",coin_sig"
|
||||
@ -1395,7 +1395,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
PREPARE ("lookup_transactions",
|
||||
"SELECT"
|
||||
" aggregation_serial_id"
|
||||
",deposits.h_proposal_data"
|
||||
",deposits.h_contract_terms"
|
||||
",deposits.wire"
|
||||
",deposits.h_wire"
|
||||
",deposits.coin_pub"
|
||||
@ -1432,7 +1432,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
" JOIN denominations denom USING (denom_pub_hash)"
|
||||
" JOIN wire_out USING (wtid_raw)"
|
||||
" WHERE coin_pub=$1"
|
||||
" AND h_proposal_data=$2"
|
||||
" AND h_contract_terms=$2"
|
||||
" AND h_wire=$3"
|
||||
" AND merchant_pub=$4",
|
||||
4, NULL);
|
||||
@ -3060,7 +3060,7 @@ postgres_have_deposit (void *cls,
|
||||
{
|
||||
struct GNUNET_PQ_QueryParam params[] = {
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->coin.coin_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_proposal_data),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_contract_terms),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->merchant_pub),
|
||||
GNUNET_PQ_query_param_end
|
||||
};
|
||||
@ -3095,8 +3095,8 @@ postgres_have_deposit (void *cls,
|
||||
&deposit2.refund_deadline),
|
||||
GNUNET_PQ_result_spec_absolute_time ("wire_deadline",
|
||||
&deposit2.wire_deadline),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data",
|
||||
&deposit2.h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
|
||||
&deposit2.h_contract_terms),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_wire",
|
||||
&deposit2.h_wire),
|
||||
GNUNET_PQ_result_spec_end
|
||||
@ -3116,8 +3116,8 @@ postgres_have_deposit (void *cls,
|
||||
deposit2.timestamp.abs_value_us) ||
|
||||
(deposit->refund_deadline.abs_value_us !=
|
||||
deposit2.refund_deadline.abs_value_us) ||
|
||||
(0 != memcmp (&deposit->h_proposal_data,
|
||||
&deposit2.h_proposal_data,
|
||||
(0 != memcmp (&deposit->h_contract_terms,
|
||||
&deposit2.h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode))) ||
|
||||
(0 != memcmp (&deposit->h_wire,
|
||||
&deposit2.h_wire,
|
||||
@ -3182,7 +3182,7 @@ postgres_test_deposit_done (void *cls,
|
||||
struct GNUNET_PQ_QueryParam params[] = {
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->coin.coin_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->merchant_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_proposal_data),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_contract_terms),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_wire),
|
||||
GNUNET_PQ_query_param_end
|
||||
};
|
||||
@ -3308,7 +3308,7 @@ postgres_get_ready_deposit (void *cls,
|
||||
struct TALER_Amount amount_with_fee;
|
||||
struct TALER_Amount deposit_fee;
|
||||
struct GNUNET_TIME_Absolute wire_deadline;
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||
uint64_t serial_id;
|
||||
@ -3322,8 +3322,8 @@ postgres_get_ready_deposit (void *cls,
|
||||
&deposit_fee),
|
||||
GNUNET_PQ_result_spec_absolute_time ("wire_deadline",
|
||||
&wire_deadline),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data",
|
||||
&h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
|
||||
&h_contract_terms),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("merchant_pub",
|
||||
&merchant_pub),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("coin_pub",
|
||||
@ -3348,7 +3348,7 @@ postgres_get_ready_deposit (void *cls,
|
||||
&coin_pub,
|
||||
&amount_with_fee,
|
||||
&deposit_fee,
|
||||
&h_proposal_data,
|
||||
&h_contract_terms,
|
||||
wire_deadline,
|
||||
wire);
|
||||
GNUNET_PQ_cleanup_result (rs);
|
||||
@ -3412,7 +3412,7 @@ postgres_iterate_matching_deposits (void *cls,
|
||||
struct TALER_Amount amount_with_fee;
|
||||
struct TALER_Amount deposit_fee;
|
||||
struct GNUNET_TIME_Absolute wire_deadline;
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||
uint64_t serial_id;
|
||||
int ret;
|
||||
@ -3425,8 +3425,8 @@ postgres_iterate_matching_deposits (void *cls,
|
||||
&deposit_fee),
|
||||
GNUNET_PQ_result_spec_absolute_time ("wire_deadline",
|
||||
&wire_deadline),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data",
|
||||
&h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
|
||||
&h_contract_terms),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("coin_pub",
|
||||
&coin_pub),
|
||||
GNUNET_PQ_result_spec_end
|
||||
@ -3446,7 +3446,7 @@ postgres_iterate_matching_deposits (void *cls,
|
||||
&coin_pub,
|
||||
&amount_with_fee,
|
||||
&deposit_fee,
|
||||
&h_proposal_data,
|
||||
&h_contract_terms,
|
||||
wire_deadline,
|
||||
NULL);
|
||||
GNUNET_PQ_cleanup_result (rs);
|
||||
@ -3584,7 +3584,7 @@ postgres_insert_deposit (void *cls,
|
||||
GNUNET_PQ_query_param_absolute_time (&deposit->refund_deadline),
|
||||
GNUNET_PQ_query_param_absolute_time (&deposit->wire_deadline),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->merchant_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_proposal_data),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_contract_terms),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->h_wire),
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->csig),
|
||||
TALER_PQ_query_param_json (deposit->receiver_wire_account),
|
||||
@ -3638,7 +3638,7 @@ postgres_insert_refund (void *cls,
|
||||
GNUNET_PQ_query_param_auto_from_type (&refund->coin.coin_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (&refund->merchant_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (&refund->merchant_sig),
|
||||
GNUNET_PQ_query_param_auto_from_type (&refund->h_proposal_data),
|
||||
GNUNET_PQ_query_param_auto_from_type (&refund->h_contract_terms),
|
||||
GNUNET_PQ_query_param_uint64 (&refund->rtransaction_id),
|
||||
TALER_PQ_query_param_amount (&refund->refund_amount),
|
||||
GNUNET_PQ_query_param_end
|
||||
@ -4474,8 +4474,8 @@ postgres_get_coin_transactions (void *cls,
|
||||
&deposit->refund_deadline),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("merchant_pub",
|
||||
&deposit->merchant_pub),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data",
|
||||
&deposit->h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
|
||||
&deposit->h_contract_terms),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_wire",
|
||||
&deposit->h_wire),
|
||||
TALER_PQ_result_spec_json ("wire",
|
||||
@ -4618,8 +4618,8 @@ postgres_get_coin_transactions (void *cls,
|
||||
&refund->merchant_pub),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("merchant_sig",
|
||||
&refund->merchant_sig),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data",
|
||||
&refund->h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
|
||||
&refund->h_contract_terms),
|
||||
GNUNET_PQ_result_spec_uint64 ("rtransaction_id",
|
||||
&refund->rtransaction_id),
|
||||
TALER_PQ_result_spec_amount ("amount_with_fee",
|
||||
@ -4782,7 +4782,7 @@ postgres_lookup_wire_transfer (void *cls,
|
||||
for (int i=0;i<nrows;i++)
|
||||
{
|
||||
uint64_t rowid;
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
struct GNUNET_HashCode h_wire;
|
||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||
@ -4794,7 +4794,7 @@ postgres_lookup_wire_transfer (void *cls,
|
||||
const char *wire_method;
|
||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||
GNUNET_PQ_result_spec_uint64 ("aggregation_serial_id", &rowid),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data", &h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms", &h_contract_terms),
|
||||
TALER_PQ_result_spec_json ("wire", &wire),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_wire", &h_wire),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("coin_pub", &coin_pub),
|
||||
@ -4834,7 +4834,7 @@ postgres_lookup_wire_transfer (void *cls,
|
||||
wire_method,
|
||||
&h_wire,
|
||||
exec_time,
|
||||
&h_proposal_data,
|
||||
&h_contract_terms,
|
||||
&coin_pub,
|
||||
&amount_with_fee,
|
||||
&deposit_fee);
|
||||
@ -4852,7 +4852,7 @@ postgres_lookup_wire_transfer (void *cls,
|
||||
*
|
||||
* @param cls closure
|
||||
* @param session database connection
|
||||
* @param h_proposal_data hash of the proposal data
|
||||
* @param h_contract_terms hash of the proposal data
|
||||
* @param h_wire hash of merchant wire details
|
||||
* @param coin_pub public key of deposited coin
|
||||
* @param merchant_pub merchant public key
|
||||
@ -4864,7 +4864,7 @@ postgres_lookup_wire_transfer (void *cls,
|
||||
static int
|
||||
postgres_wire_lookup_deposit_wtid (void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *session,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||
@ -4874,7 +4874,7 @@ postgres_wire_lookup_deposit_wtid (void *cls,
|
||||
PGresult *result;
|
||||
struct GNUNET_PQ_QueryParam params[] = {
|
||||
GNUNET_PQ_query_param_auto_from_type (coin_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (h_proposal_data),
|
||||
GNUNET_PQ_query_param_auto_from_type (h_contract_terms),
|
||||
GNUNET_PQ_query_param_auto_from_type (h_wire),
|
||||
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
|
||||
GNUNET_PQ_query_param_end
|
||||
@ -4905,7 +4905,7 @@ postgres_wire_lookup_deposit_wtid (void *cls,
|
||||
struct GNUNET_PQ_QueryParam params2[] = {
|
||||
GNUNET_PQ_query_param_auto_from_type (coin_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (merchant_pub),
|
||||
GNUNET_PQ_query_param_auto_from_type (h_proposal_data),
|
||||
GNUNET_PQ_query_param_auto_from_type (h_contract_terms),
|
||||
GNUNET_PQ_query_param_auto_from_type (h_wire),
|
||||
GNUNET_PQ_query_param_end
|
||||
};
|
||||
@ -5699,8 +5699,8 @@ postgres_select_deposits_above_serial_id (void *cls,
|
||||
&deposit.refund_deadline),
|
||||
GNUNET_PQ_result_spec_absolute_time ("wire_deadline",
|
||||
&deposit.wire_deadline),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data",
|
||||
&deposit.h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
|
||||
&deposit.h_contract_terms),
|
||||
TALER_PQ_result_spec_json ("wire",
|
||||
&deposit.receiver_wire_account),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("done",
|
||||
@ -5726,7 +5726,7 @@ postgres_select_deposits_above_serial_id (void *cls,
|
||||
&deposit.coin.coin_pub,
|
||||
&deposit.csig,
|
||||
&deposit.amount_with_fee,
|
||||
&deposit.h_proposal_data,
|
||||
&deposit.h_contract_terms,
|
||||
deposit.refund_deadline,
|
||||
deposit.wire_deadline,
|
||||
deposit.receiver_wire_account,
|
||||
@ -5903,8 +5903,8 @@ postgres_select_refunds_above_serial_id (void *cls,
|
||||
&refund.merchant_pub),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("merchant_sig",
|
||||
&refund.merchant_sig),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_proposal_data",
|
||||
&refund.h_proposal_data),
|
||||
GNUNET_PQ_result_spec_auto_from_type ("h_contract_terms",
|
||||
&refund.h_contract_terms),
|
||||
GNUNET_PQ_result_spec_uint64 ("rtransaction_id",
|
||||
&refund.rtransaction_id),
|
||||
GNUNET_PQ_result_spec_rsa_public_key ("denom_pub",
|
||||
@ -5932,7 +5932,7 @@ postgres_select_refunds_above_serial_id (void *cls,
|
||||
&refund.coin.coin_pub,
|
||||
&refund.merchant_pub,
|
||||
&refund.merchant_sig,
|
||||
&refund.h_proposal_data,
|
||||
&refund.h_contract_terms,
|
||||
refund.rtransaction_id,
|
||||
&refund.refund_amount);
|
||||
GNUNET_PQ_cleanup_result (rs);
|
||||
|
@ -789,7 +789,7 @@ cb_wt_never (void *cls,
|
||||
const char *wire_method,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
struct GNUNET_TIME_Absolute exec_time,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *coin_value,
|
||||
const struct TALER_Amount *coin_fee)
|
||||
@ -814,7 +814,7 @@ cb_wtid_never (void *cls,
|
||||
|
||||
static struct TALER_MerchantPublicKeyP merchant_pub_wt;
|
||||
static struct GNUNET_HashCode h_wire_wt;
|
||||
static struct GNUNET_HashCode h_proposal_data_wt;
|
||||
static struct GNUNET_HashCode h_contract_terms_wt;
|
||||
static struct TALER_CoinSpendPublicKeyP coin_pub_wt;
|
||||
static struct TALER_Amount coin_value_wt;
|
||||
static struct TALER_Amount coin_fee_wt;
|
||||
@ -833,7 +833,7 @@ cb_wt_check (void *cls,
|
||||
const char *wire_method,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
struct GNUNET_TIME_Absolute exec_time,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *coin_value,
|
||||
const struct TALER_Amount *coin_fee)
|
||||
@ -848,8 +848,8 @@ cb_wt_check (void *cls,
|
||||
&h_wire_wt,
|
||||
sizeof (struct GNUNET_HashCode)));
|
||||
GNUNET_assert (exec_time.abs_value_us == wire_out_date.abs_value_us);
|
||||
GNUNET_assert (0 == memcmp (h_proposal_data,
|
||||
&h_proposal_data_wt,
|
||||
GNUNET_assert (0 == memcmp (h_contract_terms,
|
||||
&h_contract_terms_wt,
|
||||
sizeof (struct GNUNET_HashCode)));
|
||||
GNUNET_assert (0 == memcmp (coin_pub,
|
||||
&coin_pub_wt,
|
||||
@ -902,7 +902,7 @@ static uint64_t deposit_rowid;
|
||||
* @param coin_pub public key of the coin
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @param deposit_fee amount the exchange gets to keep as transaction fees
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param wire_deadline by which the merchant adviced that he would like the
|
||||
* wire transfer to be executed
|
||||
* @param wire wire details for the merchant, NULL from iterate_matching_deposits()
|
||||
@ -916,7 +916,7 @@ deposit_cb (void *cls,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *amount_with_fee,
|
||||
const struct TALER_Amount *deposit_fee,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute wire_deadline,
|
||||
const json_t *wire)
|
||||
{
|
||||
@ -933,8 +933,8 @@ deposit_cb (void *cls,
|
||||
&deposit->amount_with_fee)) ||
|
||||
(0 != TALER_amount_cmp (deposit_fee,
|
||||
&deposit->deposit_fee)) ||
|
||||
(0 != memcmp (h_proposal_data,
|
||||
&deposit->h_proposal_data,
|
||||
(0 != memcmp (h_contract_terms,
|
||||
&deposit->h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode))) ||
|
||||
(0 != memcmp (coin_pub,
|
||||
&deposit->coin.coin_pub,
|
||||
@ -963,7 +963,7 @@ deposit_cb (void *cls,
|
||||
* @param coin_pub public key of the coin
|
||||
* @param coin_sig signature from the coin
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param refund_deadline by which the merchant adviced that he might want
|
||||
* to get a refund
|
||||
* @param wire_deadline by which the merchant adviced that he would like the
|
||||
@ -981,7 +981,7 @@ audit_deposit_cb (void *cls,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_CoinSpendSignatureP *coin_sig,
|
||||
const struct TALER_Amount *amount_with_fee,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute refund_deadline,
|
||||
struct GNUNET_TIME_Absolute wire_deadline,
|
||||
const json_t *receiver_wire_account,
|
||||
@ -1002,7 +1002,7 @@ audit_deposit_cb (void *cls,
|
||||
* @param coin_pub public key of the coin
|
||||
* @param merchant_pub public key of the merchant
|
||||
* @param merchant_sig signature of the merchant
|
||||
* @param h_proposal_data hash of the proposal data in
|
||||
* @param h_contract_terms hash of the proposal data in
|
||||
* the contract between merchant and customer
|
||||
* @param rtransaction_id refund transaction ID chosen by the merchant
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
@ -1015,7 +1015,7 @@ audit_refund_cb (void *cls,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||
const struct TALER_MerchantSignatureP *merchant_sig,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
uint64_t rtransaction_id,
|
||||
const struct TALER_Amount *amount_with_fee)
|
||||
{
|
||||
@ -1290,7 +1290,7 @@ test_wire_out (struct TALER_EXCHANGEDB_Session *session,
|
||||
/* setup values for wire transfer aggregation data */
|
||||
merchant_pub_wt = deposit->merchant_pub;
|
||||
h_wire_wt = deposit->h_wire;
|
||||
h_proposal_data_wt = deposit->h_proposal_data;
|
||||
h_contract_terms_wt = deposit->h_contract_terms;
|
||||
coin_pub_wt = deposit->coin.coin_pub;
|
||||
|
||||
coin_value_wt = deposit->amount_with_fee;
|
||||
@ -1307,13 +1307,13 @@ test_wire_out (struct TALER_EXCHANGEDB_Session *session,
|
||||
NULL));
|
||||
|
||||
{
|
||||
struct GNUNET_HashCode h_proposal_data_wt2 = h_proposal_data_wt;
|
||||
struct GNUNET_HashCode h_contract_terms_wt2 = h_contract_terms_wt;
|
||||
|
||||
h_proposal_data_wt2.bits[0]++;
|
||||
h_contract_terms_wt2.bits[0]++;
|
||||
FAILIF (GNUNET_NO !=
|
||||
plugin->wire_lookup_deposit_wtid (plugin->cls,
|
||||
session,
|
||||
&h_proposal_data_wt2,
|
||||
&h_contract_terms_wt2,
|
||||
&h_wire_wt,
|
||||
&coin_pub_wt,
|
||||
&merchant_pub_wt,
|
||||
@ -1350,7 +1350,7 @@ test_wire_out (struct TALER_EXCHANGEDB_Session *session,
|
||||
FAILIF (GNUNET_OK !=
|
||||
plugin->wire_lookup_deposit_wtid (plugin->cls,
|
||||
session,
|
||||
&h_proposal_data_wt,
|
||||
&h_contract_terms_wt,
|
||||
&h_wire_wt,
|
||||
&coin_pub_wt,
|
||||
&merchant_pub_wt,
|
||||
@ -1760,7 +1760,7 @@ run (void *cls)
|
||||
deposit.coin.denom_sig = cbc.sig;
|
||||
RND_BLK (&deposit.csig);
|
||||
RND_BLK (&deposit.merchant_pub);
|
||||
RND_BLK (&deposit.h_proposal_data);
|
||||
RND_BLK (&deposit.h_contract_terms);
|
||||
wire = json_loads (json_wire_str, 0, NULL);
|
||||
TALER_JSON_hash (wire,
|
||||
&deposit.h_wire);
|
||||
@ -1856,7 +1856,7 @@ run (void *cls)
|
||||
refund.coin = deposit.coin;
|
||||
refund.merchant_pub = deposit.merchant_pub;
|
||||
RND_BLK (&refund.merchant_sig);
|
||||
refund.h_proposal_data = deposit.h_proposal_data;
|
||||
refund.h_contract_terms = deposit.h_contract_terms;
|
||||
refund.rtransaction_id = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX);
|
||||
refund.refund_amount = deposit.amount_with_fee;
|
||||
refund.refund_fee = fee_refund;
|
||||
@ -1952,8 +1952,8 @@ run (void *cls)
|
||||
FAILIF (0 != memcmp (&have->merchant_pub,
|
||||
&deposit.merchant_pub,
|
||||
sizeof (struct TALER_MerchantPublicKeyP)));
|
||||
FAILIF (0 != memcmp (&have->h_proposal_data,
|
||||
&deposit.h_proposal_data,
|
||||
FAILIF (0 != memcmp (&have->h_contract_terms,
|
||||
&deposit.h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode)));
|
||||
FAILIF (0 != memcmp (&have->h_wire,
|
||||
&deposit.h_wire,
|
||||
@ -1994,8 +1994,8 @@ run (void *cls)
|
||||
FAILIF (0 != memcmp (&have->merchant_sig,
|
||||
&refund.merchant_sig,
|
||||
sizeof (struct TALER_MerchantSignatureP)));
|
||||
FAILIF (0 != memcmp (&have->h_proposal_data,
|
||||
&refund.h_proposal_data,
|
||||
FAILIF (0 != memcmp (&have->h_contract_terms,
|
||||
&refund.h_contract_terms,
|
||||
sizeof (struct GNUNET_HashCode)));
|
||||
FAILIF (have->rtransaction_id != refund.rtransaction_id);
|
||||
FAILIF (0 != TALER_amount_cmp (&have->refund_amount,
|
||||
|
@ -363,7 +363,7 @@ struct TALER_TrackTransferDetails
|
||||
/**
|
||||
* Hash of the proposal data.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
|
||||
/**
|
||||
* Which coin was deposited?
|
||||
|
@ -1265,7 +1265,7 @@ enum TALER_ErrorCode
|
||||
|
||||
/**
|
||||
* The backend encountered an error while trying to store the
|
||||
* h_proposal_data into the database.
|
||||
* h_contract_terms into the database.
|
||||
* The response is provided with HTTP status code MHD_HTTP_INTERNAL_SERVER_ERROR.
|
||||
*/
|
||||
TALER_EC_PROPOSAL_STORE_DB_ERROR = 2501,
|
||||
|
@ -520,7 +520,7 @@ typedef void
|
||||
* @param wire_deadline execution 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
|
||||
@ -538,7 +538,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,
|
||||
@ -606,7 +606,7 @@ typedef void
|
||||
* (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
|
||||
@ -622,7 +622,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,
|
||||
@ -1365,7 +1365,7 @@ typedef void
|
||||
* @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
|
||||
* @param h_contract_terms hash of the proposal data
|
||||
* @param coin_pub public key of the coin
|
||||
* @param cb function to call with the result
|
||||
* @param cb_cls closure for @a cb
|
||||
@ -1375,7 +1375,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);
|
||||
|
@ -334,7 +334,7 @@ struct TALER_EXCHANGEDB_Deposit
|
||||
* ECDSA signature affirming that the customer intends
|
||||
* this coin to be deposited at the merchant identified
|
||||
* by @e h_wire in relation to the proposal data identified
|
||||
* by @e h_proposal_data.
|
||||
* by @e h_contract_terms.
|
||||
*/
|
||||
struct TALER_CoinSpendSignatureP csig;
|
||||
|
||||
@ -348,7 +348,7 @@ struct TALER_EXCHANGEDB_Deposit
|
||||
* Hash over the proposa data between merchant and customer
|
||||
* (remains unknown to the Exchange).
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
|
||||
/**
|
||||
* Hash of the (canonical) representation of @e wire, used
|
||||
@ -439,7 +439,7 @@ struct TALER_EXCHANGEDB_Refund
|
||||
* Hash over the proposal data between merchant and customer
|
||||
* (remains unknown to the Exchange).
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
|
||||
/**
|
||||
* Merchant-generated REFUND transaction ID to detect duplicate
|
||||
@ -669,7 +669,7 @@ struct TALER_EXCHANGEDB_Session;
|
||||
* @param coin_pub public key of the coin
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @param deposit_fee amount the exchange gets to keep as transaction fees
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param wire_deadline by which the merchant adviced that he would like the
|
||||
* wire transfer to be executed
|
||||
* @param receiver_wire_account wire details for the merchant, NULL from iterate_matching_deposits()
|
||||
@ -682,7 +682,7 @@ typedef int
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *amount_with_fee,
|
||||
const struct TALER_Amount *deposit_fee,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute wire_deadline,
|
||||
const json_t *receiver_wire_account);
|
||||
|
||||
@ -716,7 +716,7 @@ typedef void
|
||||
* @param coin_pub public key of the coin
|
||||
* @param coin_sig signature from the coin
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param refund_deadline by which the merchant adviced that he might want
|
||||
* to get a refund
|
||||
* @param wire_deadline by which the merchant adviced that he would like the
|
||||
@ -734,7 +734,7 @@ typedef int
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_CoinSpendSignatureP *coin_sig,
|
||||
const struct TALER_Amount *amount_with_fee,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
struct GNUNET_TIME_Absolute refund_deadline,
|
||||
struct GNUNET_TIME_Absolute wire_deadline,
|
||||
const json_t *receiver_wire_account,
|
||||
@ -778,7 +778,7 @@ typedef int
|
||||
* @param coin_pub public key of the coin
|
||||
* @param merchant_pub public key of the merchant
|
||||
* @param merchant_sig signature of the merchant
|
||||
* @param h_proposal_data hash of the proposal data known to merchant and customer
|
||||
* @param h_contract_terms hash of the proposal data known to merchant and customer
|
||||
* @param rtransaction_id refund transaction ID chosen by the merchant
|
||||
* @param amount_with_fee amount that was deposited including fee
|
||||
* @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
|
||||
@ -790,7 +790,7 @@ typedef int
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||
const struct TALER_MerchantSignatureP *merchant_sig,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
uint64_t rtransaction_id,
|
||||
const struct TALER_Amount *amount_with_fee);
|
||||
|
||||
@ -892,7 +892,7 @@ typedef void
|
||||
* @param wire_method which wire plugin was used for the transfer?
|
||||
* @param h_wire hash of wire transfer details of the merchant (should be same for all callbacks with the same @e cls)
|
||||
* @param exec_time execution time of the wire transfer (should be same for all callbacks with the same @e cls)
|
||||
* @param h_proposal_data which proposal was this payment about
|
||||
* @param h_contract_terms which proposal was this payment about
|
||||
* @param coin_pub which public key was this payment about
|
||||
* @param coin_value amount contributed by this coin in total (with fee)
|
||||
* @param coin_fee applicable fee for this coin
|
||||
@ -904,7 +904,7 @@ typedef void
|
||||
const char *wire_method,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
struct GNUNET_TIME_Absolute exec_time,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_Amount *coin_value,
|
||||
const struct TALER_Amount *coin_fee);
|
||||
@ -1755,7 +1755,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
*
|
||||
* @param cls closure
|
||||
* @param session database connection
|
||||
* @param h_proposal_data hash of the proposal data
|
||||
* @param h_contract_terms hash of the proposal data
|
||||
* @param h_wire hash of merchant wire details
|
||||
* @param coin_pub public key of deposited coin
|
||||
* @param merchant_pub merchant public key
|
||||
@ -1767,7 +1767,7 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
int
|
||||
(*wire_lookup_deposit_wtid)(void *cls,
|
||||
struct TALER_EXCHANGEDB_Session *session,
|
||||
const struct GNUNET_HashCode *h_proposal_data,
|
||||
const struct GNUNET_HashCode *h_contract_terms,
|
||||
const struct GNUNET_HashCode *h_wire,
|
||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||
|
@ -285,7 +285,7 @@ struct TALER_DepositRequestPS
|
||||
/**
|
||||
* Hash over the contract for which this deposit is made.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data GNUNET_PACKED;
|
||||
struct GNUNET_HashCode h_contract_terms GNUNET_PACKED;
|
||||
|
||||
/**
|
||||
* Hash over the wiring information of the merchant.
|
||||
@ -363,7 +363,7 @@ struct TALER_DepositConfirmationPS
|
||||
/**
|
||||
* Hash over the contract for which this deposit is made.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data GNUNET_PACKED;
|
||||
struct GNUNET_HashCode h_contract_terms GNUNET_PACKED;
|
||||
|
||||
/**
|
||||
* Hash over the wiring information of the merchant.
|
||||
@ -421,7 +421,7 @@ struct TALER_RefundRequestPS
|
||||
* Hash over the proposal data to identify the contract
|
||||
* which is being refunded.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data GNUNET_PACKED;
|
||||
struct GNUNET_HashCode h_contract_terms GNUNET_PACKED;
|
||||
|
||||
/**
|
||||
* The coin's public key. This is the value that must have been
|
||||
@ -475,7 +475,7 @@ struct TALER_RefundConfirmationPS
|
||||
* Hash over the proposal data to identify the contract
|
||||
* which is being refunded.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data GNUNET_PACKED;
|
||||
struct GNUNET_HashCode h_contract_terms GNUNET_PACKED;
|
||||
|
||||
/**
|
||||
* The coin's public key. This is the value that must have been
|
||||
@ -973,7 +973,7 @@ struct TALER_DepositTrackPS
|
||||
/**
|
||||
* Hash over the proposal data of the contract for which this deposit is made.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data GNUNET_PACKED;
|
||||
struct GNUNET_HashCode h_contract_terms GNUNET_PACKED;
|
||||
|
||||
/**
|
||||
* Hash over the wiring information of the merchant.
|
||||
@ -1005,7 +1005,7 @@ struct TALER_WireDepositDetailP
|
||||
/**
|
||||
* Hash of the contract
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
|
||||
/**
|
||||
* Time when the wire transfer was performed by the exchange.
|
||||
@ -1105,7 +1105,7 @@ struct PaymentResponsePS
|
||||
/**
|
||||
* Hash of the proposal data associated with this confirmation
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data;
|
||||
struct GNUNET_HashCode h_contract_terms;
|
||||
};
|
||||
|
||||
|
||||
@ -1129,7 +1129,7 @@ struct TALER_ConfirmWirePS
|
||||
/**
|
||||
* Hash over the contract for which this deposit is made.
|
||||
*/
|
||||
struct GNUNET_HashCode h_proposal_data GNUNET_PACKED;
|
||||
struct GNUNET_HashCode h_contract_terms GNUNET_PACKED;
|
||||
|
||||
/**
|
||||
* Raw value (binary encoding) of the wire transfer subject.
|
||||
|
Loading…
Reference in New Issue
Block a user