commit 946178319c2c1395df6e54a90d750e8695274250
parent f58858fd34f6685046eaf8793a630e5294ddac93
Author: Florian Dold <florian@dold.me>
Date: Wed, 6 May 2026 15:32:34 +0200
fix wrong/outdated test assertion
The insert_transfer_details function automatically sets orders to
wired, while the test was still operating under the assumption that
the wired flag needs to be set manually.
Diffstat:
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
@@ -2162,7 +2162,11 @@ test_lookup_payment_status (const char *instance_id,
if (expected_wired != wired)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Lookup payment status failed: wired status is wrong\n");
+ "Lookup payment status for %s/%s failed: wired status is wrong (expected %d got %d)\n",
+ instance_id,
+ order_id,
+ expected_wired,
+ wired);
return 1;
}
if (expected_paid != paid)
@@ -4519,6 +4523,10 @@ run_test_transfers (struct TestTransfers_Closure *cls)
&cls->signkey,
&cls->deposit,
GNUNET_DB_STATUS_SUCCESS_ONE_RESULT));
+ /* Mark as paid, otherwise wiring doesn't make sense. */
+ TEST_RET_ON_FAIL (test_mark_contract_paid (&cls->instance,
+ &cls->order,
+ GNUNET_DB_STATUS_SUCCESS_ONE_RESULT));
/* Insert the transfer */
TEST_RET_ON_FAIL (test_insert_transfer (&cls->instance,
&cls->account,
@@ -4527,8 +4535,7 @@ run_test_transfers (struct TestTransfers_Closure *cls)
TEST_RET_ON_FAIL (test_insert_transfer (&cls->instance,
&cls->account,
&cls->transfers[0],
- GNUNET_DB_STATUS_SUCCESS_ONE_RESULT))
- ;
+ GNUNET_DB_STATUS_SUCCESS_ONE_RESULT));
TEST_RET_ON_FAIL (test_insert_deposit_to_transfer (&cls->instance,
&cls->signkey,
&cls->order,
@@ -4547,11 +4554,12 @@ run_test_transfers (struct TestTransfers_Closure *cls)
&cls->account,
&cls->transfers[0],
GNUNET_DB_STATUS_SUCCESS_ONE_RESULT));
+ /* Inserting deposits/transfers will automatically mark as wired. */
TEST_RET_ON_FAIL (test_lookup_payment_status (cls->instance.instance.id,
cls->order.id,
NULL,
- false,
- false));
+ true,
+ true));
TEST_RET_ON_FAIL (test_insert_deposit_to_transfer (&cls->instance,
&cls->signkey,
&cls->order,