diff options
| author | Christian Grothoff <christian@grothoff.org> | 2021-10-30 20:49:23 +0200 |
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2021-10-30 20:49:23 +0200 |
| commit | bc57abc3daa56178378b5184b9ec987c860c5f62 (patch) | |
| tree | 076b35d6c7ec6af7efe214b81e1faeab8813be8e /src/exchangedb | |
| parent | d83a65320af412bdc31c82397bb79a10a771166b (diff) | |
-more dB work
Diffstat (limited to 'src/exchangedb')
| -rw-r--r-- | src/exchangedb/exchange-0001.sql | 136 | ||||
| -rw-r--r-- | src/exchangedb/lrbt_callbacks.c | 67 | ||||
| -rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 91 | ||||
| -rw-r--r-- | src/exchangedb/test_exchangedb.c | 60 |
4 files changed, 202 insertions, 152 deletions
diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/exchange-0001.sql index f1c85678..905b5450 100644 --- a/src/exchangedb/exchange-0001.sql +++ b/src/exchangedb/exchange-0001.sql @@ -89,7 +89,6 @@ COMMENT ON COLUMN wire_targets.oauth_username CREATE TABLE IF NOT EXISTS reserves (reserve_uuid BIGSERIAL UNIQUE ,reserve_pub BYTEA PRIMARY KEY CHECK(LENGTH(reserve_pub)=32) - ,account_details TEXT NOT NULL ,current_balance_val INT8 NOT NULL ,current_balance_frac INT4 NOT NULL ,expiration_date INT8 NOT NULL @@ -199,6 +198,73 @@ CREATE INDEX IF NOT EXISTS reserves_out_for_get_withdraw_info ,h_blind_ev ); +CREATE TABLE IF NOT EXISTS auditors + (auditor_uuid BIGSERIAL UNIQUE + ,auditor_pub BYTEA PRIMARY KEY CHECK (LENGTH(auditor_pub)=32) + ,auditor_name VARCHAR NOT NULL + ,auditor_url VARCHAR NOT NULL + ,is_active BOOLEAN NOT NULL + ,last_change INT8 NOT NULL + ); +COMMENT ON TABLE auditors + IS 'Table with auditors the exchange uses or has used in the past. Entries never expire as we need to remember the last_change column indefinitely.'; +COMMENT ON COLUMN auditors.auditor_pub + IS 'Public key of the auditor.'; +COMMENT ON COLUMN auditors.auditor_url + IS 'The base URL of the auditor.'; +COMMENT ON COLUMN auditors.is_active + IS 'true if we are currently supporting the use of this auditor.'; +COMMENT ON COLUMN auditors.last_change + IS 'Latest time when active status changed. Used to detect replays of old messages.'; + + +CREATE TABLE IF NOT EXISTS auditor_denom_sigs + (auditor_denom_serial BIGSERIAL UNIQUE + ,auditor_uuid INT8 NOT NULL REFERENCES auditors (auditor_uuid) ON DELETE CASCADE + ,denominations_serial INT8 NOT NULL REFERENCES denominations (denominations_serial) ON DELETE CASCADE + ,auditor_sig BYTEA CHECK (LENGTH(auditor_sig)=64) + ,PRIMARY KEY (denominations_serial, auditor_uuid) + ); +COMMENT ON TABLE auditor_denom_sigs + IS 'Table with auditor signatures on exchange denomination keys.'; +COMMENT ON COLUMN auditor_denom_sigs.auditor_uuid + IS 'Identifies the auditor.'; +COMMENT ON COLUMN auditor_denom_sigs.denominations_serial + IS 'Denomination the signature is for.'; +COMMENT ON COLUMN auditor_denom_sigs.auditor_sig + IS 'Signature of the auditor, of purpose TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS.'; + + +CREATE TABLE IF NOT EXISTS exchange_sign_keys + (esk_serial BIGSERIAL UNIQUE + ,exchange_pub BYTEA PRIMARY KEY CHECK (LENGTH(exchange_pub)=32) + ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) + ,valid_from INT8 NOT NULL + ,expire_sign INT8 NOT NULL + ,expire_legal INT8 NOT NULL + ); +COMMENT ON TABLE exchange_sign_keys + IS 'Table with master public key signatures on exchange online signing keys.'; +COMMENT ON COLUMN exchange_sign_keys.exchange_pub + IS 'Public online signing key of the exchange.'; +COMMENT ON COLUMN exchange_sign_keys.master_sig + IS 'Signature affirming the validity of the signing key of purpose TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY.'; +COMMENT ON COLUMN exchange_sign_keys.valid_from + IS 'Time when this online signing key will first be used to sign messages.'; +COMMENT ON COLUMN exchange_sign_keys.expire_sign + IS 'Time when this online signing key will no longer be used to sign.'; +COMMENT ON COLUMN exchange_sign_keys.expire_legal + IS 'Time when this online signing key legally expires.'; + + +CREATE TABLE IF NOT EXISTS signkey_revocations + (signkey_revocations_serial_id BIGSERIAL UNIQUE + ,esk_serial INT8 PRIMARY KEY REFERENCES exchange_sign_keys (esk_serial) ON DELETE CASCADE + ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) + ); +COMMENT ON TABLE signkey_revocations + IS 'remembering which online signing keys have been revoked'; + CREATE TABLE IF NOT EXISTS known_coins (known_coin_id BIGSERIAL UNIQUE @@ -517,65 +583,6 @@ COMMENT ON INDEX prepare_get_index IS 'for wire_prepare_data_get'; -CREATE TABLE IF NOT EXISTS auditors - (auditor_uuid BIGSERIAL UNIQUE - ,auditor_pub BYTEA PRIMARY KEY CHECK (LENGTH(auditor_pub)=32) - ,auditor_name VARCHAR NOT NULL - ,auditor_url VARCHAR NOT NULL - ,is_active BOOLEAN NOT NULL - ,last_change INT8 NOT NULL - ); -COMMENT ON TABLE auditors - IS 'Table with auditors the exchange uses or has used in the past. Entries never expire as we need to remember the last_change column indefinitely.'; -COMMENT ON COLUMN auditors.auditor_pub - IS 'Public key of the auditor.'; -COMMENT ON COLUMN auditors.auditor_url - IS 'The base URL of the auditor.'; -COMMENT ON COLUMN auditors.is_active - IS 'true if we are currently supporting the use of this auditor.'; -COMMENT ON COLUMN auditors.last_change - IS 'Latest time when active status changed. Used to detect replays of old messages.'; - - -CREATE TABLE IF NOT EXISTS auditor_denom_sigs - (auditor_denom_serial BIGSERIAL UNIQUE - ,auditor_uuid INT8 NOT NULL REFERENCES auditors (auditor_uuid) ON DELETE CASCADE - ,denominations_serial INT8 NOT NULL REFERENCES denominations (denominations_serial) ON DELETE CASCADE - ,auditor_sig BYTEA CHECK (LENGTH(auditor_sig)=64) - ,PRIMARY KEY (denominations_serial, auditor_uuid) - ); -COMMENT ON TABLE auditor_denom_sigs - IS 'Table with auditor signatures on exchange denomination keys.'; -COMMENT ON COLUMN auditor_denom_sigs.auditor_uuid - IS 'Identifies the auditor.'; -COMMENT ON COLUMN auditor_denom_sigs.denominations_serial - IS 'Denomination the signature is for.'; -COMMENT ON COLUMN auditor_denom_sigs.auditor_sig - IS 'Signature of the auditor, of purpose TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS.'; - - -CREATE TABLE IF NOT EXISTS exchange_sign_keys - (esk_serial BIGSERIAL UNIQUE - ,exchange_pub BYTEA PRIMARY KEY CHECK (LENGTH(exchange_pub)=32) - ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) - ,valid_from INT8 NOT NULL - ,expire_sign INT8 NOT NULL - ,expire_legal INT8 NOT NULL - ); -COMMENT ON TABLE exchange_sign_keys - IS 'Table with master public key signatures on exchange online signing keys.'; -COMMENT ON COLUMN exchange_sign_keys.exchange_pub - IS 'Public online signing key of the exchange.'; -COMMENT ON COLUMN exchange_sign_keys.master_sig - IS 'Signature affirming the validity of the signing key of purpose TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY.'; -COMMENT ON COLUMN exchange_sign_keys.valid_from - IS 'Time when this online signing key will first be used to sign messages.'; -COMMENT ON COLUMN exchange_sign_keys.expire_sign - IS 'Time when this online signing key will no longer be used to sign.'; -COMMENT ON COLUMN exchange_sign_keys.expire_legal - IS 'Time when this online signing key legally expires.'; - - CREATE TABLE IF NOT EXISTS wire_accounts (payto_uri VARCHAR PRIMARY KEY ,master_sig BYTEA CHECK (LENGTH(master_sig)=64) @@ -596,15 +603,6 @@ COMMENT ON COLUMN wire_accounts.last_change -- and is of no concern to the auditor -CREATE TABLE IF NOT EXISTS signkey_revocations - (signkey_revocations_serial_id BIGSERIAL UNIQUE - ,esk_serial INT8 PRIMARY KEY REFERENCES exchange_sign_keys (esk_serial) ON DELETE CASCADE - ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) - ); -COMMENT ON TABLE signkey_revocations - IS 'remembering which online signing keys have been revoked'; - - CREATE TABLE IF NOT EXISTS work_shards (shard_serial_id BIGSERIAL UNIQUE ,last_attempt INT8 NOT NULL diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c index 6ac8ae3c..2edff558 100644 --- a/src/exchangedb/lrbt_callbacks.c +++ b/src/exchangedb/lrbt_callbacks.c @@ -48,6 +48,10 @@ lrbt_cb_table_denominations (void *cls, struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_uint64 ("serial", &td.serial), + GNUNET_PQ_result_spec_uint32 ("denom_type", + &td.details.denominations.denom_type), + GNUNET_PQ_result_spec_uint32 ("age_restrictions", + &td.details.denominations.age_restrictions), TALER_PQ_result_spec_denom_pub ( "denom_pub", &td.details.denominations.denom_pub), @@ -140,6 +144,54 @@ lrbt_cb_table_denomination_revocations (void *cls, /** + * Function called with wire_targets table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_wire_targets (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_WIRE_TARGETS + }; + + for (unsigned int i = 0; i<num_results; i++) + { + struct GNUNET_PQ_ResultSpec rs[] = { + GNUNET_PQ_result_spec_uint64 ("serial", + &td.serial), + GNUNET_PQ_result_spec_string ("payto_uri", + &td.details.wire_targets.payto_uri), + GNUNET_PQ_result_spec_auto_from_type ("kyc_ok", + &td.details.wire_targets.kyc_ok), + GNUNET_PQ_result_spec_string ("oauth_username", + &td.details.wire_targets.oauth_username), + GNUNET_PQ_result_spec_end + }; + + if (GNUNET_OK != + GNUNET_PQ_extract_result (result, + rs, + i)) + { + GNUNET_break (0); + ctx->error = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** * Function called with reserves table entries. * * @param cls closure @@ -828,6 +880,9 @@ lrbt_cb_table_deposits (void *cls, GNUNET_PQ_result_spec_uint64 ( "serial", &td.serial), + GNUNET_PQ_result_spec_uint64 ( + "shard", + &td.details.deposits.shard), TALER_PQ_RESULT_SPEC_AMOUNT ( "amount_with_fee", &td.details.deposits.amount_with_fee), @@ -852,9 +907,15 @@ lrbt_cb_table_deposits (void *cls, GNUNET_PQ_result_spec_auto_from_type ( "coin_sig", &td.details.deposits.coin_sig), - TALER_PQ_result_spec_json ( - "wire", - &td.details.deposits.wire), + GNUNET_PQ_result_spec_uint64 ( + "wire_target_serial_id", + &td.details.deposits.wire_target_serial_id), + GNUNET_PQ_result_spec_json ( + "extension_options", + &td.details.deposits.extension_options), + GNUNET_PQ_result_spec_auto_from_type ( + "extension_blocked", + &td.details.deposits.extension_blocked), GNUNET_PQ_result_spec_auto_from_type ( "tiny", &td.details.deposits.tiny), diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 34ad5750..846b59b0 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -1144,8 +1144,7 @@ prepare_statements (struct PostgresClosure *pg) "SELECT" " aggregation_serial_id" ",deposits.h_contract_terms" - ",deposits.wire" - ",deposits.h_wire" + ",payto_uri" ",kc.coin_pub" ",deposits.merchant_pub" ",wire_out.execution_date" @@ -1157,6 +1156,8 @@ prepare_statements (struct PostgresClosure *pg) " FROM aggregation_tracking" " JOIN deposits" " USING (deposit_serial_id)" + " JOIN wire_targets" + " USING (wire_target_serial_id)" " JOIN known_coins kc" " USING (known_coin_id)" " JOIN denominations denom" @@ -1172,9 +1173,13 @@ prepare_statements (struct PostgresClosure *pg) ",wire_out.execution_date" ",amount_with_fee_val" ",amount_with_fee_frac" + ",wire_salt" + ",payto_uri" ",denom.fee_deposit_val" ",denom.fee_deposit_frac" " FROM deposits" + " JOIN wire_targets" + " USING (wire_target_serial_id)" " JOIN aggregation_tracking" " USING (deposit_serial_id)" " JOIN known_coins" @@ -1184,10 +1189,9 @@ prepare_statements (struct PostgresClosure *pg) " JOIN wire_out" " USING (wtid_raw)" " WHERE coin_pub=$1" - " AND h_contract_terms=$2" - " AND h_wire=$3" - " AND merchant_pub=$4;", - 4), + " AND merchant_pub=$3" + " AND h_contract_terms=$2", + 3), /* Used in #postgres_insert_aggregation_tracking */ GNUNET_PQ_make_prepare ("insert_aggregation_tracking", "INSERT INTO aggregation_tracking " @@ -1278,12 +1282,15 @@ prepare_statements (struct PostgresClosure *pg) ",coin_pub" ",amount_with_fee_val" ",amount_with_fee_frac" - ",wire" + ",payto_uri" ",wire_deadline" ",tiny" ",done" " FROM deposits d" - " JOIN known_coins USING (known_coin_id)" + " JOIN known_coins" + " USING (known_coin_id)" + " JOIN wire_targets" + " USING (wire_target_serial_id)" " WHERE wire_deadline >= $1" " AND wire_deadline < $2" " AND NOT (EXISTS (SELECT 1" @@ -1314,11 +1321,15 @@ prepare_statements (struct PostgresClosure *pg) " wireout_uuid" ",execution_date" ",wtid_raw" - ",wire_target" + ",payto_uri" ",amount_val" ",amount_frac" " FROM wire_out" - " WHERE wireout_uuid>=$1 AND exchange_account_section=$2" + " JOIN wire_targets" + " USING (wire_target_serial_id)" + " WHERE " + " wireout_uuid>=$1 " + " AND exchange_account_section=$2" " ORDER BY wireout_uuid ASC;", 2), /* Used in #postgres_insert_recoup_request() to store recoup @@ -6934,22 +6945,19 @@ handle_wt_result (void *cls, { uint64_t rowid; struct TALER_PrivateContractHash h_contract_terms; - struct TALER_MerchantWireHash h_wire; struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_MerchantPublicKeyP merchant_pub; struct GNUNET_TIME_Absolute exec_time; struct TALER_Amount amount_with_fee; struct TALER_Amount deposit_fee; struct TALER_DenominationPublicKey denom_pub; - json_t *wire; + char *payto_uri; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_uint64 ("aggregation_serial_id", &rowid), 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_string ("payto_uri", + &payto_uri), TALER_PQ_result_spec_denom_pub ("denom_pub", &denom_pub), GNUNET_PQ_result_spec_auto_from_type ("coin_pub", @@ -6977,8 +6985,7 @@ handle_wt_result (void *cls, ctx->cb (ctx->cb_cls, rowid, &merchant_pub, - &h_wire, - wire, + payto_uri, exec_time, &h_contract_terms, &denom_pub, @@ -7070,13 +7077,18 @@ postgres_lookup_transfer_by_deposit ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (coin_pub), 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 }; + char *payto_uri; + struct TALER_WireSalt wire_salt; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_auto_from_type ("wtid_raw", wtid), + GNUNET_PQ_result_spec_auto_from_type ("wire_salt", + &wire_salt), + GNUNET_PQ_result_spec_string ("payto_uri", + &payto_uri), TALER_PQ_result_spec_absolute_time ("execution_date", exec_time), TALER_PQ_RESULT_SPEC_AMOUNT ("amount_with_fee", @@ -7093,13 +7105,24 @@ postgres_lookup_transfer_by_deposit ( rs); if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs) { - *pending = false; - memset (kyc, - 0, - sizeof (*kyc)); - kyc->type = TALER_EXCHANGEDB_KYC_DEPOSIT; - kyc->ok = true; - return qs; + struct TALER_MerchantWireHash wh; + + TALER_merchant_wire_signature_hash (payto_uri, + &wire_salt, + &wh); + GNUNET_PQ_cleanup_result (rs); + if (0 == + GNUNET_memcmp (&wh, + h_wire)) + { + *pending = false; + memset (kyc, + 0, + sizeof (*kyc)); + kyc->type = TALER_EXCHANGEDB_KYC_DEPOSIT; + kyc->ok = true; + return qs; + } } if (0 > qs) return qs; @@ -8653,7 +8676,7 @@ wire_out_serial_helper_cb (void *cls, uint64_t rowid; struct GNUNET_TIME_Absolute date; struct TALER_WireTransferIdentifierRawP wtid; - json_t *wire; + char *payto_uri; struct TALER_Amount amount; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_uint64 ("wireout_uuid", @@ -8662,8 +8685,8 @@ wire_out_serial_helper_cb (void *cls, &date), GNUNET_PQ_result_spec_auto_from_type ("wtid_raw", &wtid), - TALER_PQ_result_spec_json ("wire_target", - &wire), + GNUNET_PQ_result_spec_string ("payto_uri", + &payto_uri), TALER_PQ_RESULT_SPEC_AMOUNT ("amount", &amount), GNUNET_PQ_result_spec_end @@ -8683,7 +8706,7 @@ wire_out_serial_helper_cb (void *cls, rowid, date, &wtid, - wire, + payto_uri, &amount); GNUNET_PQ_cleanup_result (rs); if (GNUNET_OK != ret) @@ -9536,7 +9559,7 @@ missing_wire_cb (void *cls, uint64_t rowid; struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_Amount amount; - json_t *wire; + char *payto_uri; struct GNUNET_TIME_Absolute deadline; uint8_t tiny; uint8_t done; @@ -9547,8 +9570,8 @@ missing_wire_cb (void *cls, &coin_pub), TALER_PQ_RESULT_SPEC_AMOUNT ("amount_with_fee", &amount), - TALER_PQ_result_spec_json ("wire", - &wire), + GNUNET_PQ_result_spec_string ("payto_uri", + &payto_uri), TALER_PQ_result_spec_absolute_time ("wire_deadline", &deadline), GNUNET_PQ_result_spec_auto_from_type ("tiny", @@ -9571,7 +9594,7 @@ missing_wire_cb (void *cls, rowid, &coin_pub, &amount, - wire, + payto_uri, deadline, tiny, done); diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 56550d09..32e893d1 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -779,7 +779,8 @@ static uint64_t deposit_rowid; * @param amount_with_fee amount that was deposited including fee * @param deposit_fee amount the exchange gets to keep as transaction fees * @param h_contract_terms hash of the proposal data known to merchant and customer - * @param wire wire details for the merchant + * @param wire_target unique ID of the receiver account + * @param payto_uri how to pay the merchant, URI in payto://-format; * @return transaction status code, #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT to continue to iterate */ static enum GNUNET_DB_QueryStatus @@ -790,15 +791,12 @@ deposit_cb (void *cls, const struct TALER_Amount *amount_with_fee, const struct TALER_Amount *deposit_fee, const struct TALER_PrivateContractHash *h_contract_terms, - const json_t *wire) + uint64_t wire_target, + const char *payto_uri) { struct TALER_EXCHANGEDB_Deposit *deposit = cls; - struct TALER_MerchantWireHash h_wire; deposit_rowid = rowid; - GNUNET_assert (GNUNET_OK == - TALER_JSON_merchant_wire_signature_hash (wire, - &h_wire)); if ( (0 != GNUNET_memcmp (merchant_pub, &deposit->merchant_pub)) || (0 != TALER_amount_cmp (amount_with_fee, @@ -810,8 +808,8 @@ deposit_cb (void *cls, (0 != memcmp (coin_pub, &deposit->coin.coin_pub, sizeof (struct TALER_CoinSpendPublicKeyP))) || - (0 != GNUNET_memcmp (&h_wire, - &deposit->h_wire)) ) + (0 != strcmp (payto_uri, + deposit->receiver_wire_account)) ) { GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; @@ -869,36 +867,18 @@ matching_deposit_cb (void *cls, * @param cls closure * @param rowid unique serial ID for the deposit in our DB * @param exchange_timestamp when did the deposit happen - * @param wallet_timestamp when did the wallet sign the contract - * @param merchant_pub public key of the merchant + * @param deposit deposit details * @param denom_pub denomination of the @a coin_pub - * @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_contract_terms hash of the proposal data known to merchant and customer - * @param refund_deadline by which the merchant advised that he might want - * to get a refund - * @param wire_deadline by which the merchant advised that he would like the - * wire transfer to be executed - * @param receiver_wire_account wire details for the merchant, NULL from iterate_matching_deposits() * @param done flag set if the deposit was already executed (or not) * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop */ -static int +static enum GNUNET_GenericReturnValue audit_deposit_cb (void *cls, uint64_t rowid, struct GNUNET_TIME_Absolute exchange_timestamp, - struct GNUNET_TIME_Absolute wallet_timestamp, - const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct TALER_EXCHANGEDB_Deposit *deposit, const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const struct TALER_Amount *amount_with_fee, - const struct TALER_PrivateContractHash *h_contract_terms, - struct GNUNET_TIME_Absolute refund_deadline, - struct GNUNET_TIME_Absolute wire_deadline, - const json_t *receiver_wire_account, - int done) + bool done) { auditor_row_cnt++; return GNUNET_OK; @@ -1227,7 +1207,6 @@ test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit) /* setup values for wire transfer aggregation data */ merchant_pub_wt = deposit->merchant_pub; - h_wire_wt = deposit->h_wire; h_contract_terms_wt = deposit->h_contract_terms; coin_pub_wt = deposit->coin.coin_pub; @@ -1394,7 +1373,7 @@ drop: * @param rowid deposit table row of the coin's deposit * @param coin_pub public key of the coin * @param amount value of the deposit, including fee - * @param wire where should the funds be wired + * @param payto_uri where should the funds be wired * @param deadline what was the requested wire transfer deadline * @param tiny did the exchange defer this transfer because it is too small? * @param done did the exchange claim that it made a transfer? @@ -1404,7 +1383,7 @@ wire_missing_cb (void *cls, uint64_t rowid, const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_Amount *amount, - const json_t *wire, + const char *payto_uri, struct GNUNET_TIME_Absolute deadline, /* bool? */ int tiny, /* bool? */ int done) @@ -1413,14 +1392,6 @@ wire_missing_cb (void *cls, struct TALER_MerchantWireHash h_wire; (void) done; - if (NULL != wire) - GNUNET_assert (GNUNET_OK == - TALER_JSON_merchant_wire_signature_hash (wire, - &h_wire)); - else - memset (&h_wire, - 0, - sizeof (h_wire)); if (GNUNET_NO != tiny) { GNUNET_break (0); @@ -1443,8 +1414,8 @@ wire_missing_cb (void *cls, GNUNET_break (0); result = 66; } - if (0 != GNUNET_memcmp (&h_wire, - &deposit->h_wire)) + if (0 != strcmp (payto_uri, + &deposit->receiver_wire_account)) { GNUNET_break (0); result = 66; @@ -1868,7 +1839,6 @@ run (void *cls) FAILIF (1 != plugin->have_deposit (plugin->cls, &deposit, - GNUNET_YES, &deposit_fee, &r)); FAILIF (now.abs_value_us != r.abs_value_us); @@ -1966,7 +1936,6 @@ run (void *cls) FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != plugin->have_deposit (plugin->cls, &deposit2, - GNUNET_YES, &deposit_fee, &r)); deposit2.merchant_pub = deposit.merchant_pub; @@ -1974,7 +1943,6 @@ run (void *cls) FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != plugin->have_deposit (plugin->cls, &deposit2, - GNUNET_YES, &deposit_fee, &r)); } |
