-start with DB cleanup
This commit is contained in:
parent
74ba46db39
commit
3e6e873367
@ -56,8 +56,6 @@ BEGIN
|
|||||||
'(wire_target_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
|
'(wire_target_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY' -- UNIQUE'
|
||||||
',wire_target_h_payto BYTEA PRIMARY KEY CHECK (LENGTH(wire_target_h_payto)=32)'
|
',wire_target_h_payto BYTEA PRIMARY KEY CHECK (LENGTH(wire_target_h_payto)=32)'
|
||||||
',payto_uri VARCHAR NOT NULL'
|
',payto_uri VARCHAR NOT NULL'
|
||||||
',kyc_ok BOOLEAN NOT NULL DEFAULT (FALSE)' -- FIXME: REMOVE!
|
|
||||||
',external_id VARCHAR' -- FIXME: REMOVE!
|
|
||||||
') %s ;'
|
') %s ;'
|
||||||
,'wire_targets'
|
,'wire_targets'
|
||||||
,'PARTITION BY HASH (wire_target_h_payto)'
|
,'PARTITION BY HASH (wire_target_h_payto)'
|
||||||
@ -165,10 +163,6 @@ BEGIN
|
|||||||
',current_balance_frac INT4 NOT NULL DEFAULT(0)'
|
',current_balance_frac INT4 NOT NULL DEFAULT(0)'
|
||||||
',purses_active INT8 NOT NULL DEFAULT(0)'
|
',purses_active INT8 NOT NULL DEFAULT(0)'
|
||||||
',purses_allowed INT8 NOT NULL DEFAULT(0)'
|
',purses_allowed INT8 NOT NULL DEFAULT(0)'
|
||||||
-- FIXME: remove:
|
|
||||||
',kyc_required BOOLEAN NOT NULL DEFAULT(FALSE)'
|
|
||||||
-- FIXME: remove:
|
|
||||||
',kyc_passed BOOLEAN NOT NULL DEFAULT(FALSE)'
|
|
||||||
',max_age INT4 NOT NULL DEFAULT(120)'
|
',max_age INT4 NOT NULL DEFAULT(120)'
|
||||||
',expiration_date INT8 NOT NULL'
|
',expiration_date INT8 NOT NULL'
|
||||||
',gc_date INT8 NOT NULL'
|
',gc_date INT8 NOT NULL'
|
||||||
|
@ -120,12 +120,6 @@ COMMENT ON COLUMN wire_targets.payto_uri
|
|||||||
IS 'Can be a regular bank account, or also be a URI identifying a reserve-account (for P2P payments)';
|
IS 'Can be a regular bank account, or also be a URI identifying a reserve-account (for P2P payments)';
|
||||||
COMMENT ON COLUMN wire_targets.wire_target_h_payto
|
COMMENT ON COLUMN wire_targets.wire_target_h_payto
|
||||||
IS 'Unsalted hash of payto_uri';
|
IS 'Unsalted hash of payto_uri';
|
||||||
-- FIXME: remove:
|
|
||||||
COMMENT ON COLUMN wire_targets.kyc_ok
|
|
||||||
IS 'true if the KYC check was passed successfully';
|
|
||||||
-- FIXME: remove:
|
|
||||||
COMMENT ON COLUMN wire_targets.external_id
|
|
||||||
IS 'Name of the user that was used for OAuth 2.0-based legitimization';
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS wire_targets_default
|
CREATE TABLE IF NOT EXISTS wire_targets_default
|
||||||
PARTITION OF wire_targets
|
PARTITION OF wire_targets
|
||||||
@ -175,10 +169,6 @@ COMMENT ON COLUMN reserves.purses_active
|
|||||||
IS 'Number of purses that were created by this reserve that are not expired and not fully paid.';
|
IS 'Number of purses that were created by this reserve that are not expired and not fully paid.';
|
||||||
COMMENT ON COLUMN reserves.purses_allowed
|
COMMENT ON COLUMN reserves.purses_allowed
|
||||||
IS 'Number of purses that this reserve is allowed to have active at most.';
|
IS 'Number of purses that this reserve is allowed to have active at most.';
|
||||||
COMMENT ON COLUMN reserves.kyc_required
|
|
||||||
IS 'True if a KYC check must have been passed before withdrawing from this reserve. Set to true once a reserve received a P2P payment.';
|
|
||||||
COMMENT ON COLUMN reserves.kyc_passed
|
|
||||||
IS 'True once KYC was passed for this reserve. The KYC details are then available via the wire_targets table under the key of wire_target_h_payto which is to be derived from the reserve_pub and the base URL of this exchange.';
|
|
||||||
COMMENT ON COLUMN reserves.expiration_date
|
COMMENT ON COLUMN reserves.expiration_date
|
||||||
IS 'Used to trigger closing of reserves that have not been drained after some time';
|
IS 'Used to trigger closing of reserves that have not been drained after some time';
|
||||||
COMMENT ON COLUMN reserves.gc_date
|
COMMENT ON COLUMN reserves.gc_date
|
||||||
|
@ -119,12 +119,6 @@ irbt_cb_table_wire_targets (struct PostgresClosure *pg,
|
|||||||
GNUNET_PQ_query_param_auto_from_type (&payto_hash),
|
GNUNET_PQ_query_param_auto_from_type (&payto_hash),
|
||||||
GNUNET_PQ_query_param_string (
|
GNUNET_PQ_query_param_string (
|
||||||
td->details.wire_targets.payto_uri),
|
td->details.wire_targets.payto_uri),
|
||||||
GNUNET_PQ_query_param_auto_from_type (
|
|
||||||
&td->details.wire_targets.kyc_ok),
|
|
||||||
NULL == td->details.wire_targets.external_id
|
|
||||||
? GNUNET_PQ_query_param_null ()
|
|
||||||
: GNUNET_PQ_query_param_string (
|
|
||||||
td->details.wire_targets.external_id),
|
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -175,18 +175,11 @@ lrbt_cb_table_wire_targets (void *cls,
|
|||||||
|
|
||||||
for (unsigned int i = 0; i<num_results; i++)
|
for (unsigned int i = 0; i<num_results; i++)
|
||||||
{
|
{
|
||||||
bool no_xid;
|
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||||
GNUNET_PQ_result_spec_uint64 ("serial",
|
GNUNET_PQ_result_spec_uint64 ("serial",
|
||||||
&td.serial),
|
&td.serial),
|
||||||
GNUNET_PQ_result_spec_string ("payto_uri",
|
GNUNET_PQ_result_spec_string ("payto_uri",
|
||||||
&td.details.wire_targets.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_allow_null (
|
|
||||||
GNUNET_PQ_result_spec_string ("external_id",
|
|
||||||
&td.details.wire_targets.external_id),
|
|
||||||
&no_xid),
|
|
||||||
GNUNET_PQ_result_spec_end
|
GNUNET_PQ_result_spec_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -580,14 +580,6 @@ prepare_statements (struct PostgresClosure *pg)
|
|||||||
" FROM reserves_in"
|
" FROM reserves_in"
|
||||||
" WHERE reserve_pub=$1",
|
" WHERE reserve_pub=$1",
|
||||||
1),
|
1),
|
||||||
/* Used in #postgres_set_kyc_ok() */
|
|
||||||
GNUNET_PQ_make_prepare (
|
|
||||||
"set_kyc_ok",
|
|
||||||
"UPDATE wire_targets"
|
|
||||||
" SET kyc_ok=TRUE"
|
|
||||||
",external_id=$2"
|
|
||||||
" WHERE wire_target_h_payto=$1",
|
|
||||||
2),
|
|
||||||
GNUNET_PQ_make_prepare (
|
GNUNET_PQ_make_prepare (
|
||||||
"get_kyc_h_payto",
|
"get_kyc_h_payto",
|
||||||
"SELECT"
|
"SELECT"
|
||||||
@ -611,7 +603,7 @@ prepare_statements (struct PostgresClosure *pg)
|
|||||||
" ) VALUES "
|
" ) VALUES "
|
||||||
" ($1, $2, $3, $4, $5, $6, $7, $8);",
|
" ($1, $2, $3, $4, $5, $6, $7, $8);",
|
||||||
8),
|
8),
|
||||||
/* Used in #postgres_inselect_wallet_kyc_status() */
|
/* Used in #setup_wire_target() */
|
||||||
GNUNET_PQ_make_prepare (
|
GNUNET_PQ_make_prepare (
|
||||||
"insert_kyc_status",
|
"insert_kyc_status",
|
||||||
"INSERT INTO wire_targets"
|
"INSERT INTO wire_targets"
|
||||||
@ -619,16 +611,8 @@ prepare_statements (struct PostgresClosure *pg)
|
|||||||
" ,payto_uri"
|
" ,payto_uri"
|
||||||
" ) VALUES "
|
" ) VALUES "
|
||||||
" ($1, $2)"
|
" ($1, $2)"
|
||||||
" RETURNING wire_target_serial_id",
|
" ON CONFLICT DO NOTHING",
|
||||||
2),
|
2),
|
||||||
GNUNET_PQ_make_prepare (
|
|
||||||
"select_kyc_status_by_payto",
|
|
||||||
"SELECT "
|
|
||||||
" kyc_ok"
|
|
||||||
",wire_target_serial_id"
|
|
||||||
" FROM wire_targets"
|
|
||||||
" WHERE wire_target_h_payto=$1;",
|
|
||||||
1),
|
|
||||||
/* Used in #postgres_drain_kyc_alert() */
|
/* Used in #postgres_drain_kyc_alert() */
|
||||||
GNUNET_PQ_make_prepare (
|
GNUNET_PQ_make_prepare (
|
||||||
"drain_kyc_alert",
|
"drain_kyc_alert",
|
||||||
@ -3254,8 +3238,6 @@ prepare_statements (struct PostgresClosure *pg)
|
|||||||
"SELECT"
|
"SELECT"
|
||||||
" wire_target_serial_id AS serial"
|
" wire_target_serial_id AS serial"
|
||||||
",payto_uri"
|
",payto_uri"
|
||||||
",kyc_ok"
|
|
||||||
",external_id"
|
|
||||||
" FROM wire_targets"
|
" FROM wire_targets"
|
||||||
" WHERE wire_target_serial_id > $1"
|
" WHERE wire_target_serial_id > $1"
|
||||||
" ORDER BY wire_target_serial_id ASC;",
|
" ORDER BY wire_target_serial_id ASC;",
|
||||||
@ -3773,11 +3755,9 @@ prepare_statements (struct PostgresClosure *pg)
|
|||||||
"(wire_target_serial_id"
|
"(wire_target_serial_id"
|
||||||
",wire_target_h_payto"
|
",wire_target_h_payto"
|
||||||
",payto_uri"
|
",payto_uri"
|
||||||
",kyc_ok"
|
|
||||||
",external_id"
|
|
||||||
") VALUES "
|
") VALUES "
|
||||||
"($1, $2, $3, $4, $5);",
|
"($1, $2, $3);",
|
||||||
5),
|
3),
|
||||||
GNUNET_PQ_make_prepare (
|
GNUNET_PQ_make_prepare (
|
||||||
"insert_into_table_reserves",
|
"insert_into_table_reserves",
|
||||||
"INSERT INTO reserves"
|
"INSERT INTO reserves"
|
||||||
@ -5762,59 +5742,6 @@ postgres_reserves_get_origin (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the KYC status to "OK" for a bank account.
|
|
||||||
*
|
|
||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
|
||||||
* @param h_payto which account has been checked
|
|
||||||
* @param id external ID to persist
|
|
||||||
* @return transaction status
|
|
||||||
*/
|
|
||||||
static enum GNUNET_DB_QueryStatus
|
|
||||||
postgres_set_kyc_ok (void *cls,
|
|
||||||
const struct TALER_PaytoHashP *h_payto,
|
|
||||||
const char *id)
|
|
||||||
{
|
|
||||||
struct PostgresClosure *pg = cls;
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (h_payto),
|
|
||||||
GNUNET_PQ_query_param_end
|
|
||||||
};
|
|
||||||
struct GNUNET_PQ_QueryParam params2[] = {
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (h_payto),
|
|
||||||
GNUNET_PQ_query_param_string (id),
|
|
||||||
GNUNET_PQ_query_param_end
|
|
||||||
};
|
|
||||||
struct TALER_KycCompletedEventP rep = {
|
|
||||||
.header.size = htons (sizeof (rep)),
|
|
||||||
.header.type = htons (TALER_DBEVENT_EXCHANGE_KYC_COMPLETED)
|
|
||||||
};
|
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
|
||||||
GNUNET_PQ_result_spec_auto_from_type ("wire_target_h_payto",
|
|
||||||
&rep.h_payto),
|
|
||||||
GNUNET_PQ_result_spec_end
|
|
||||||
};
|
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
|
||||||
|
|
||||||
qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
|
||||||
"set_kyc_ok",
|
|
||||||
params2);
|
|
||||||
if (qs <= 0)
|
|
||||||
return qs;
|
|
||||||
qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
|
|
||||||
"get_kyc_h_payto",
|
|
||||||
params,
|
|
||||||
rs);
|
|
||||||
if (qs <= 0)
|
|
||||||
return qs;
|
|
||||||
postgres_event_notify (pg,
|
|
||||||
&rep.header,
|
|
||||||
NULL,
|
|
||||||
0);
|
|
||||||
return qs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract next KYC alert. Deletes the alert.
|
* Extract next KYC alert. Deletes the alert.
|
||||||
*
|
*
|
||||||
@ -5846,73 +5773,6 @@ postgres_drain_kyc_alert (void *cls,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Compute the hash of the @a payto_uri and use it to get the KYC status for a
|
|
||||||
* wallet. If the status is unknown, inserts a new status record (hence
|
|
||||||
* INsertSELECT).
|
|
||||||
*
|
|
||||||
* @param pg the plugin-specific state
|
|
||||||
* @param payto_uri the payto URI to check
|
|
||||||
* @param[out] h_payto set to the hash of @a payto_uri
|
|
||||||
* @param[out] kyc set to the KYC status of the wallet
|
|
||||||
* @return transaction status
|
|
||||||
*/
|
|
||||||
static enum GNUNET_DB_QueryStatus
|
|
||||||
inselect_account_kyc_status (
|
|
||||||
struct PostgresClosure *pg,
|
|
||||||
const char *payto_uri,
|
|
||||||
struct TALER_PaytoHashP *h_payto,
|
|
||||||
struct TALER_EXCHANGEDB_KycStatus *kyc)
|
|
||||||
{
|
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
|
||||||
|
|
||||||
TALER_payto_hash (payto_uri,
|
|
||||||
h_payto);
|
|
||||||
{
|
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (h_payto),
|
|
||||||
GNUNET_PQ_query_param_end
|
|
||||||
};
|
|
||||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("wire_target_serial_id",
|
|
||||||
&kyc->payment_target_uuid),
|
|
||||||
GNUNET_PQ_result_spec_bool ("kyc_ok",
|
|
||||||
&kyc->ok),
|
|
||||||
GNUNET_PQ_result_spec_end
|
|
||||||
};
|
|
||||||
|
|
||||||
qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
|
|
||||||
"select_kyc_status_by_payto",
|
|
||||||
params,
|
|
||||||
rs);
|
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
|
|
||||||
{
|
|
||||||
struct GNUNET_PQ_QueryParam iparams[] = {
|
|
||||||
GNUNET_PQ_query_param_auto_from_type (h_payto),
|
|
||||||
GNUNET_PQ_query_param_string (payto_uri),
|
|
||||||
GNUNET_PQ_query_param_end
|
|
||||||
};
|
|
||||||
struct GNUNET_PQ_ResultSpec irs[] = {
|
|
||||||
GNUNET_PQ_result_spec_uint64 ("wire_target_serial_id",
|
|
||||||
&kyc->payment_target_uuid),
|
|
||||||
GNUNET_PQ_result_spec_end
|
|
||||||
};
|
|
||||||
|
|
||||||
qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
|
|
||||||
"insert_kyc_status",
|
|
||||||
iparams,
|
|
||||||
irs);
|
|
||||||
if (qs < 0)
|
|
||||||
return qs;
|
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs)
|
|
||||||
return GNUNET_DB_STATUS_SOFT_ERROR;
|
|
||||||
kyc->ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return qs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a reserve with the data from the given reserve structure.
|
* Updates a reserve with the data from the given reserve structure.
|
||||||
*
|
*
|
||||||
@ -5940,6 +5800,34 @@ reserves_update (void *cls,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup new wire target for @a payto_uri.
|
||||||
|
*
|
||||||
|
* @param pg the plugin-specific state
|
||||||
|
* @param payto_uri the payto URI to check
|
||||||
|
* @param[out] h_payto set to the hash of @a payto_uri
|
||||||
|
* @return transaction status
|
||||||
|
*/
|
||||||
|
static enum GNUNET_DB_QueryStatus
|
||||||
|
setup_wire_target (
|
||||||
|
struct PostgresClosure *pg,
|
||||||
|
const char *payto_uri,
|
||||||
|
struct TALER_PaytoHashP *h_payto)
|
||||||
|
{
|
||||||
|
struct GNUNET_PQ_QueryParam iparams[] = {
|
||||||
|
GNUNET_PQ_query_param_auto_from_type (h_payto),
|
||||||
|
GNUNET_PQ_query_param_string (payto_uri),
|
||||||
|
GNUNET_PQ_query_param_end
|
||||||
|
};
|
||||||
|
|
||||||
|
TALER_payto_hash (payto_uri,
|
||||||
|
h_payto);
|
||||||
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
|
"insert_kyc_status",
|
||||||
|
iparams);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate event notification for the reserve
|
* Generate event notification for the reserve
|
||||||
* change.
|
* change.
|
||||||
@ -6043,23 +5931,14 @@ postgres_reserves_in_insert (void *cls,
|
|||||||
is again used to guard against duplicates. */
|
is again used to guard against duplicates. */
|
||||||
{
|
{
|
||||||
enum GNUNET_DB_QueryStatus qs2;
|
enum GNUNET_DB_QueryStatus qs2;
|
||||||
struct TALER_EXCHANGEDB_KycStatus kyc;
|
|
||||||
enum GNUNET_DB_QueryStatus qs3;
|
enum GNUNET_DB_QueryStatus qs3;
|
||||||
struct TALER_PaytoHashP h_payto;
|
struct TALER_PaytoHashP h_payto;
|
||||||
|
|
||||||
memset (&kyc,
|
qs3 = setup_wire_target (pg,
|
||||||
0,
|
|
||||||
sizeof (kyc));
|
|
||||||
qs3 = inselect_account_kyc_status (pg,
|
|
||||||
sender_account_details,
|
sender_account_details,
|
||||||
&h_payto,
|
&h_payto);
|
||||||
&kyc);
|
if (qs3 < 0)
|
||||||
if (qs3 <= 0)
|
|
||||||
{
|
|
||||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs3);
|
|
||||||
return qs3;
|
return qs3;
|
||||||
}
|
|
||||||
GNUNET_assert (0 != kyc.payment_target_uuid);
|
|
||||||
/* We do not have the UUID, so insert by public key */
|
/* We do not have the UUID, so insert by public key */
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (&reserve.pub),
|
GNUNET_PQ_query_param_auto_from_type (&reserve.pub),
|
||||||
@ -8215,19 +8094,14 @@ postgres_insert_deposit (void *cls,
|
|||||||
const struct TALER_EXCHANGEDB_Deposit *deposit)
|
const struct TALER_EXCHANGEDB_Deposit *deposit)
|
||||||
{
|
{
|
||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
struct TALER_EXCHANGEDB_KycStatus kyc;
|
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
|
||||||
struct TALER_PaytoHashP h_payto;
|
struct TALER_PaytoHashP h_payto;
|
||||||
|
enum GNUNET_DB_QueryStatus qs;
|
||||||
|
|
||||||
qs = inselect_account_kyc_status (pg,
|
qs = setup_wire_target (pg,
|
||||||
deposit->receiver_wire_account,
|
deposit->receiver_wire_account,
|
||||||
&h_payto,
|
&h_payto);
|
||||||
&kyc);
|
if (qs < 0)
|
||||||
if (qs <= 0)
|
|
||||||
{
|
|
||||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
|
||||||
return qs;
|
return qs;
|
||||||
}
|
|
||||||
if (GNUNET_TIME_timestamp_cmp (deposit->wire_deadline,
|
if (GNUNET_TIME_timestamp_cmp (deposit->wire_deadline,
|
||||||
<,
|
<,
|
||||||
deposit->refund_deadline))
|
deposit->refund_deadline))
|
||||||
@ -10447,20 +10321,11 @@ postgres_insert_reserve_closed (
|
|||||||
{
|
{
|
||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
struct TALER_EXCHANGEDB_Reserve reserve;
|
struct TALER_EXCHANGEDB_Reserve reserve;
|
||||||
struct TALER_EXCHANGEDB_KycStatus kyc;
|
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
enum GNUNET_DB_QueryStatus qs;
|
||||||
struct TALER_PaytoHashP h_payto;
|
struct TALER_PaytoHashP h_payto;
|
||||||
|
|
||||||
qs = inselect_account_kyc_status (pg,
|
TALER_payto_hash (receiver_account,
|
||||||
receiver_account,
|
&h_payto);
|
||||||
&h_payto,
|
|
||||||
&kyc);
|
|
||||||
if (qs <= 0)
|
|
||||||
{
|
|
||||||
GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
|
|
||||||
GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs);
|
|
||||||
return qs;
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
GNUNET_PQ_query_param_auto_from_type (reserve_pub),
|
||||||
@ -17348,7 +17213,6 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
|
|||||||
&postgres_iterate_auditor_denominations;
|
&postgres_iterate_auditor_denominations;
|
||||||
plugin->reserves_get = &postgres_reserves_get;
|
plugin->reserves_get = &postgres_reserves_get;
|
||||||
plugin->reserves_get_origin = &postgres_reserves_get_origin;
|
plugin->reserves_get_origin = &postgres_reserves_get_origin;
|
||||||
plugin->set_kyc_ok = &postgres_set_kyc_ok;
|
|
||||||
plugin->drain_kyc_alert = &postgres_drain_kyc_alert;
|
plugin->drain_kyc_alert = &postgres_drain_kyc_alert;
|
||||||
plugin->reserves_in_insert = &postgres_reserves_in_insert;
|
plugin->reserves_in_insert = &postgres_reserves_in_insert;
|
||||||
plugin->get_withdraw_info = &postgres_get_withdraw_info;
|
plugin->get_withdraw_info = &postgres_get_withdraw_info;
|
||||||
|
@ -318,7 +318,6 @@ create_denom_key_pair (unsigned int size,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset (&issue2, 0, sizeof (issue2));
|
memset (&issue2, 0, sizeof (issue2));
|
||||||
plugin->commit (plugin->cls);
|
|
||||||
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->get_denomination_info (plugin->cls,
|
plugin->get_denomination_info (plugin->cls,
|
||||||
&dki.issue.denom_hash,
|
&dki.issue.denom_hash,
|
||||||
@ -1302,6 +1301,7 @@ run (void *cls)
|
|||||||
sndr,
|
sndr,
|
||||||
"exchange-account-1",
|
"exchange-account-1",
|
||||||
4));
|
4));
|
||||||
|
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
check_reserve (&reserve_pub,
|
check_reserve (&reserve_pub,
|
||||||
value.value,
|
value.value,
|
||||||
@ -1406,6 +1406,8 @@ run (void *cls)
|
|||||||
GNUNET_assert (nonce_ok);
|
GNUNET_assert (nonce_ok);
|
||||||
GNUNET_assert (balance_ok);
|
GNUNET_assert (balance_ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
check_reserve (&reserve_pub,
|
check_reserve (&reserve_pub,
|
||||||
0,
|
0,
|
||||||
@ -1909,6 +1911,7 @@ run (void *cls)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GNUNET_assert (4 == cnt);
|
||||||
FAILIF (4 != cnt);
|
FAILIF (4 != cnt);
|
||||||
|
|
||||||
auditor_row_cnt = 0;
|
auditor_row_cnt = 0;
|
||||||
@ -2290,6 +2293,9 @@ run (void *cls)
|
|||||||
|
|
||||||
|
|
||||||
/* test revocation */
|
/* test revocation */
|
||||||
|
FAILIF (GNUNET_OK !=
|
||||||
|
plugin->start (plugin->cls,
|
||||||
|
"test-3b"));
|
||||||
RND_BLK (&master_sig);
|
RND_BLK (&master_sig);
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->insert_denomination_revocation (plugin->cls,
|
plugin->insert_denomination_revocation (plugin->cls,
|
||||||
|
@ -279,8 +279,6 @@ struct TALER_EXCHANGEDB_TableData
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
char *payto_uri;
|
char *payto_uri;
|
||||||
bool kyc_ok;
|
|
||||||
char *external_id;
|
|
||||||
} wire_targets;
|
} wire_targets;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
@ -3082,20 +3080,6 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
struct TALER_PaytoHashP *h_payto);
|
struct TALER_PaytoHashP *h_payto);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the KYC status to "OK" for a bank account.
|
|
||||||
*
|
|
||||||
* @param cls the @e cls of this struct with the plugin-specific state
|
|
||||||
* @param h_payto which account has been checked
|
|
||||||
* @param id ID data to persist
|
|
||||||
* @return transaction status
|
|
||||||
*/
|
|
||||||
enum GNUNET_DB_QueryStatus
|
|
||||||
(*set_kyc_ok)(void *cls,
|
|
||||||
const struct TALER_PaytoHashP *h_payto,
|
|
||||||
const char *id);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract next KYC alert. Deletes the alert.
|
* Extract next KYC alert. Deletes the alert.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user