some DB logic fixes, so now more of tests pass
This commit is contained in:
parent
1a0eb0307a
commit
51e0612f8b
@ -1998,8 +1998,6 @@ run (void *cls,
|
|||||||
.details.deposit.contract = "{ \"items\"={ \"name\":\"ice cream\", \"value\":3 } }",
|
.details.deposit.contract = "{ \"items\"={ \"name\":\"ice cream\", \"value\":3 } }",
|
||||||
.details.deposit.transaction_id = 2 },
|
.details.deposit.transaction_id = 2 },
|
||||||
|
|
||||||
#if TEST_REFRESH
|
|
||||||
|
|
||||||
/* Test running a failing melt operation (same operation again must fail) */
|
/* Test running a failing melt operation (same operation again must fail) */
|
||||||
{ .oc = OC_REFRESH_MELT,
|
{ .oc = OC_REFRESH_MELT,
|
||||||
.label = "refresh-melt-failing",
|
.label = "refresh-melt-failing",
|
||||||
@ -2011,7 +2009,6 @@ run (void *cls,
|
|||||||
// (signature differs from coin that was deposited...)
|
// (signature differs from coin that was deposited...)
|
||||||
|
|
||||||
/* *************** end of /refresh testing ************** */
|
/* *************** end of /refresh testing ************** */
|
||||||
#endif
|
|
||||||
|
|
||||||
{ .oc = OC_END }
|
{ .oc = OC_END }
|
||||||
};
|
};
|
||||||
@ -2030,7 +2027,7 @@ run (void *cls,
|
|||||||
GNUNET_assert (NULL != mint);
|
GNUNET_assert (NULL != mint);
|
||||||
shutdown_task
|
shutdown_task
|
||||||
= GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
|
= GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
|
||||||
(GNUNET_TIME_UNIT_SECONDS, 30),
|
(GNUNET_TIME_UNIT_SECONDS, 150),
|
||||||
&do_shutdown, is);
|
&do_shutdown, is);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2075,7 +2072,7 @@ main (int argc,
|
|||||||
fprintf (stderr, ".");
|
fprintf (stderr, ".");
|
||||||
sleep (1);
|
sleep (1);
|
||||||
}
|
}
|
||||||
while (0 != system ("wget -q -t 1 http://localhost:8081/agpl -o /dev/null -O /dev/null"));
|
while (0 != system ("wget -q -t 1 -T 1 http://127.0.0.1:8081/agpl -o /dev/null -O /dev/null"));
|
||||||
fprintf (stderr, "\n");
|
fprintf (stderr, "\n");
|
||||||
result = GNUNET_SYSERR;
|
result = GNUNET_SYSERR;
|
||||||
GNUNET_SCHEDULER_run (&run, NULL);
|
GNUNET_SCHEDULER_run (&run, NULL);
|
||||||
|
@ -250,15 +250,12 @@ verify_coin_public_info (struct MHD_Connection *connection,
|
|||||||
return TMH_RESPONSE_reply_arg_unknown (connection,
|
return TMH_RESPONSE_reply_arg_unknown (connection,
|
||||||
"denom_pub");
|
"denom_pub");
|
||||||
}
|
}
|
||||||
/* FIXME: need to check if denomination key is still
|
|
||||||
valid for issuing! (#3634) */
|
|
||||||
TALER_amount_ntoh (&fee_refresh,
|
TALER_amount_ntoh (&fee_refresh,
|
||||||
&dki->issue.properties.fee_refresh);
|
&dki->issue.properties.fee_refresh);
|
||||||
melt_detail->melt_fee = fee_refresh;
|
melt_detail->melt_fee = fee_refresh;
|
||||||
body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltCoinAffirmationPS));
|
body.purpose.size = htonl (sizeof (struct TALER_RefreshMeltCoinAffirmationPS));
|
||||||
body.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT);
|
body.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_MELT);
|
||||||
body.session_hash = *session_hash;
|
body.session_hash = *session_hash;
|
||||||
|
|
||||||
TALER_amount_hton (&body.amount_with_fee,
|
TALER_amount_hton (&body.amount_with_fee,
|
||||||
&melt_detail->melt_amount_with_fee);
|
&melt_detail->melt_amount_with_fee);
|
||||||
TALER_amount_hton (&body.melt_fee,
|
TALER_amount_hton (&body.melt_fee,
|
||||||
|
@ -419,7 +419,7 @@ compile_transaction_history (const struct TALER_MINTDB_TransactionList *tl)
|
|||||||
|
|
||||||
/* internal sanity check before we hand out a bogus sig... */
|
/* internal sanity check before we hand out a bogus sig... */
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_CRYPTO_eddsa_verify (ntohl (dr.purpose.purpose),
|
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
|
||||||
&dr.purpose,
|
&dr.purpose,
|
||||||
&deposit->csig.eddsa_signature,
|
&deposit->csig.eddsa_signature,
|
||||||
&deposit->coin.coin_pub.eddsa_pub))
|
&deposit->coin.coin_pub.eddsa_pub))
|
||||||
@ -451,7 +451,7 @@ compile_transaction_history (const struct TALER_MINTDB_TransactionList *tl)
|
|||||||
|
|
||||||
/* internal sanity check before we hand out a bogus sig... */
|
/* internal sanity check before we hand out a bogus sig... */
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
GNUNET_CRYPTO_eddsa_verify (ntohl (ms.purpose.purpose),
|
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_MELT,
|
||||||
&ms.purpose,
|
&ms.purpose,
|
||||||
&melt->coin_sig.eddsa_signature,
|
&melt->coin_sig.eddsa_signature,
|
||||||
&melt->coin.coin_pub.eddsa_pub))
|
&melt->coin.coin_pub.eddsa_pub))
|
||||||
|
@ -2181,9 +2181,6 @@ postgres_insert_refresh_melt (void *cls,
|
|||||||
}
|
}
|
||||||
if (GNUNET_NO == ret) /* if not, insert it */
|
if (GNUNET_NO == ret) /* if not, insert it */
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
|
||||||
"Melting coin coin %s\n",
|
|
||||||
TALER_B2S (&melt->coin.coin_pub));
|
|
||||||
ret = insert_known_coin (cls,
|
ret = insert_known_coin (cls,
|
||||||
session,
|
session,
|
||||||
&melt->coin);
|
&melt->coin);
|
||||||
@ -3026,10 +3023,6 @@ postgres_get_transfer (void *cls,
|
|||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
nrows = PQntuples (result);
|
nrows = PQntuples (result);
|
||||||
fprintf (stderr,
|
|
||||||
"linkage for coin %s resulted in %d results\n",
|
|
||||||
TALER_B2S (coin_pub),
|
|
||||||
nrows);
|
|
||||||
if (0 == nrows)
|
if (0 == nrows)
|
||||||
{
|
{
|
||||||
/* no matches found */
|
/* no matches found */
|
||||||
@ -3192,7 +3185,7 @@ postgres_get_coin_transactions (void *cls,
|
|||||||
&melt->coin_sig),
|
&melt->coin_sig),
|
||||||
TALER_PQ_result_spec_amount ("amount_with_fee",
|
TALER_PQ_result_spec_amount ("amount_with_fee",
|
||||||
&melt->amount_with_fee),
|
&melt->amount_with_fee),
|
||||||
TALER_PQ_result_spec_amount ("amount_with_fee",
|
TALER_PQ_result_spec_amount ("melt_fee",
|
||||||
&melt->melt_fee),
|
&melt->melt_fee),
|
||||||
TALER_PQ_result_spec_end
|
TALER_PQ_result_spec_end
|
||||||
};
|
};
|
||||||
@ -3204,6 +3197,7 @@ postgres_get_coin_transactions (void *cls,
|
|||||||
PQclear (result);
|
PQclear (result);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
melt->coin.coin_pub = *coin_pub;
|
||||||
}
|
}
|
||||||
tl = GNUNET_new (struct TALER_MINTDB_TransactionList);
|
tl = GNUNET_new (struct TALER_MINTDB_TransactionList);
|
||||||
tl->next = head;
|
tl->next = head;
|
||||||
|
Loading…
Reference in New Issue
Block a user