diff options
Diffstat (limited to 'src/testing/testing_api_cmd_post_transfers.c')
-rw-r--r-- | src/testing/testing_api_cmd_post_transfers.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/testing/testing_api_cmd_post_transfers.c b/src/testing/testing_api_cmd_post_transfers.c index f5087c2d..ad16a86e 100644 --- a/src/testing/testing_api_cmd_post_transfers.c +++ b/src/testing/testing_api_cmd_post_transfers.c @@ -184,6 +184,7 @@ transfers_cb (void *cls, const struct TALER_TESTING_Command *cmd; const json_t *contract_terms; const struct TALER_Amount *deposit_value; + const struct TALER_Amount *deposit_fee; const char *order_id; cmd = TALER_TESTING_interpreter_lookup_command (pts->is, @@ -200,8 +201,12 @@ transfers_cb (void *cls, &contract_terms)) || (GNUNET_OK != TALER_TESTING_get_trait_amount_obj (cmd, - 0, - &deposit_value)) ) + TALER_TESTING_CMD_DEPOSIT_TRAIT_IDX_DEPOSIT_VALUE, + &deposit_value)) || + (GNUNET_OK != + TALER_TESTING_get_trait_amount_obj (cmd, + TALER_TESTING_CMD_DEPOSIT_TRAIT_IDX_DEPOSIT_FEE, + &deposit_fee)) ) { GNUNET_break (0); TALER_TESTING_interpreter_fail (pts->is); @@ -227,7 +232,15 @@ transfers_cb (void *cls, TALER_TESTING_interpreter_fail (pts->is); return; } - // FIXME #6236: also would want to add deposit_fees, but unavailable as traits right now! + if (0 > + TALER_amount_add (&fees, + &fees, + deposit_fee)) + { + GNUNET_break (0); + TALER_TESTING_interpreter_fail (pts->is); + return; + } } if (0 != TALER_amount_cmp (&sum, @@ -237,10 +250,9 @@ transfers_cb (void *cls, TALER_TESTING_interpreter_fail (pts->is); return; } -#if FIXME6236 if (0 != TALER_amount_cmp (&fees, - tdd->deposit_fee)) + &tdd->deposit_fee)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (pts->is); @@ -254,18 +266,15 @@ transfers_cb (void *cls, TALER_amount_subtract (&total, &total, &tdd->deposit_fee)); -#endif } -#if FIXME6236 if (0 != TALER_amount_cmp (&total, - pts->credit_amount)) + &pts->credit_amount)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (pts->is); return; } -#endif break; } default: |