summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-06-27 18:31:02 +0200
committerChristian Grothoff <christian@grothoff.org>2020-06-27 18:31:02 +0200
commit4b820e27ad2fdfda79e256c0b0624ad01150c5b3 (patch)
tree13babfec43d030c2a04caadc97a87edad2ca9287
parentcde317f8e848c61e399c6c3e93264b1736f33e74 (diff)
downloadmerchant-4b820e27ad2fdfda79e256c0b0624ad01150c5b3.tar.gz
merchant-4b820e27ad2fdfda79e256c0b0624ad01150c5b3.tar.bz2
merchant-4b820e27ad2fdfda79e256c0b0624ad01150c5b3.zip
fix #6236
-rw-r--r--src/testing/testing_api_cmd_post_transfers.c27
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: