fix another fixme

This commit is contained in:
Christian Grothoff 2020-01-17 17:32:09 +01:00
parent 2ffabd394c
commit 9d2ff364dc
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -263,29 +263,26 @@ deposit_run (void *cls,
return; return;
} }
/* Fixme: do prefer "interpreter fail" over assertions, if ( (GNUNET_OK !=
* as the former takes care of shutting down processes too */ TALER_TESTING_get_trait_coin_priv (coin_cmd,
GNUNET_assert (NULL != coin_cmd);
GNUNET_assert (GNUNET_OK
== TALER_TESTING_get_trait_coin_priv (coin_cmd,
ds->coin_index, ds->coin_index,
&coin_priv)); &coin_priv)) ||
(GNUNET_OK !=
GNUNET_assert (GNUNET_OK TALER_TESTING_get_trait_denom_pub (coin_cmd,
== TALER_TESTING_get_trait_denom_pub (coin_cmd,
ds->coin_index, ds->coin_index,
&denom_pub)); &denom_pub)) ||
(GNUNET_OK !=
GNUNET_assert (GNUNET_OK TALER_TESTING_get_trait_denom_sig (coin_cmd,
== TALER_TESTING_get_trait_denom_sig (coin_cmd,
ds->coin_index, ds->coin_index,
&denom_pub_sig)); &denom_pub_sig)) ||
(GNUNET_OK !=
GNUNET_assert (GNUNET_OK ==
TALER_JSON_hash (ds->contract_terms, TALER_JSON_hash (ds->contract_terms,
&h_contract_terms)); &h_contract_terms)) )
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
&coin_pub.eddsa_pub); &coin_pub.eddsa_pub);
@ -307,8 +304,7 @@ deposit_run (void *cls,
wire_deadline = GNUNET_TIME_relative_to_absolute wire_deadline = GNUNET_TIME_relative_to_absolute
(GNUNET_TIME_UNIT_ZERO); (GNUNET_TIME_UNIT_ZERO);
} }
GNUNET_CRYPTO_eddsa_key_get_public GNUNET_CRYPTO_eddsa_key_get_public (&ds->merchant_priv.eddsa_priv,
(&ds->merchant_priv.eddsa_priv,
&merchant_pub.eddsa_pub); &merchant_pub.eddsa_pub);
(void) GNUNET_TIME_round_abs (&wire_deadline); (void) GNUNET_TIME_round_abs (&wire_deadline);
@ -322,8 +318,7 @@ deposit_run (void *cls,
dr.purpose.purpose = htonl dr.purpose.purpose = htonl
(TALER_SIGNATURE_WALLET_COIN_DEPOSIT); (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
dr.h_contract_terms = h_contract_terms; dr.h_contract_terms = h_contract_terms;
GNUNET_assert GNUNET_assert (GNUNET_OK ==
(GNUNET_OK ==
TALER_JSON_merchant_wire_signature_hash (ds->wire_details, TALER_JSON_merchant_wire_signature_hash (ds->wire_details,
&dr.h_wire)); &dr.h_wire));
dr.timestamp = GNUNET_TIME_absolute_hton (ds->timestamp); dr.timestamp = GNUNET_TIME_absolute_hton (ds->timestamp);
@ -335,8 +330,8 @@ deposit_run (void *cls,
&denom_pub->fee_deposit); &denom_pub->fee_deposit);
dr.merchant = merchant_pub; dr.merchant = merchant_pub;
dr.coin_pub = coin_pub; dr.coin_pub = coin_pub;
GNUNET_assert (GNUNET_OK == GNUNET_CRYPTO_eddsa_sign GNUNET_assert (GNUNET_OK ==
(&coin_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_sign (&coin_priv->eddsa_priv,
&dr.purpose, &dr.purpose,
&coin_sig.eddsa_signature)); &coin_sig.eddsa_signature));
} }
@ -361,7 +356,6 @@ deposit_run (void *cls,
TALER_TESTING_interpreter_fail (is); TALER_TESTING_interpreter_fail (is);
return; return;
} }
return;
} }
@ -419,17 +413,15 @@ deposit_traits (void *cls,
/* Will point to coin cmd internals. */ /* Will point to coin cmd internals. */
const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv; const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv;
coin_cmd = TALER_TESTING_interpreter_lookup_command coin_cmd
(ds->is, = TALER_TESTING_interpreter_lookup_command (ds->is,
ds->coin_reference); ds->coin_reference);
if (NULL == coin_cmd) if (NULL == coin_cmd)
{ {
GNUNET_break (0); GNUNET_break (0);
TALER_TESTING_interpreter_fail (ds->is); TALER_TESTING_interpreter_fail (ds->is);
return GNUNET_NO; return GNUNET_NO;
} }
if (GNUNET_OK != if (GNUNET_OK !=
TALER_TESTING_get_trait_coin_priv (coin_cmd, TALER_TESTING_get_trait_coin_priv (coin_cmd,
ds->coin_index, ds->coin_index,
@ -439,7 +431,7 @@ deposit_traits (void *cls,
TALER_TESTING_interpreter_fail (ds->is); TALER_TESTING_interpreter_fail (ds->is);
return GNUNET_NO; return GNUNET_NO;
} }
{
struct TALER_TESTING_Trait traits[] = { struct TALER_TESTING_Trait traits[] = {
/* First two traits are only available if /* First two traits are only available if
ds->traits is #GNUNET_YES */ ds->traits is #GNUNET_YES */
@ -467,6 +459,7 @@ deposit_traits (void *cls,
ret, ret,
trait, trait,
index); index);
}
} }