Finishing with #4709
This commit is contained in:
parent
ac554444b1
commit
6cd80e71f8
@ -78,6 +78,12 @@ dead_prepare_cb (void *cls,
|
|||||||
GNUNET_assert (0);
|
GNUNET_assert (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Counter used in auditor-related db functions. Used to count
|
||||||
|
* expected rows.
|
||||||
|
*/
|
||||||
|
unsigned int auditor_row_cnt;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback that is called with wire prepare data
|
* Callback that is called with wire prepare data
|
||||||
@ -122,6 +128,7 @@ audit_wire_cb (void *cls,
|
|||||||
size_t buf_size,
|
size_t buf_size,
|
||||||
int finished)
|
int finished)
|
||||||
{
|
{
|
||||||
|
auditor_row_cnt++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,12 +162,14 @@ test_wire_prepare (struct TALER_EXCHANGEDB_Session *session)
|
|||||||
session,
|
session,
|
||||||
&dead_prepare_cb,
|
&dead_prepare_cb,
|
||||||
NULL));
|
NULL));
|
||||||
|
auditor_row_cnt = 0;
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->select_prepare_above_serial_id (plugin->cls,
|
plugin->select_prepare_above_serial_id (plugin->cls,
|
||||||
session,
|
session,
|
||||||
0,
|
0,
|
||||||
&audit_wire_cb,
|
&audit_wire_cb,
|
||||||
NULL));
|
NULL));
|
||||||
|
FAILIF (1 != auditor_row_cnt);
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
drop:
|
drop:
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
@ -521,6 +530,7 @@ audit_refresh_session_cb (void *cls,
|
|||||||
uint16_t num_newcoins,
|
uint16_t num_newcoins,
|
||||||
uint16_t noreveal_index)
|
uint16_t noreveal_index)
|
||||||
{
|
{
|
||||||
|
auditor_row_cnt++;
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -597,11 +607,13 @@ test_melting (struct TALER_EXCHANGEDB_Session *session)
|
|||||||
&session_hash,
|
&session_hash,
|
||||||
&ret_refresh_session));
|
&ret_refresh_session));
|
||||||
|
|
||||||
|
auditor_row_cnt = 0;
|
||||||
FAILIF (GNUNET_OK != plugin->select_refreshs_above_serial_id (plugin->cls,
|
FAILIF (GNUNET_OK != plugin->select_refreshs_above_serial_id (plugin->cls,
|
||||||
session,
|
session,
|
||||||
0,
|
0,
|
||||||
&audit_refresh_session_cb,
|
&audit_refresh_session_cb,
|
||||||
NULL));
|
NULL));
|
||||||
|
FAILIF (1 != auditor_row_cnt);
|
||||||
FAILIF (ret_refresh_session.num_newcoins != refresh_session.num_newcoins);
|
FAILIF (ret_refresh_session.num_newcoins != refresh_session.num_newcoins);
|
||||||
FAILIF (ret_refresh_session.noreveal_index != refresh_session.noreveal_index);
|
FAILIF (ret_refresh_session.noreveal_index != refresh_session.noreveal_index);
|
||||||
|
|
||||||
@ -971,6 +983,7 @@ audit_deposit_cb (void *cls,
|
|||||||
const json_t *receiver_wire_account,
|
const json_t *receiver_wire_account,
|
||||||
int done)
|
int done)
|
||||||
{
|
{
|
||||||
|
auditor_row_cnt++;
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1001,6 +1014,7 @@ audit_refund_cb (void *cls,
|
|||||||
uint64_t rtransaction_id,
|
uint64_t rtransaction_id,
|
||||||
const struct TALER_Amount *amount_with_fee)
|
const struct TALER_Amount *amount_with_fee)
|
||||||
{
|
{
|
||||||
|
auditor_row_cnt++;
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1026,6 +1040,7 @@ audit_reserve_in_cb (void *cls,
|
|||||||
const json_t *transfer_details,
|
const json_t *transfer_details,
|
||||||
struct GNUNET_TIME_Absolute execution_date)
|
struct GNUNET_TIME_Absolute execution_date)
|
||||||
{
|
{
|
||||||
|
auditor_row_cnt++;
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,6 +1069,7 @@ audit_reserve_out_cb (void *cls,
|
|||||||
struct GNUNET_TIME_Absolute execution_date,
|
struct GNUNET_TIME_Absolute execution_date,
|
||||||
const struct TALER_Amount *amount_with_fee)
|
const struct TALER_Amount *amount_with_fee)
|
||||||
{
|
{
|
||||||
|
auditor_row_cnt++;
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1304,6 +1320,7 @@ run (void *cls)
|
|||||||
}
|
}
|
||||||
FAILIF (3 != cnt);
|
FAILIF (3 != cnt);
|
||||||
|
|
||||||
|
auditor_row_cnt = 0;
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->select_reserves_in_above_serial_id (plugin->cls,
|
plugin->select_reserves_in_above_serial_id (plugin->cls,
|
||||||
session,
|
session,
|
||||||
@ -1316,6 +1333,7 @@ run (void *cls)
|
|||||||
0,
|
0,
|
||||||
&audit_reserve_out_cb,
|
&audit_reserve_out_cb,
|
||||||
NULL));
|
NULL));
|
||||||
|
FAILIF (3 != auditor_row_cnt);
|
||||||
/* Tests for deposits */
|
/* Tests for deposits */
|
||||||
memset (&deposit, 0, sizeof (deposit));
|
memset (&deposit, 0, sizeof (deposit));
|
||||||
RND_BLK (&deposit.coin.coin_pub);
|
RND_BLK (&deposit.coin.coin_pub);
|
||||||
@ -1340,12 +1358,14 @@ run (void *cls)
|
|||||||
plugin->have_deposit (plugin->cls,
|
plugin->have_deposit (plugin->cls,
|
||||||
session,
|
session,
|
||||||
&deposit));
|
&deposit));
|
||||||
|
auditor_row_cnt = 0;
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->select_deposits_above_serial_id (plugin->cls,
|
plugin->select_deposits_above_serial_id (plugin->cls,
|
||||||
session,
|
session,
|
||||||
0,
|
0,
|
||||||
&audit_deposit_cb,
|
&audit_deposit_cb,
|
||||||
NULL));
|
NULL));
|
||||||
|
FAILIF (1 != auditor_row_cnt);
|
||||||
result = 9;
|
result = 9;
|
||||||
FAILIF (1 !=
|
FAILIF (1 !=
|
||||||
plugin->iterate_matching_deposits (plugin->cls,
|
plugin->iterate_matching_deposits (plugin->cls,
|
||||||
@ -1433,6 +1453,7 @@ run (void *cls)
|
|||||||
plugin->insert_refund (plugin->cls,
|
plugin->insert_refund (plugin->cls,
|
||||||
session,
|
session,
|
||||||
&refund));
|
&refund));
|
||||||
|
auditor_row_cnt = 0;
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->select_refunds_above_serial_id (plugin->cls,
|
plugin->select_refunds_above_serial_id (plugin->cls,
|
||||||
session,
|
session,
|
||||||
@ -1440,6 +1461,7 @@ run (void *cls)
|
|||||||
&audit_refund_cb,
|
&audit_refund_cb,
|
||||||
NULL));
|
NULL));
|
||||||
|
|
||||||
|
FAILIF (1 != auditor_row_cnt);
|
||||||
tl = plugin->get_coin_transactions (plugin->cls,
|
tl = plugin->get_coin_transactions (plugin->cls,
|
||||||
session,
|
session,
|
||||||
&refund.coin.coin_pub);
|
&refund.coin.coin_pub);
|
||||||
|
Loading…
Reference in New Issue
Block a user