/reserve/status CMD.
The logic extracts the reserve pub according to the trait being a pub b64 encoding or a private key.
This commit is contained in:
parent
220e00696b
commit
208ba0d4b2
@ -167,23 +167,42 @@ status_run (void *cls,
|
||||
return;
|
||||
}
|
||||
|
||||
if (GNUNET_OK !=
|
||||
TALER_TESTING_get_trait_reserve_priv (create_reserve,
|
||||
0,
|
||||
&reserve_priv))
|
||||
if (GNUNET_OK == TALER_TESTING_get_trait_reserve_priv
|
||||
(create_reserve,
|
||||
0,
|
||||
&reserve_priv))
|
||||
{
|
||||
GNUNET_break (0);
|
||||
TALER_TESTING_interpreter_fail (is);
|
||||
return;
|
||||
GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
|
||||
&reserve_pub.eddsa_pub);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *transfer_subject;
|
||||
|
||||
if (GNUNET_OK != TALER_TESTING_get_trait_transfer_subject
|
||||
(create_reserve,
|
||||
0,
|
||||
&transfer_subject))
|
||||
{
|
||||
GNUNET_break (0);
|
||||
TALER_LOG_ERROR
|
||||
("The reserve has neither a priv nor a subject line..\n");
|
||||
TALER_TESTING_interpreter_fail (is);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
GNUNET_STRINGS_string_to_data
|
||||
(transfer_subject,
|
||||
strlen (transfer_subject),
|
||||
&reserve_pub.eddsa_pub,
|
||||
sizeof (struct TALER_ReservePublicKeyP));
|
||||
}
|
||||
|
||||
GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
|
||||
&reserve_pub.eddsa_pub);
|
||||
ss->rsh
|
||||
= TALER_EXCHANGE_reserve_status (ss->exchange,
|
||||
&reserve_pub,
|
||||
&reserve_status_cb,
|
||||
ss);
|
||||
ss->rsh = TALER_EXCHANGE_reserve_status (ss->exchange,
|
||||
&reserve_pub,
|
||||
&reserve_status_cb,
|
||||
ss);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user