diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-06-18 13:20:43 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-06-18 13:20:43 +0200 |
commit | 30903b93866900e41bb4defa4d7b8ee49f3f3f99 (patch) | |
tree | a685970ab2930654da5578f1fece9567e91cffab /src/lib/testing_api_cmd_refresh.c | |
parent | 6066ffcb9b07f9e2709d0382afa3fc05c52e21c7 (diff) | |
download | exchange-30903b93866900e41bb4defa4d7b8ee49f3f3f99.tar.xz |
reduce code duplication
Diffstat (limited to 'src/lib/testing_api_cmd_refresh.c')
-rw-r--r-- | src/lib/testing_api_cmd_refresh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/testing_api_cmd_refresh.c b/src/lib/testing_api_cmd_refresh.c index ec8855810..d0b589b12 100644 --- a/src/lib/testing_api_cmd_refresh.c +++ b/src/lib/testing_api_cmd_refresh.c @@ -873,12 +873,10 @@ refresh_melt_run (void *cls, { struct RefreshMeltState *rms = cls; unsigned int num_fresh_coins; - const struct TALER_TESTING_Command *coin_command; /* FIXME: this should be dynamic */ const char *melt_fresh_amounts[] = { "EUR:1", "EUR:1", "EUR:1", "EUR:0.1", NULL}; - const struct TALER_EXCHANGE_DenomPublicKey *fresh_pk; rms->is = is; rms->noreveal_index = UINT16_MAX; @@ -895,8 +893,9 @@ refresh_melt_run (void *cls, struct TALER_Amount fresh_amount; const struct TALER_DenominationSignature *melt_sig; const struct TALER_EXCHANGE_DenomPublicKey *melt_denom_pub; - + const struct TALER_TESTING_Command *coin_command; const struct MeltDetails *md = &rms->melted_coin; + if (NULL == (coin_command = TALER_TESTING_interpreter_lookup_command (is, md->coin_reference))) @@ -945,6 +944,8 @@ refresh_melt_run (void *cls, for (unsigned int i=0;i<num_fresh_coins;i++) { + const struct TALER_EXCHANGE_DenomPublicKey *fresh_pk; + if (GNUNET_OK != TALER_string_to_amount (melt_fresh_amounts[i], &fresh_amount)) { |