aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-18 13:47:32 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-18 14:19:12 +0200
commit0159d1a0e89e918bc60849b8742642ede72cf02d (patch)
treef10c832d2e53b7f0d8c177be0680177a8c4a4b17 /src/lib
parent64d9a74739c8a2b8da5b21fcce69a85dbb81923f (diff)
fix misc style bugs and one real one
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/merchant_api_tip_pickup.c4
-rw-r--r--src/lib/testing_api_cmd_history.c48
-rw-r--r--src/lib/testing_api_cmd_pay.c96
-rw-r--r--src/lib/testing_api_cmd_proposal.c14
-rw-r--r--src/lib/testing_api_cmd_refund.c14
-rw-r--r--src/lib/testing_api_cmd_tip.c45
-rw-r--r--src/lib/testing_api_cmd_track.c4
7 files changed, 114 insertions, 111 deletions
diff --git a/src/lib/merchant_api_tip_pickup.c b/src/lib/merchant_api_tip_pickup.c
index d3d0f669..63b0e59d 100644
--- a/src/lib/merchant_api_tip_pickup.c
+++ b/src/lib/merchant_api_tip_pickup.c
@@ -118,14 +118,14 @@ check_ok (struct TALER_MERCHANT_TipPickupOperation *tpo,
{
json_t *pj = json_array_get (ja, i);
- struct GNUNET_JSON_Specification spec[] = {
+ struct GNUNET_JSON_Specification ispec[] = {
GNUNET_JSON_spec_fixed_auto ("reserve_sig", &reserve_sigs[i]),
GNUNET_JSON_spec_end()
};
if (GNUNET_OK !=
GNUNET_JSON_parse (pj,
- spec,
+ ispec,
NULL, NULL))
{
GNUNET_break_op (0);
diff --git a/src/lib/testing_api_cmd_history.c b/src/lib/testing_api_cmd_history.c
index 2c60af7e..68c1e257 100644
--- a/src/lib/testing_api_cmd_history.c
+++ b/src/lib/testing_api_cmd_history.c
@@ -160,7 +160,6 @@ history_cb (void *cls,
enum TALER_ErrorCode ec,
const json_t *json)
{
-
struct HistoryState *hs = cls;
unsigned int nresult;
struct GNUNET_TIME_Absolute last_timestamp;
@@ -176,7 +175,7 @@ history_cb (void *cls,
{
/* 0 was caused intentionally by the tests,
* move on without further checking. */
- TALER_TESTING_interpreter_next (hs->is);
+ TALER_TESTING_interpreter_next (hs->is);
return;
}
@@ -192,32 +191,34 @@ history_cb (void *cls,
}
last_timestamp = GNUNET_TIME_absolute_get ();
- last_timestamp = GNUNET_TIME_absolute_add
- (last_timestamp, GNUNET_TIME_UNIT_DAYS);
- json_t *entry;
- json_t *timestamp;
- size_t index;
- json_array_foreach (json, index, entry)
+ last_timestamp = GNUNET_TIME_absolute_add (last_timestamp,
+ GNUNET_TIME_UNIT_DAYS);
{
- timestamp = json_object_get (entry, "timestamp");
- if (GNUNET_OK != parse_abs_time (timestamp, &entry_timestamp))
- TALER_TESTING_FAIL (hs->is);
-
- if (last_timestamp.abs_value_us < entry_timestamp.abs_value_us)
+ json_t *entry;
+ size_t index;
+ json_array_foreach (json, index, entry)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "History entries are NOT"
- " sorted from younger to older\n");
- TALER_TESTING_interpreter_fail (hs->is);
- return;
+ json_t *timestamp;
+
+ timestamp = json_object_get (entry, "timestamp");
+ if (GNUNET_OK != parse_abs_time (timestamp, &entry_timestamp))
+ TALER_TESTING_FAIL (hs->is);
+
+ if (last_timestamp.abs_value_us < entry_timestamp.abs_value_us)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "History entries are NOT"
+ " sorted from younger to older\n");
+ TALER_TESTING_interpreter_fail (hs->is);
+ return;
+ }
+ last_timestamp = entry_timestamp;
}
-
- last_timestamp = entry_timestamp;
}
-
TALER_TESTING_interpreter_next (hs->is);
}
+
/**
* Free the state for a "history" CMD, and possibly cancel
* any pending operation thereof.
@@ -240,6 +241,7 @@ history_cleanup (void *cls,
GNUNET_free (hs);
}
+
/**
* Run a "history" CMD.
*
@@ -253,7 +255,7 @@ history_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct HistoryState *hs = cls;
-
+
hs->is = is;
if (0 == hs->time.abs_value_us)
{
@@ -341,7 +343,7 @@ cmd_history2 (const char *label,
.run = &history_run,
.cleanup = &history_cleanup
};
-
+
return cmd;
}
diff --git a/src/lib/testing_api_cmd_pay.c b/src/lib/testing_api_cmd_pay.c
index 15e0adac..b3a0e18d 100644
--- a/src/lib/testing_api_cmd_pay.c
+++ b/src/lib/testing_api_cmd_pay.c
@@ -138,7 +138,7 @@ struct CheckPaymentState
*/
struct PayAgainState
{
-
+
/**
* Expected HTTP response code.
*/
@@ -298,7 +298,7 @@ check_payment_cleanup (void *cls,
"Command `%s' was not terminated\n",
TALER_TESTING_interpreter_get_current_label (
cps->is));
- TALER_MERCHANT_check_payment_cancel (cps->cpo);
+ TALER_MERCHANT_check_payment_cancel (cps->cpo);
}
GNUNET_free (cps);
}
@@ -394,7 +394,7 @@ check_payment_run (void *cls,
check_payment_cb,
cps);
- GNUNET_assert (NULL != cps->cpo);
+ GNUNET_assert (NULL != cps->cpo);
}
/**
@@ -484,8 +484,8 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc,
"%u",
&ci))
{
- GNUNET_break (0);
- return GNUNET_SYSERR;
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
}
}
@@ -499,38 +499,39 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc,
}
GNUNET_array_grow (*pc,
- *npc,
- (*npc) + 1);
-
- icoin = &(*pc)[(*npc)-1];
-
- const struct TALER_CoinSpendPrivateKeyP *coin_priv;
- const struct TALER_DenominationSignature *denom_sig;
- const struct TALER_Amount *denom_value;
- const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
+ *npc,
+ (*npc) + 1);
- GNUNET_assert
- (GNUNET_OK == TALER_TESTING_get_trait_coin_priv
- (coin_cmd, 0, &coin_priv));
-
- GNUNET_assert
- (GNUNET_OK == TALER_TESTING_get_trait_denom_pub
- (coin_cmd, 0, &denom_pub));
+ icoin = &((*pc)[(*npc)-1]);
- GNUNET_assert
- (GNUNET_OK == TALER_TESTING_get_trait_denom_sig
- (coin_cmd, 0, &denom_sig));
-
- GNUNET_assert
- (GNUNET_OK == TALER_TESTING_get_trait_amount_obj
- (coin_cmd, 0, &denom_value));
-
- icoin->coin_priv = *coin_priv;
- icoin->denom_pub = denom_pub->key;
- icoin->denom_sig = *denom_sig;
- icoin->denom_value = *denom_value;
- icoin->amount_with_fee = *denom_value;
-
+ {
+ const struct TALER_CoinSpendPrivateKeyP *coin_priv;
+ const struct TALER_DenominationSignature *denom_sig;
+ const struct TALER_Amount *denom_value;
+ const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
+
+ GNUNET_assert
+ (GNUNET_OK == TALER_TESTING_get_trait_coin_priv
+ (coin_cmd, 0, &coin_priv));
+
+ GNUNET_assert
+ (GNUNET_OK == TALER_TESTING_get_trait_denom_pub
+ (coin_cmd, 0, &denom_pub));
+
+ GNUNET_assert
+ (GNUNET_OK == TALER_TESTING_get_trait_denom_sig
+ (coin_cmd, 0, &denom_sig));
+
+ GNUNET_assert
+ (GNUNET_OK == TALER_TESTING_get_trait_amount_obj
+ (coin_cmd, 0, &denom_value));
+
+ icoin->coin_priv = *coin_priv;
+ icoin->denom_pub = denom_pub->key;
+ icoin->denom_sig = *denom_sig;
+ icoin->denom_value = *denom_value;
+ icoin->amount_with_fee = *denom_value;
+ }
GNUNET_assert (NULL != (dpk = TALER_TESTING_find_pk
(is->keys, &icoin->denom_value)));
@@ -541,11 +542,12 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc,
GNUNET_assert
(GNUNET_OK == TALER_TESTING_get_trait_url
- (coin_cmd, 0, &icoin->exchange_url));
+ (coin_cmd, 0, &icoin->exchange_url));
GNUNET_assert
(GNUNET_OK == TALER_string_to_amount
(refund_fee, &icoin->refund_fee));
+
}
return GNUNET_OK;
@@ -577,7 +579,6 @@ pay_cb (void *cls,
const char *error_name;
unsigned int error_line;
const struct GNUNET_CRYPTO_EddsaPublicKey *merchant_pub;
- const struct TALER_TESTING_Command *proposal_cmd;
ps->po = NULL;
if (ps->http_status != http_status)
@@ -601,6 +602,7 @@ pay_cb (void *cls,
&ps->h_contract_terms),
GNUNET_JSON_spec_end ()
};
+ const struct TALER_TESTING_Command *proposal_cmd;
GNUNET_assert (GNUNET_OK == GNUNET_JSON_parse (
obj, spec,
@@ -890,7 +892,7 @@ pay_run (void *cls,
{
struct PayState *ps = cls;
-
+
ps->is = is;
if (NULL == (ps->po = _pay_run (ps->merchant_url,
ps->coin_reference,
@@ -1087,7 +1089,7 @@ pay_abort_run (void *cls,
const struct TALER_TESTING_Command *cmd,
struct TALER_TESTING_Interpreter *is)
{
-
+
struct PayAbortState *pas = cls;
const struct TALER_TESTING_Command *pay_cmd;
@@ -1096,13 +1098,13 @@ pay_abort_run (void *cls,
const char *amount_with_fee;
const char *amount_without_fee;
const char *refund_fee;
-
+
pas->is = is;
pay_cmd = TALER_TESTING_interpreter_lookup_command
(is, pas->pay_reference);
if (NULL == pay_cmd)
TALER_TESTING_FAIL (is);
-
+
if (GNUNET_OK != TALER_TESTING_get_trait_proposal_reference
(pay_cmd, 0, &proposal_reference))
TALER_TESTING_FAIL (is);
@@ -1202,7 +1204,7 @@ TALER_TESTING_cmd_pay_abort (const char *label,
.cleanup = &pay_abort_cleanup,
.traits = &pay_abort_traits
};
-
+
return cmd;
}
@@ -1307,13 +1309,13 @@ pay_again_run (void *cls,
const char *proposal_reference;
const char *amount_with_fee;
const char *amount_without_fee;
-
+
pas->is = is;
pay_cmd = TALER_TESTING_interpreter_lookup_command
(is, pas->pay_reference);
if (NULL == pay_cmd)
TALER_TESTING_FAIL (is);
-
+
if (GNUNET_OK != TALER_TESTING_get_trait_proposal_reference
(pay_cmd, 0, &proposal_reference))
TALER_TESTING_FAIL (is);
@@ -1401,7 +1403,7 @@ TALER_TESTING_cmd_pay_again (const char *label,
.run = &pay_again_run,
.cleanup = &pay_again_cleanup
};
-
+
return cmd;
}
@@ -1515,9 +1517,9 @@ pay_abort_refund_run (void *cls,
(abort_cmd, 0, &refund_entry))
TALER_TESTING_FAIL (is);
- GNUNET_assert (GNUNET_OK == TALER_string_to_amount
+ GNUNET_assert (GNUNET_OK == TALER_string_to_amount
(pars->refund_amount, &refund_amount));
- GNUNET_assert (GNUNET_OK == TALER_string_to_amount
+ GNUNET_assert (GNUNET_OK == TALER_string_to_amount
(pars->refund_fee, &refund_fee));
pars->rh = TALER_EXCHANGE_refund2
diff --git a/src/lib/testing_api_cmd_proposal.c b/src/lib/testing_api_cmd_proposal.c
index bceecc17..71a02061 100644
--- a/src/lib/testing_api_cmd_proposal.c
+++ b/src/lib/testing_api_cmd_proposal.c
@@ -176,12 +176,11 @@ proposal_traits (void *cls,
MAKE_TRAIT_NONCE (&ps->nonce),
TALER_TESTING_trait_end ()
};
-
+
return TALER_TESTING_get_trait (traits,
ret,
trait,
index);
- return GNUNET_SYSERR;
}
@@ -350,7 +349,7 @@ proposal_run (void *cls,
// human error here.
GNUNET_break (0);
fprintf (stderr, "%s\n", error.text);
- TALER_TESTING_interpreter_fail (is);
+ TALER_TESTING_interpreter_fail (is);
return;
}
@@ -360,7 +359,7 @@ proposal_run (void *cls,
struct GNUNET_TIME_Absolute now;
char *order_id;
- now = GNUNET_TIME_absolute_get ();
+ now = GNUNET_TIME_absolute_get ();
order_id = GNUNET_STRINGS_data_to_string_alloc
(&now.abs_value_us,
@@ -541,7 +540,6 @@ proposal_lookup_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct ProposalLookupState *pls = cls;
- const struct TALER_TESTING_Command *proposal_cmd;
const char *order_id;
const struct GNUNET_CRYPTO_EddsaPublicKey *nonce;
/* Only used if we do NOT use the nonce from traits. */
@@ -561,6 +559,8 @@ proposal_lookup_run (void *cls,
}
else
{
+ const struct TALER_TESTING_Command *proposal_cmd;
+
proposal_cmd = TALER_TESTING_interpreter_lookup_command
(is, pls->proposal_reference);
@@ -569,7 +569,7 @@ proposal_lookup_run (void *cls,
if (GNUNET_OK != GET_TRAIT_NONCE (proposal_cmd,
&nonce))
- TALER_TESTING_FAIL (is);
+ TALER_TESTING_FAIL (is);
if (GNUNET_OK != TALER_TESTING_get_trait_order_id
(proposal_cmd, 0, &order_id))
@@ -607,7 +607,7 @@ TALER_TESTING_cmd_proposal_lookup
const char *order_id)
{
struct ProposalLookupState *pls;
-
+
pls = GNUNET_new (struct ProposalLookupState);
pls->http_status = http_status;
pls->proposal_reference = proposal_reference;
diff --git a/src/lib/testing_api_cmd_refund.c b/src/lib/testing_api_cmd_refund.c
index c8b825a6..bc96175a 100644
--- a/src/lib/testing_api_cmd_refund.c
+++ b/src/lib/testing_api_cmd_refund.c
@@ -275,7 +275,6 @@ refund_lookup_cb (void *cls,
char *coin_reference_dup;
const char *icoin_reference;
const struct TALER_TESTING_Command *pay_cmd;
- const struct TALER_TESTING_Command *icoin_cmd;
const struct TALER_TESTING_Command *increase_cmd;
const char *refund_amount;
struct TALER_Amount acc;
@@ -344,6 +343,7 @@ refund_lookup_cb (void *cls,
struct TALER_CoinSpendPublicKeyP icoin_pub;
struct GNUNET_HashCode h_icoin_pub;
struct TALER_Amount *iamount;
+ const struct TALER_TESTING_Command *icoin_cmd;
if ( NULL ==
( icoin_cmd = TALER_TESTING_interpreter_lookup_command
@@ -351,7 +351,7 @@ refund_lookup_cb (void *cls,
{
GNUNET_break (0);
TALER_LOG_ERROR ("Bad reference `%s'\n",
- icoin_reference);
+ icoin_reference);
TALER_TESTING_interpreter_fail (rls->is);
return;
}
@@ -362,11 +362,11 @@ refund_lookup_cb (void *cls,
GNUNET_break (0);
TALER_LOG_ERROR ("Command `%s' failed to give coin"
" priv trait\n",
- icoin_reference);
+ icoin_reference);
TALER_TESTING_interpreter_fail (rls->is);
return;
}
-
+
GNUNET_CRYPTO_eddsa_key_get_public (&icoin_priv->eddsa_priv,
&icoin_pub.eddsa_pub);
GNUNET_CRYPTO_hash (&icoin_pub,
@@ -386,7 +386,7 @@ refund_lookup_cb (void *cls,
}
GNUNET_free (coin_reference_dup);
-
+
if (NULL !=
(increase_cmd = TALER_TESTING_interpreter_lookup_command
(rls->is, rls->increase_reference)))
@@ -443,7 +443,7 @@ refund_lookup_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct RefundLookupState *rls = cls;
-
+
rls->is = is;
rls->rlo = TALER_MERCHANT_refund_lookup (is->ctx,
rls->merchant_url,
@@ -472,7 +472,7 @@ refund_increase_traits (void *cls,
unsigned int index)
{
struct RefundIncreaseState *ris = cls;
-
+
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_amount (0, ris->refund_amount),
TALER_TESTING_trait_end ()
diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c
index 44043670..cc51ff07 100644
--- a/src/lib/testing_api_cmd_tip.c
+++ b/src/lib/testing_api_cmd_tip.c
@@ -88,7 +88,7 @@ struct TipPickupState
* How many coins are involved in the tipping operation.
*/
unsigned int num_coins;
-
+
/**
* The array of denomination keys, in the same order of @a
* amounts.
@@ -176,7 +176,7 @@ struct TipQueryState
*/
struct TipAuthorizeState
{
-
+
/**
* Merchant base URL.
*/
@@ -255,7 +255,7 @@ tip_authorize_cb (void *cls,
struct GNUNET_TIME_Absolute tip_expiration,
const char *exchange_url)
{
- struct TipAuthorizeState *tas = cls;
+ struct TipAuthorizeState *tas = cls;
tas->tao = NULL;
if (tas->http_status != http_status)
@@ -321,7 +321,6 @@ tip_authorize_traits (void *cls,
unsigned int index)
{
struct TipAuthorizeState *tas = cls;
-
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_tip_id (0, &tas->tip_id),
TALER_TESTING_trait_end (),
@@ -331,9 +330,9 @@ tip_authorize_traits (void *cls,
ret,
trait,
index);
- return GNUNET_SYSERR;
}
+
/**
* Runs the /tip-authorize CMD
*
@@ -347,7 +346,7 @@ tip_authorize_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct TipAuthorizeState *tas = cls;
- struct TALER_Amount amount;
+ struct TALER_Amount amount;
tas->is = is;
if (GNUNET_OK != TALER_string_to_amount (tas->amount,
@@ -461,7 +460,7 @@ TALER_TESTING_cmd_tip_authorize_with_ec
.cleanup = &tip_authorize_cleanup,
.traits = &tip_authorize_traits
};
-
+
return cmd;
}
@@ -508,7 +507,7 @@ TALER_TESTING_cmd_tip_authorize (const char *label,
.cleanup = &tip_authorize_cleanup,
.traits = &tip_authorize_traits
};
-
+
return cmd;
}
@@ -627,7 +626,7 @@ tip_query_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct TipQueryState *tqs = cls;
-
+
tqs->is = is;
tqs->tqo = TALER_MERCHANT_tip_query (is->ctx,
tqs->merchant_url,
@@ -681,7 +680,7 @@ TALER_TESTING_cmd_tip_query_with_amounts
.run = &tip_query_run,
.cleanup = &tip_query_cleanup
};
-
+
return cmd;
}
@@ -715,7 +714,7 @@ TALER_TESTING_cmd_tip_query (const char *label,
.run = &tip_query_run,
.cleanup = &tip_query_cleanup
};
-
+
return cmd;
}
@@ -740,7 +739,7 @@ struct WithdrawHandle
*/
unsigned int off;
-
+
/**
* Internal state of the "pickup" CMD.
*/
@@ -748,7 +747,7 @@ struct WithdrawHandle
};
/**
- * This callback handles the response of a withdraw operation
+ * This callback handles the response of a withdraw operation
* from the exchange, that is the final step in getting the tip.
*
* @param cls closure, a `struct WithdrawHandle *`
@@ -935,8 +934,8 @@ tip_pickup_run (void *cls,
if ( NULL == /* looking for "parent" tip-pickup command */
( replay_cmd = TALER_TESTING_interpreter_lookup_command
(is, tps->replay_reference)) )
- TALER_TESTING_FAIL (is);
-
+ TALER_TESTING_FAIL (is);
+
if (GNUNET_OK != TALER_TESTING_get_trait_uint
(replay_cmd, 0, &np))
TALER_TESTING_FAIL (is);
@@ -975,7 +974,7 @@ tip_pickup_run (void *cls,
if (NULL == tps->dks[i])
TALER_TESTING_FAIL (is);
- TALER_planchet_setup_random (&tps->psa[i]);
+ TALER_planchet_setup_random (&tps->psa[i]);
}
else
{
@@ -994,9 +993,9 @@ tip_pickup_run (void *cls,
if (GNUNET_OK != TALER_planchet_prepare (&tps->dks[i]->key,
&tps->psa[i],
&planchets[i]))
- TALER_TESTING_FAIL (is);
+ TALER_TESTING_FAIL (is);
}
-
+
if (GNUNET_OK != TALER_TESTING_get_trait_tip_id
(authorize_cmd, 0, &tip_id))
TALER_TESTING_FAIL (is);
@@ -1061,7 +1060,7 @@ tip_pickup_traits (void *cls,
struct TipPickupState *tps = cls;
#define NUM_TRAITS (tps->num_coins * 5) + 2
struct TALER_TESTING_Trait traits[NUM_TRAITS];
-
+
for (unsigned int i=0; i<tps->num_coins; i++)
{
traits[i] = TALER_TESTING_make_trait_planchet_secrets
@@ -1090,9 +1089,9 @@ tip_pickup_traits (void *cls,
ret,
trait,
index);
- return GNUNET_SYSERR;
}
+
/**
* Define a /tip-pickup CMD, equipped with the expected error
* code.
@@ -1134,7 +1133,7 @@ TALER_TESTING_cmd_tip_pickup_with_ec
.cleanup = &tip_pickup_cleanup,
.traits = &tip_pickup_traits
};
-
+
return cmd;
}
@@ -1173,7 +1172,7 @@ TALER_TESTING_cmd_tip_pickup
.cleanup = &tip_pickup_cleanup,
.traits = &tip_pickup_traits
};
-
+
return cmd;
}
@@ -1201,7 +1200,7 @@ TALER_TESTING_cmd_tip_authorize_fake (const char *label)
.cleanup = &tip_authorize_cleanup,
.traits = &tip_authorize_traits
};
-
+
return cmd;
}
diff --git a/src/lib/testing_api_cmd_track.c b/src/lib/testing_api_cmd_track.c
index c6169c67..9cd4803b 100644
--- a/src/lib/testing_api_cmd_track.c
+++ b/src/lib/testing_api_cmd_track.c
@@ -137,8 +137,6 @@ track_transaction_cb (void *cls,
const json_t *json)
{
struct TrackTransactionState *tts = cls;
- json_t *wtid_str;
- json_t *exchange_url;
tts->tth = NULL;
if (tts->http_status != http_status)
@@ -160,6 +158,8 @@ track_transaction_cb (void *cls,
/* Only storing first element's wtid, as this works around
* the disability of the real bank to provide a "bank check"
* CMD as the fakebank does. */
+ json_t *wtid_str;
+ json_t *exchange_url;
if (NULL == (wtid_str = json_object_get
(json_array_get (json, 0), "wtid")))