-add missing SQL logic
This commit is contained in:
parent
a9bea142cb
commit
ea11a9a0fd
@ -217,6 +217,17 @@ irbt_cb_table_legitimization_processes (struct PostgresClosure *pg,
|
|||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PREPARE (pg,
|
||||||
|
"insert_into_table_legitimization_processes",
|
||||||
|
"INSERT INTO legitimization_processes"
|
||||||
|
"(legitimization_process_serial_id"
|
||||||
|
",h_payto"
|
||||||
|
",expiration_time"
|
||||||
|
",provider_section"
|
||||||
|
",provider_user_id"
|
||||||
|
",provider_legitimization_id"
|
||||||
|
") VALUES "
|
||||||
|
"($1, $2, $3, $4, $5, $6);");
|
||||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
"insert_into_table_legitimization_processes",
|
"insert_into_table_legitimization_processes",
|
||||||
params);
|
params);
|
||||||
@ -243,6 +254,14 @@ irbt_cb_table_legitimization_requirements (struct PostgresClosure *pg,
|
|||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PREPARE (pg,
|
||||||
|
"insert_into_table_legitimization_requirements",
|
||||||
|
"INSERT INTO legitimization_requirements"
|
||||||
|
"(legitimization_requirement_serial_id"
|
||||||
|
",h_payto"
|
||||||
|
",required_checks"
|
||||||
|
") VALUES "
|
||||||
|
"($1, $2, $3);");
|
||||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
"insert_into_table_legitimization_requirements",
|
"insert_into_table_legitimization_requirements",
|
||||||
params);
|
params);
|
||||||
@ -351,6 +370,19 @@ irbt_cb_table_reserves_open_requests (struct PostgresClosure *pg,
|
|||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PREPARE (pg,
|
||||||
|
"insert_into_table_reserves_open_requests",
|
||||||
|
"INSERT INTO reserves_open_requests"
|
||||||
|
"(open_request_uuid"
|
||||||
|
",reserve_pub"
|
||||||
|
",request_timestamp"
|
||||||
|
",expiration_date"
|
||||||
|
",reserve_sig"
|
||||||
|
",reserve_payment_val"
|
||||||
|
",reserve_payment_frac"
|
||||||
|
",requested_purse_limit"
|
||||||
|
") VALUES "
|
||||||
|
"($1, $2, $3, $4, $5, $6, $7, $8);");
|
||||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
"insert_into_table_reserves_open_requests",
|
"insert_into_table_reserves_open_requests",
|
||||||
params);
|
params);
|
||||||
@ -364,9 +396,9 @@ irbt_cb_table_reserves_open_requests (struct PostgresClosure *pg,
|
|||||||
* @param td record to insert
|
* @param td record to insert
|
||||||
*/
|
*/
|
||||||
static enum GNUNET_DB_QueryStatus
|
static enum GNUNET_DB_QueryStatus
|
||||||
irbt_cb_table_reserves_open_deposits (struct PostgresClosure *pg,
|
irbt_cb_table_reserves_open_deposits (
|
||||||
const struct
|
struct PostgresClosure *pg,
|
||||||
TALER_EXCHANGEDB_TableData *td)
|
const struct TALER_EXCHANGEDB_TableData *td)
|
||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_uint64 (&td->serial),
|
GNUNET_PQ_query_param_uint64 (&td->serial),
|
||||||
@ -383,6 +415,19 @@ irbt_cb_table_reserves_open_deposits (struct PostgresClosure *pg,
|
|||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PREPARE (pg,
|
||||||
|
"insert_into_table_reserves_open_deposits",
|
||||||
|
"INSERT INTO reserves_open_deposits"
|
||||||
|
"(reserve_open_deposit_uuid"
|
||||||
|
",reserve_sig"
|
||||||
|
",reserve_pub"
|
||||||
|
",request_timestamp"
|
||||||
|
",coin_pub"
|
||||||
|
",coin_sig"
|
||||||
|
",contribution_val"
|
||||||
|
",contribution_frac"
|
||||||
|
") VALUES "
|
||||||
|
"($1, $2, $3, $4, $5, $6, $7, $8);");
|
||||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
"insert_into_table_reserves_open_deposits",
|
"insert_into_table_reserves_open_deposits",
|
||||||
params);
|
params);
|
||||||
@ -396,9 +441,9 @@ irbt_cb_table_reserves_open_deposits (struct PostgresClosure *pg,
|
|||||||
* @param td record to insert
|
* @param td record to insert
|
||||||
*/
|
*/
|
||||||
static enum GNUNET_DB_QueryStatus
|
static enum GNUNET_DB_QueryStatus
|
||||||
irbt_cb_table_reserves_close_requests (struct PostgresClosure *pg,
|
irbt_cb_table_reserves_close_requests (
|
||||||
const struct
|
struct PostgresClosure *pg,
|
||||||
TALER_EXCHANGEDB_TableData *td)
|
const struct TALER_EXCHANGEDB_TableData *td)
|
||||||
{
|
{
|
||||||
struct GNUNET_PQ_QueryParam params[] = {
|
struct GNUNET_PQ_QueryParam params[] = {
|
||||||
GNUNET_PQ_query_param_uint64 (&td->serial),
|
GNUNET_PQ_query_param_uint64 (&td->serial),
|
||||||
@ -413,6 +458,16 @@ irbt_cb_table_reserves_close_requests (struct PostgresClosure *pg,
|
|||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PREPARE (pg,
|
||||||
|
"insert_into_table_reserves_close_requests",
|
||||||
|
"INSERT INTO reserves_close_requests"
|
||||||
|
"(close_request_uuid"
|
||||||
|
",reserve_pub"
|
||||||
|
",execution_date"
|
||||||
|
",reserve_sig"
|
||||||
|
",wire_target_h_payto"
|
||||||
|
") VALUES "
|
||||||
|
"($1, $2, $3, $4, $5);");
|
||||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
"insert_into_table_reserves_close_requests",
|
"insert_into_table_reserves_close_requests",
|
||||||
params);
|
params);
|
||||||
@ -959,7 +1014,18 @@ irbt_cb_table_wire_out (struct PostgresClosure *pg,
|
|||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PREPARE (pg,
|
||||||
|
"insert_into_table_wire_out",
|
||||||
|
"INSERT INTO wire_out"
|
||||||
|
"(wireout_uuid"
|
||||||
|
",execution_date"
|
||||||
|
",wtid_raw"
|
||||||
|
",wire_target_h_payto"
|
||||||
|
",exchange_account_section"
|
||||||
|
",amount_val"
|
||||||
|
",amount_frac"
|
||||||
|
") VALUES "
|
||||||
|
"($1, $2, $3, $4, $5, $6, $7);");
|
||||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
"insert_into_table_wire_out",
|
"insert_into_table_wire_out",
|
||||||
params);
|
params);
|
||||||
@ -1440,11 +1506,23 @@ irbt_cb_table_account_mergers (struct PostgresClosure *pg,
|
|||||||
&td->details.account_merges.reserve_sig),
|
&td->details.account_merges.reserve_sig),
|
||||||
GNUNET_PQ_query_param_auto_from_type (
|
GNUNET_PQ_query_param_auto_from_type (
|
||||||
&td->details.account_merges.purse_pub),
|
&td->details.account_merges.purse_pub),
|
||||||
|
GNUNET_PQ_query_param_auto_from_type (
|
||||||
|
&td->details.account_merges.wallet_h_payto),
|
||||||
GNUNET_PQ_query_param_end
|
GNUNET_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PREPARE (pg,
|
||||||
|
"insert_into_table_account_merges",
|
||||||
|
"INSERT INTO account_merges"
|
||||||
|
"(account_merge_request_serial_id"
|
||||||
|
",reserve_pub"
|
||||||
|
",reserve_sig"
|
||||||
|
",purse_pub"
|
||||||
|
",wallet_h_payto"
|
||||||
|
") VALUES "
|
||||||
|
"($1, $2, $3, $4, $5);");
|
||||||
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
|
||||||
"insert_into_table_account_mergers",
|
"insert_into_table_account_merges",
|
||||||
params);
|
params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1789,6 +1867,12 @@ TEH_PG_insert_records_by_table (void *cls,
|
|||||||
case TALER_EXCHANGEDB_RT_WIRE_TARGETS:
|
case TALER_EXCHANGEDB_RT_WIRE_TARGETS:
|
||||||
rh = &irbt_cb_table_wire_targets;
|
rh = &irbt_cb_table_wire_targets;
|
||||||
break;
|
break;
|
||||||
|
case TALER_EXCHANGEDB_RT_LEGITIMIZATION_PROCESSES:
|
||||||
|
rh = &irbt_cb_table_legitimization_processes;
|
||||||
|
break;
|
||||||
|
case TALER_EXCHANGEDB_RT_LEGITIMIZATION_REQUIREMENTS:
|
||||||
|
rh = &irbt_cb_table_legitimization_requirements;
|
||||||
|
break;
|
||||||
case TALER_EXCHANGEDB_RT_RESERVES:
|
case TALER_EXCHANGEDB_RT_RESERVES:
|
||||||
rh = &irbt_cb_table_reserves;
|
rh = &irbt_cb_table_reserves;
|
||||||
break;
|
break;
|
||||||
@ -1798,6 +1882,15 @@ TEH_PG_insert_records_by_table (void *cls,
|
|||||||
case TALER_EXCHANGEDB_RT_RESERVES_CLOSE:
|
case TALER_EXCHANGEDB_RT_RESERVES_CLOSE:
|
||||||
rh = &irbt_cb_table_reserves_close;
|
rh = &irbt_cb_table_reserves_close;
|
||||||
break;
|
break;
|
||||||
|
case TALER_EXCHANGEDB_RT_RESERVES_OPEN_REQUESTS:
|
||||||
|
rh = &irbt_cb_table_reserves_open_requests;
|
||||||
|
break;
|
||||||
|
case TALER_EXCHANGEDB_RT_RESERVES_OPEN_DEPOSITS:
|
||||||
|
rh = &irbt_cb_table_reserves_open_deposits;
|
||||||
|
break;
|
||||||
|
case TALER_EXCHANGEDB_RT_RESERVES_CLOSE_REQUESTS:
|
||||||
|
rh = &irbt_cb_table_reserves_close_requests;
|
||||||
|
break;
|
||||||
case TALER_EXCHANGEDB_RT_RESERVES_OUT:
|
case TALER_EXCHANGEDB_RT_RESERVES_OUT:
|
||||||
rh = &irbt_cb_table_reserves_out;
|
rh = &irbt_cb_table_reserves_out;
|
||||||
break;
|
break;
|
||||||
|
@ -1766,6 +1766,9 @@ lrbt_cb_table_account_merges (void *cls,
|
|||||||
GNUNET_PQ_result_spec_auto_from_type (
|
GNUNET_PQ_result_spec_auto_from_type (
|
||||||
"purse_pub",
|
"purse_pub",
|
||||||
&td.details.account_merges.purse_pub),
|
&td.details.account_merges.purse_pub),
|
||||||
|
GNUNET_PQ_result_spec_auto_from_type (
|
||||||
|
"wallet_h_payto",
|
||||||
|
&td.details.account_merges.wallet_h_payto),
|
||||||
GNUNET_PQ_result_spec_end
|
GNUNET_PQ_result_spec_end
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2673,6 +2676,7 @@ TEH_PG_lookup_records_by_table (void *cls,
|
|||||||
",reserve_pub"
|
",reserve_pub"
|
||||||
",reserve_sig"
|
",reserve_sig"
|
||||||
",purse_pub"
|
",purse_pub"
|
||||||
|
",wallet_h_payto"
|
||||||
" FROM account_merges"
|
" FROM account_merges"
|
||||||
" WHERE account_merge_request_serial_id > $1"
|
" WHERE account_merge_request_serial_id > $1"
|
||||||
" ORDER BY account_merge_request_serial_id ASC;");
|
" ORDER BY account_merge_request_serial_id ASC;");
|
||||||
@ -2822,4 +2826,4 @@ TEH_PG_lookup_records_by_table (void *cls,
|
|||||||
|
|
||||||
#undef XPREPARE
|
#undef XPREPARE
|
||||||
|
|
||||||
/* end of lrbt_callbacks.c */
|
/* end of pg_lookup_records_by_table.c */
|
||||||
|
@ -2036,19 +2036,6 @@ prepare_statements (struct PostgresClosure *pg)
|
|||||||
") VALUES "
|
") VALUES "
|
||||||
"($1, $2, $3, $4, $5, $6);",
|
"($1, $2, $3, $4, $5, $6);",
|
||||||
6),
|
6),
|
||||||
GNUNET_PQ_make_prepare (
|
|
||||||
"insert_into_table_wire_out",
|
|
||||||
"INSERT INTO wire_out"
|
|
||||||
"(wireout_uuid"
|
|
||||||
",execution_date"
|
|
||||||
",wtid_raw"
|
|
||||||
",wire_target_h_payto"
|
|
||||||
",exchange_account_section"
|
|
||||||
",amount_val"
|
|
||||||
",amount_frac"
|
|
||||||
") VALUES "
|
|
||||||
"($1, $2, $3, $4, $5, $6, $7);",
|
|
||||||
7),
|
|
||||||
/* Used in #postgres_wire_prepare_data_insert() to store
|
/* Used in #postgres_wire_prepare_data_insert() to store
|
||||||
wire transfer information before actually committing it with the bank */
|
wire transfer information before actually committing it with the bank */
|
||||||
GNUNET_PQ_make_prepare (
|
GNUNET_PQ_make_prepare (
|
||||||
|
@ -571,6 +571,7 @@ struct TALER_EXCHANGEDB_TableData
|
|||||||
struct TALER_ReservePublicKeyP reserve_pub;
|
struct TALER_ReservePublicKeyP reserve_pub;
|
||||||
struct TALER_ReserveSignatureP reserve_sig;
|
struct TALER_ReserveSignatureP reserve_sig;
|
||||||
struct TALER_PurseContractPublicKeyP purse_pub;
|
struct TALER_PurseContractPublicKeyP purse_pub;
|
||||||
|
struct TALER_PaytoHashP wallet_h_payto;
|
||||||
} account_merges;
|
} account_merges;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
Loading…
Reference in New Issue
Block a user