diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-10-09 22:11:09 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-10-09 22:11:09 +0200 |
commit | 956e3c3065ddb762dbe01fd720cc5ef403232564 (patch) | |
tree | c96fca3c50cfb7b45cd4538a3c004a78ca888a9a /src/exchangedb/plugin_exchangedb_postgres.c | |
parent | 18d8dcd1f94ff5e5c314e14fc90c6faca7549ff9 (diff) |
WIP: policy handling advancements
- introduction of policy states.
- introduction of default state on timeout.
- introduction of TALER_PolicyFulfilmentOutcome
- parsing for policy_details now also provides default state on timeout.
- introduction of check_serial as preflight func before heavy operations
in policy post handler
- brandt auction now returns outcomes.
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index ebac70ea..415417cb 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -822,8 +822,8 @@ prepare_statements (struct PostgresClosure *pg) ",out_balance_ok AS balance_ok" ",out_conflict AS conflicted" " FROM exchange_do_deposit" - " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19);", - 19), + " ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20);", + 20), /* used in postgres_do_purse_deposit() */ GNUNET_PQ_make_prepare ( "call_purse_deposit", @@ -3933,10 +3933,11 @@ prepare_statements (struct PostgresClosure *pg) ",serial_id" ",policy_options" ",deadline" + ",timeout_fulfilment_state" ",fulfilment_state" ") VALUES " - "($1, $2, $3, $4, $5);", - 5), + "($1, $2, $3, $4, $5, $6);", + 6), GNUNET_PQ_make_prepare ( "insert_into_table_policy_fulfilments", "INSERT INTO policy_fulfilments" @@ -6292,6 +6293,9 @@ postgres_do_deposit ( (deposit->has_policy_details) ? GNUNET_PQ_query_param_timestamp (&deposit->policy_deadline) : GNUNET_PQ_query_param_null (), + (deposit->has_policy_details) + ? GNUNET_PQ_query_param_uint16 (&deposit->policy_state_on_timeout) + : GNUNET_PQ_query_param_null (), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -14651,6 +14655,7 @@ postgres_insert_records_by_table (void *cls, case TALER_EXCHANGEDB_RT_POLICY_DETAILS: rh = &irbt_cb_table_policy_details; break; + /* TODO: policy_details_fulfilments and policy_fulfilments */ case TALER_EXCHANGEDB_RT_PURSE_REQUESTS: rh = &irbt_cb_table_purse_requests; break; |