aboutsummaryrefslogtreecommitdiff
path: root/src/mintdb
diff options
context:
space:
mode:
authorSree Harsha Totakura <sreeharsha@totakura.in>2015-08-18 11:09:07 +0200
committerSree Harsha Totakura <sreeharsha@totakura.in>2015-08-18 11:31:02 +0200
commit0767119202d0a516b141cf789aaaac66a5794746 (patch)
tree06d38f7414211797c553773d4650f63580e7056a /src/mintdb
parent76b5feef912692bda23e2857369181ad877d3dd1 (diff)
mintdb postgres: test refresh_order_get()
Diffstat (limited to 'src/mintdb')
-rw-r--r--src/mintdb/test_mintdb.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/mintdb/test_mintdb.c b/src/mintdb/test_mintdb.c
index 918576ba7..f0a66a51f 100644
--- a/src/mintdb/test_mintdb.c
+++ b/src/mintdb/test_mintdb.c
@@ -188,6 +188,8 @@ test_melting (struct TALER_MINTDB_Session *session)
struct DenomKeyPair **new_dkp;
/* struct TALER_CoinPublicInfo *coins; */
struct TALER_MINTDB_RefreshMelt *melts;
+ struct TALER_DenominationPublicKey *new_denom_pubs;
+ struct TALER_DenominationPublicKey *ret_denom_pubs;
unsigned int cnt;
int ret;
@@ -196,6 +198,7 @@ test_melting (struct TALER_MINTDB_Session *session)
RND_BLK (&session_hash);
melts = NULL;
new_dkp = NULL;
+ new_denom_pubs = NULL;
/* create and test a refresh session */
refresh_session.num_oldcoins = MELT_OLD_COINS;
refresh_session.num_newcoins = 1;
@@ -268,12 +271,11 @@ test_melting (struct TALER_MINTDB_Session *session)
GNUNET_CRYPTO_rsa_public_key_free (ret_melt.coin.denom_pub.rsa_public_key);
}
new_dkp = GNUNET_new_array (MELT_NEW_COINS, struct DenomKeyPair *);
- struct TALER_DenominationPublicKey *new_denom_pubs;
new_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
struct TALER_DenominationPublicKey);
for (cnt=0; cnt < MELT_NEW_COINS; cnt++)
{
- new_dkp[cnt] = create_denom_key_pair (256, session,
+ new_dkp[cnt] = create_denom_key_pair (128, session,
&value,
&fee_withdraw,
&fee_deposit,
@@ -285,6 +287,19 @@ test_melting (struct TALER_MINTDB_Session *session)
&session_hash,
MELT_NEW_COINS,
new_denom_pubs));
+ ret_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
+ struct TALER_DenominationPublicKey);
+ FAILIF (GNUNET_OK != plugin->get_refresh_order (plugin->cls,
+ session,
+ &session_hash,
+ MELT_NEW_COINS,
+ ret_denom_pubs));
+ for (cnt=0; cnt < MELT_NEW_COINS; cnt++)
+ {
+ FAILIF (0 != GNUNET_CRYPTO_rsa_public_key_cmp
+ (ret_denom_pubs[cnt].rsa_public_key,
+ new_denom_pubs[cnt].rsa_public_key));
+ }
ret = GNUNET_OK;
@@ -296,6 +311,12 @@ test_melting (struct TALER_MINTDB_Session *session)
GNUNET_CRYPTO_rsa_signature_free (melts[cnt].coin.denom_sig.rsa_signature);
GNUNET_free (melts);
}
+ for (cnt = 0;
+ (NULL != ret_denom_pubs) && (cnt < MELT_NEW_COINS)
+ && (NULL != ret_denom_pubs[cnt].rsa_public_key);
+ cnt++)
+ GNUNET_CRYPTO_rsa_public_key_free (ret_denom_pubs[cnt].rsa_public_key);
+ GNUNET_free_non_null (ret_denom_pubs);
GNUNET_free_non_null (new_denom_pubs);
for (cnt = 0;
(NULL != new_dkp) && (cnt < MELT_NEW_COINS) && (NULL != new_dkp[cnt]);