diff options
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 62 | ||||
-rw-r--r-- | src/exchangedb/test_exchangedb.c | 58 |
2 files changed, 60 insertions, 60 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 04455808..3b06ed40 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -3922,7 +3922,7 @@ prepare_statements (struct PostgresClosure *pg) "INSERT INTO extensions" "(extension_id" ",name" - ",config" + ",manifest" ") VALUES " "($1, $2, $3);", 3), @@ -4206,18 +4206,18 @@ prepare_statements (struct PostgresClosure *pg) " AND start_row=$2" " AND end_row=$3", 3), - /* Used in #postgres_set_extension_config */ + /* Used in #postgres_set_extension_manifest */ GNUNET_PQ_make_prepare ( - "set_extension_config", - "INSERT INTO extensions (name, config) VALUES ($1, $2) " + "set_extension_manifest", + "INSERT INTO extensions (name, manifest) VALUES ($1, $2) " "ON CONFLICT (name) " - "DO UPDATE SET config=$2", + "DO UPDATE SET manifest=$2", 2), - /* Used in #postgres_get_extension_config */ + /* Used in #postgres_get_extension_manifest */ GNUNET_PQ_make_prepare ( - "get_extension_config", + "get_extension_manifest", "SELECT " - " config " + " manifest " "FROM extensions" " WHERE name=$1;", 1), @@ -15199,25 +15199,25 @@ postgres_delete_shard_locks (void *cls) /** - * Function called to save the configuration of an extension - * (age-restriction, peer2peer, ...). After successful storage of the - * configuration it triggers the corresponding event. + * Function called to save the manifest of an extension + * (age_restriction, poliy_merchant_refund, ...). After successful storage of + * the manifest it triggers the corresponding event. * * @param cls the @e cls of this struct with the plugin-specific state * @param extension_name the name of the extension - * @param config JSON object of the configuration as string + * @param manifest JSON object of the manifest as string * @return transaction status code */ enum GNUNET_DB_QueryStatus -postgres_set_extension_config (void *cls, - const char *extension_name, - const char *config) +postgres_set_extension_manifest (void *cls, + const char *extension_name, + const char *manifest) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam pcfg = - (NULL == config || 0 == *config) + (NULL == manifest || 0 == *manifest) ? GNUNET_PQ_query_param_null () - : GNUNET_PQ_query_param_string (config); + : GNUNET_PQ_query_param_string (manifest); struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_string (extension_name), pcfg, @@ -15225,24 +15225,24 @@ postgres_set_extension_config (void *cls, }; return GNUNET_PQ_eval_prepared_non_select (pg->conn, - "set_extension_config", + "set_extension_manifest", params); } /** - * Function called to get the configuration of an extension - * (age-restriction, peer2peer, ...) + * Function called to get the manifest of an extension + * (age_restriction, policy_merchant_refund, ...) * * @param cls the @e cls of this struct with the plugin-specific state * @param extension_name the name of the extension - * @param[out] config JSON object of the configuration as string + * @param[out] manifest Manifest of the extension encoded as JSON object * @return transaction status code */ enum GNUNET_DB_QueryStatus -postgres_get_extension_config (void *cls, +postgres_get_extension_manifest (void *cls, const char *extension_name, - char **config) + char **manifest) { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { @@ -15252,15 +15252,15 @@ postgres_get_extension_config (void *cls, bool is_null; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_string ("config", - config), + GNUNET_PQ_result_spec_string ("manifest", + manifest), &is_null), GNUNET_PQ_result_spec_end }; - *config = NULL; + *manifest = NULL; return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, - "get_extension_config", + "get_extension_manifest", params, rs); } @@ -17231,10 +17231,10 @@ libtaler_plugin_exchangedb_postgres_init (void *cls) = &postgres_release_revolving_shard; plugin->delete_shard_locks = &postgres_delete_shard_locks; - plugin->set_extension_config - = &postgres_set_extension_config; - plugin->get_extension_config - = &postgres_get_extension_config; + plugin->set_extension_manifest + = &postgres_set_extension_manifest; + plugin->get_extension_manifest + = &postgres_get_extension_manifest; plugin->insert_partner = &postgres_insert_partner; plugin->insert_contract diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 1d14c7d5..5508e0ae 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -112,53 +112,53 @@ mark_prepare_cb (void *cls, * Simple check that config retrieval and setting for extensions work */ static enum GNUNET_GenericReturnValue -test_extension_config (void) +test_extension_manifest (void) { - char *config; + char *manifest; FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != - plugin->get_extension_config (plugin->cls, - "fnord", - &config)); + plugin->get_extension_manifest (plugin->cls, + "fnord", + &manifest)); FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - plugin->set_extension_config (plugin->cls, - "fnord", - "bar")); + plugin->set_extension_manifest (plugin->cls, + "fnord", + "bar")); FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - plugin->get_extension_config (plugin->cls, - "fnord", - &config)); + plugin->get_extension_manifest (plugin->cls, + "fnord", + &manifest)); - FAILIF (0 != strcmp ("bar", config)); - GNUNET_free (config); + FAILIF (0 != strcmp ("bar", manifest)); + GNUNET_free (manifest); /* let's do this again! */ FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - plugin->set_extension_config (plugin->cls, - "fnord", - "buzz")); + plugin->set_extension_manifest (plugin->cls, + "fnord", + "buzz")); FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - plugin->get_extension_config (plugin->cls, - "fnord", - &config)); + plugin->get_extension_manifest (plugin->cls, + "fnord", + &manifest)); - FAILIF (0 != strcmp ("buzz", config)); - GNUNET_free (config); + FAILIF (0 != strcmp ("buzz", manifest)); + GNUNET_free (manifest); /* let's do this again, with NULL */ FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - plugin->set_extension_config (plugin->cls, - "fnord", - NULL)); + plugin->set_extension_manifest (plugin->cls, + "fnord", + NULL)); FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - plugin->get_extension_config (plugin->cls, - "fnord", - &config)); + plugin->get_extension_manifest (plugin->cls, + "fnord", + &manifest)); - FAILIF (NULL != config); + FAILIF (NULL != manifest); return GNUNET_OK; drop: @@ -1272,7 +1272,7 @@ run (void *cls) NULL)); /* simple extension check */ FAILIF (GNUNET_OK != - test_extension_config ()); + test_extension_manifest ()); RND_BLK (&reserve_pub); GNUNET_assert (GNUNET_OK == |