summaryrefslogtreecommitdiff
path: root/src/mintdb/perf_taler_mintdb_init.c
diff options
context:
space:
mode:
authorFournier Nicolas <nicolas.fournier@ensta-paristech.fr>2015-07-20 10:24:09 +0200
committerFournier Nicolas <nicolas.fournier@ensta-paristech.fr>2015-07-20 10:24:09 +0200
commit3e8a837a078a5aa7975c669a2cc8652174b6bd73 (patch)
treeb88b0aac4e244e8a2e7609393f4043e4a77c1162 /src/mintdb/perf_taler_mintdb_init.c
parentcb37f25146d5c98cd7b4498db9fc14d181cf4fe3 (diff)
downloadexchange-3e8a837a078a5aa7975c669a2cc8652174b6bd73.tar.gz
exchange-3e8a837a078a5aa7975c669a2cc8652174b6bd73.tar.bz2
exchange-3e8a837a078a5aa7975c669a2cc8652174b6bd73.zip
added new commands for melting
Diffstat (limited to 'src/mintdb/perf_taler_mintdb_init.c')
-rw-r--r--src/mintdb/perf_taler_mintdb_init.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/mintdb/perf_taler_mintdb_init.c b/src/mintdb/perf_taler_mintdb_init.c
index 2fe978f64..5c18c664e 100644
--- a/src/mintdb/perf_taler_mintdb_init.c
+++ b/src/mintdb/perf_taler_mintdb_init.c
@@ -534,24 +534,13 @@ PERF_TALER_MINTDB_coin_public_info_free (struct TALER_CoinPublicInfo *cpi)
*/
struct TALER_MINTDB_RefreshMelt *
PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
- struct TALER_MINTDB_DenominationKeyIssueInformation *dki)
+ struct PERF_TALER_MINTDB_Coin *coin)
{
struct TALER_MINTDB_RefreshMelt *melt;
- struct GNUNET_CRYPTO_EddsaPrivateKey *coin_key;
- struct TALER_CoinPublicInfo cpi;
- struct TALER_CoinSpendSignatureP coin_spent;
+ struct TALER_CoinSpendSignatureP coin_sig;
struct TALER_Amount amount;
struct TALER_Amount amount_with_fee;
- coin_key = GNUNET_CRYPTO_eddsa_key_create ();
- cpi.denom_pub = dki->denom_pub;
- GNUNET_CRYPTO_eddsa_key_get_public (coin_key,
- &cpi.coin_pub.eddsa_pub);
- GNUNET_assert (NULL !=
- (cpi.denom_sig.rsa_signature =
- GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key,
- &cpi.coin_pub.eddsa_pub,
- sizeof (struct GNUNET_CRYPTO_EddsaPublicKey))));
{
struct
{
@@ -562,22 +551,21 @@ PERF_TALER_MINTDB_refresh_melt_init (struct GNUNET_HashCode *session,
to_sign.purpose.purpose = GNUNET_SIGNATURE_PURPOSE_TEST;
to_sign.purpose.size = htonl (sizeof (to_sign));
to_sign.session = *session;
- GNUNET_CRYPTO_eddsa_sign (coin_key,
+ GNUNET_CRYPTO_eddsa_sign (&coin->priv,
&to_sign.purpose,
- &coin_spent.eddsa_signature);
+ &coin_sig.eddsa_signature);
}
- GNUNET_assert (GNUNET_OK == TALER_string_to_amount (CURRENCY ":10.0",
+ GNUNET_assert (GNUNET_OK == TALER_string_to_amount (CURRENCY ":1.1",
&amount));
GNUNET_assert (GNUNET_OK == TALER_string_to_amount (CURRENCY ":0.1",
&amount_with_fee));
melt = GNUNET_new (struct TALER_MINTDB_RefreshMelt);
- melt->coin = cpi;
- melt->coin_sig = coin_spent;
+ melt->coin = coin->public_info;
+ melt->coin_sig = coin_sig;
melt->session_hash = *session;
melt->amount_with_fee = amount;
melt->melt_fee = amount_with_fee;
- GNUNET_free (coin_key);
return melt;
}