reworked initialization

This commit is contained in:
Fournier Nicolas 2015-08-10 15:11:02 +02:00
parent 7328d1fa28
commit b02dc90ba0
4 changed files with 588 additions and 306 deletions

View File

@ -26,7 +26,7 @@
#define NB_DENOMINATION_SAVE 15
#define BIGGER 10
#define BIG 4
#define BIG 10
#define NB_RESERVE_INIT BIGGER
#define NB_RESERVE_SAVE BIG
@ -53,24 +53,28 @@ main (int argc, char ** argv)
PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop",
NB_DENOMINATION_INIT),
PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
"01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
"01 - denomination loop",
"01 - denomination",
NB_DENOMINATION_SAVE),
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("01 - end",
"01 - denomination loop"),
// End of initialization
// Reserve initialization
PERF_TALER_MINTDB_INIT_CMD_LOOP ("02 - init reserve loop",
NB_RESERVE_INIT),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
"02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
"02 - init reserve loop",
"02 - reserve",
NB_RESERVE_SAVE),
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("02 - end",
"02 - init reserve loop"),
// End reserve init
// Withdrawal initialization
@ -83,15 +87,17 @@ main (int argc, char ** argv)
PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
"03 - init withdraw loop",
"02 - save reserve"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - withdraw",
PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
"03 - denomination load",
"03 - reserve load"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert",
"03 - withdraw"),
PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("03 - save coin",
"03 - init withdraw loop",
"03 - withdraw",
NB_WITHDRAW_SAVE),
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("03 - end",
"03 - init withdraw loop"),
//End of withdrawal initialization
//Deposit initialization
@ -101,8 +107,10 @@ main (int argc, char ** argv)
PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("04 - coin load",
"04 - deposit init loop",
"03 - save coin"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("04 - deposit",
PERF_TALER_MINTDB_INIT_CMD_CREATE_DEPOSIT ("04 - deposit",
"04 - coin load"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("04 - insert",
"04 - deposit"),
PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array",
"04 - deposit init loop",
@ -117,11 +125,13 @@ main (int argc, char ** argv)
PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("05 - start"),
PERF_TALER_MINTDB_INIT_CMD_LOOP ("05 - reserve insert measure",
NB_RESERVE_SAVE),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE (""),
PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("05 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("05 - insert",
"05 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
"05 - reserve insert measure"),
PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("05 - stop"),
PERF_TALER_MINTDB_INIT_CMD_GAUGER ("",
PERF_TALER_MINTDB_INIT_CMD_GAUGER ("05 - gauger",
"05 - start",
"05 - stop",
"POSTGRES",
@ -136,7 +146,7 @@ main (int argc, char ** argv)
PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("06 - reserve",
"06 - reserve load measure",
"02 - save reserve"),
PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE ("",
PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE ("06 - get",
"06 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
"06 - reserve load measure"),
@ -180,9 +190,11 @@ main (int argc, char ** argv)
PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("08 - denomination",
"08 - withdraw insert measure",
"01 - save denomination"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("",
PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW ("08 - withdraw",
"08 - denomination",
"08 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("08 - insert",
"08 - withdraw"),
PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("",
"08 - withdraw insert measure"),
PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("08 - stop"),

View File

@ -385,55 +385,81 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT:
{
int ret;
ret = cmd_find( cmd,
cmd[i].details.insert_deposit.label_coin);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.insert_deposit.label_coin);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_deposit.label_coin);
return GNUNET_SYSERR;
}
cmd[i].details.insert_deposit.index_coin = ret;
}
break;
case PERF_TALER_MINTDB_CMD_GET_DEPOSIT:
case PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION:
{
int ret;
ret = cmd_find (cmd,
cmd[i].details.get_deposit.label_deposit);
cmd[i].details.insert_denomination.label_denom);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.get_deposit.label_deposit);
cmd[i].details.insert_denomination.label_denom);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_DEPOSIT != cmd[ret].exposed.type)
if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_deposit.label_deposit);
cmd[i].details.insert_denomination.label_denom);
return GNUNET_SYSERR;
}
cmd[i].details.get_deposit.index_deposit = ret;
cmd[i].details.insert_denomination.index_denom = ret;
}
break;
case PERF_TALER_MINTDB_CMD_GET_DENOMINATION:
{
int ret;
ret = cmd_find (cmd,
cmd[i].details.get_denomination.label_denom);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.get_denomination.label_denom);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_denomination.label_denom);
return GNUNET_SYSERR;
}
cmd[i].details.get_denomination.index_denom = ret;
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_RESERVE:
{
int ret;
ret = cmd_find (cmd,
cmd[i].details.insert_reserve.label_reserve);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.insert_reserve.label_reserve);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_RESERVE != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_reserve.label_reserve);
return GNUNET_SYSERR;
}
cmd[i].details.insert_reserve.index_reserve = ret;
}
break;
@ -489,29 +515,52 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
case PERF_TALER_MINTDB_CMD_GET_DENOMINATION:
case PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW:
{
int ret;
ret = cmd_find (cmd,
cmd[i].details.get_denomination.label_denom);
if (GNUNET_SYSERR == ret)
cmd[i].details.create_withdraw.label_dki);
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.get_denomination.label_denom);
return GNUNET_SYSERR;
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.create_withdraw.label_dki);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.create_withdraw.label_dki);
return GNUNET_SYSERR;
}
}
if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
cmd[i].details.create_withdraw.index_dki = ret;
ret = cmd_find (cmd,
cmd[i].details.create_withdraw.label_reserve);
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_denomination.label_denom);
return GNUNET_SYSERR;
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.create_withdraw.label_reserve);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_RESERVE != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.create_withdraw.label_reserve);
return GNUNET_SYSERR;
}
}
cmd[i].details.get_denomination.index_denom = ret;
cmd[i].details.create_withdraw.index_reserve = ret;
}
break;
@ -520,44 +569,24 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
int ret;
ret = cmd_find (cmd,
cmd[i].details.insert_withdraw.label_dki);
cmd[i].details.insert_withdraw.label_coin);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.insert_withdraw.label_dki);
cmd[i].details.insert_withdraw.label_coin);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_DENOMINATION_INFO != cmd[ret].exposed.type)
if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_withdraw.label_dki);
cmd[i].details.insert_withdraw.label_coin);
return GNUNET_SYSERR;
}
cmd[i].details.insert_withdraw.index_dki = ret;
ret = cmd_find (cmd,
cmd[i].details.insert_withdraw.label_reserve);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.insert_withdraw.label_reserve);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_RESERVE != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_withdraw.label_reserve);
return GNUNET_SYSERR;
}
cmd[i].details.insert_withdraw.index_reserve = ret;
cmd[i].details.insert_withdraw.index_coin = ret;
}
break;
@ -566,7 +595,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
int ret;
ret = cmd_find (cmd,
cmd[i].details.get_withdraw.label_coin);
cmd[i].details.get_withdraw.label_coin);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@ -587,6 +616,110 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
}
break;
case PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION:
{
int ret;
ret = cmd_find (cmd,
cmd[i].details.get_coin_transaction.label_coin);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.get_coin_transaction.label_coin);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_coin_transaction.label_coin);
return GNUNET_SYSERR;
}
cmd[i].details.get_coin_transaction.index_coin = ret;
}
break;
case PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT:
{
int ret;
ret = cmd_find (cmd,
cmd[i].details.create_deposit.label_coin);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.create_deposit.label_coin);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_COIN != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.create_deposit.label_coin);
return GNUNET_SYSERR;
}
cmd[i].details.create_deposit.index_coin = ret;
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT:
{
int ret;
ret = cmd_find( cmd,
cmd[i].details.insert_deposit.label_deposit);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.insert_deposit.label_deposit);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_DEPOSIT != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.insert_deposit.label_deposit);
return GNUNET_SYSERR;
}
cmd[i].details.insert_deposit.index_deposit = ret;
}
break;
case PERF_TALER_MINTDB_CMD_GET_DEPOSIT:
{
int ret;
ret = cmd_find (cmd,
cmd[i].details.get_deposit.label_deposit);
if (GNUNET_SYSERR == ret)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Undefined reference to %s\n",
i,
cmd[i].details.get_deposit.label_deposit);
return GNUNET_SYSERR;
}
if (PERF_TALER_MINTDB_DEPOSIT != cmd[ret].exposed.type)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"%d:Wrong type reference to %s\n",
i,
cmd[i].details.get_deposit.label_deposit);
return GNUNET_SYSERR;
}
cmd[i].details.get_deposit.index_deposit = ret;
}
break;
case PERF_TALER_MINTDB_CMD_END:
case PERF_TALER_MINTDB_CMD_DEBUG:
case PERF_TALER_MINTDB_CMD_LOOP:
@ -594,8 +727,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[])
case PERF_TALER_MINTDB_CMD_COMMIT_TRANSACTION:
case PERF_TALER_MINTDB_CMD_ABORT_TRANSACTION:
case PERF_TALER_MINTDB_CMD_GET_TIME:
case PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION:
case PERF_TALER_MINTDB_CMD_INSERT_RESERVE:
case PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION:
case PERF_TALER_MINTDB_CMD_CREATE_RESERVE:
break;
default:
@ -873,30 +1006,39 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
interprete_load_random (state);
break;
case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT:
case PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT:
{
int coin_index;
struct TALER_MINTDB_Deposit *deposit;
coin_index = state->cmd[state->i].details.insert_deposit.index_coin;
coin_index = state->cmd[state->i].details.create_deposit.index_coin;
deposit = PERF_TALER_MINTDB_deposit_init (state->cmd[coin_index].exposed.data.coin);
GNUNET_assert (NULL != deposit);
state->cmd[state->i].exposed.data.deposit = deposit;
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT:
{
int deposit_index;
struct TALER_MINTDB_Deposit *deposit;
deposit_index = state->cmd[state->i].details.insert_deposit.index_deposit;
deposit = state->cmd[deposit_index].exposed.data.deposit;
GNUNET_assert (GNUNET_OK ==
state->plugin->insert_deposit (state->plugin->cls,
state->session,
deposit));
state->plugin->insert_deposit (state->plugin->cls,
state->session,
deposit));
state->cmd[state->i].exposed.data.deposit = deposit;
}
break;
case PERF_TALER_MINTDB_CMD_GET_DEPOSIT:
{
int source_index;
unsigned int source_index;
struct PERF_TALER_MINTDB_Data *data;
source_index = cmd_find (state->cmd,
state->cmd[state->i].details.get_deposit.label_deposit);
GNUNET_assert (GNUNET_SYSERR != source_index);
source_index = state->cmd[state->i].details.get_deposit.index_deposit;
data = &state->cmd[source_index].exposed;
state->plugin->have_deposit (state->plugin->cls,
state->session,
@ -904,16 +1046,28 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_RESERVE:
case PERF_TALER_MINTDB_CMD_CREATE_RESERVE:
{
struct PERF_TALER_MINTDB_Reserve *reserve;
json_t *details = NULL;
GNUNET_assert (NULL !=
(details = json_pack ("{s:i}","justification",
GNUNET_CRYPTO_random_u32 (
GNUNET_CRYPTO_QUALITY_WEAK,
UINT32_MAX))));
reserve = PERF_TALER_MINTDB_reserve_init ();
state->cmd[state->i].exposed.data.reserve = reserve;
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_RESERVE:
{
unsigned int reserve_index;
struct PERF_TALER_MINTDB_Reserve *reserve;
json_t *details = NULL;
reserve_index = state->cmd[state->i].details.insert_reserve.index_reserve;
reserve = state->cmd[reserve_index].exposed.data.reserve;
details = json_pack ("{s:i}","justification",
GNUNET_CRYPTO_random_u32 (
GNUNET_CRYPTO_QUALITY_WEAK,
UINT32_MAX));
GNUNET_assert (NULL != details);
state->plugin->reserves_in_insert (
state->plugin->cls,
state->session,
@ -923,134 +1077,139 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
details
);
json_decref (details);
state->cmd[state->i].exposed.data.reserve = reserve;
}
break;
case PERF_TALER_MINTDB_CMD_GET_RESERVE:
{
int reserve_index;
int ret;
struct PERF_TALER_MINTDB_Data *data;
GNUNET_assert (GNUNET_SYSERR !=
(reserve_index = cmd_find (state->cmd,
state->cmd[state->i]
.details.get_reserve.label_reserve)));
reserve_index = state->cmd[state->i].details.get_reserve.index_reserve;
data = &state->cmd[reserve_index].exposed;
GNUNET_assert (GNUNET_OK ==
(state->plugin->reserve_get (state->plugin->cls,
state->session,
&data->data.reserve->reserve)));
ret = state->plugin->reserve_get (state->plugin->cls,
state->session,
&data->data.reserve->reserve);
GNUNET_assert (GNUNET_OK == ret);
}
break;
case PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY:
{
int reserve_index;
struct TALER_MINTDB_ReserveHistory *history;
struct PERF_TALER_MINTDB_Data *data;
int reserve_index;
struct TALER_MINTDB_ReserveHistory *history;
struct PERF_TALER_MINTDB_Data *data;
GNUNET_assert (GNUNET_SYSERR !=
(reserve_index = cmd_find (state->cmd,
state->cmd[state->i]
.details.get_reserve_history.label_reserve)));
data = &state->cmd[reserve_index].exposed;
GNUNET_assert (NULL !=
(history = state->plugin->get_reserve_history (state->plugin->cls,
state->session,
&data->data.reserve->reserve.pub)));
state->plugin->free_reserve_history (state->plugin->cls,
history);
reserve_index = state->cmd[state->i].details.get_reserve_history.index_reserve;
data = &state->cmd[reserve_index].exposed;
history = state->plugin->get_reserve_history (state->plugin->cls,
state->session,
&data->data.reserve->reserve.pub);
GNUNET_assert (NULL != history);
state->plugin->free_reserve_history (state->plugin->cls,
history);
}
break;
case PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION:
{
struct TALER_MINTDB_DenominationKeyIssueInformation *dki =
PERF_TALER_MINTDB_denomination_init ();
state->cmd[state->i].exposed.data.dki = dki;
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION:
{
struct TALER_MINTDB_DenominationKeyIssueInformation *dki =
PERF_TALER_MINTDB_denomination_init ();
unsigned int denom_index;
int ret;
struct TALER_MINTDB_DenominationKeyIssueInformation *dki ;
state->plugin->insert_denomination_info (state->plugin->cls,
state->session,
&dki->denom_pub,
&dki->issue);
state->cmd[state->i].exposed.data.dki = dki;
denom_index = state->cmd[state->i].details.insert_denomination.index_denom;
dki = state->cmd[denom_index].exposed.data.dki;
ret = state->plugin->insert_denomination_info (state->plugin->cls,
state->session,
&dki->denom_pub,
&dki->issue);
GNUNET_assert (GNUNET_SYSERR != ret);
}
break;
case PERF_TALER_MINTDB_CMD_GET_DENOMINATION:
{
int source_index;
unsigned int denom_index;
int ret;
struct PERF_TALER_MINTDB_Data *data;
GNUNET_assert (GNUNET_SYSERR !=
(source_index = cmd_find (state->cmd,
state->cmd[state->i]
.details.get_denomination.label_denom)));
data = &state->cmd[source_index].exposed;
state->plugin->get_denomination_info (state->plugin->cls,
state->session,
&data->data.dki->denom_pub,
&data->data.dki->issue);
denom_index = state->cmd[state->i].details.get_denomination.index_denom;
data = &state->cmd[denom_index].exposed;
ret = state->plugin->get_denomination_info (state->plugin->cls,
state->session,
&data->data.dki->denom_pub,
&data->data.dki->issue);
GNUNET_assert (GNUNET_SYSERR != ret);
}
break;
case PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW:
{
int dki_index, reserve_index;
struct PERF_TALER_MINTDB_Coin *coin ;
dki_index = state->cmd[state->i].details.create_withdraw.index_dki;
reserve_index = state->cmd[state->i].details.create_withdraw.index_reserve;
coin = PERF_TALER_MINTDB_coin_init (state->cmd[dki_index].exposed.data.dki,
state->cmd[reserve_index].exposed.data.reserve);
GNUNET_assert (NULL != coin);
state->cmd[state->i].exposed.data.coin = coin;
}
break;
case PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW:
{
int dki_index, reserve_index;
unsigned int coin_index;
int ret;
struct PERF_TALER_MINTDB_Coin *coin ;
GNUNET_assert (GNUNET_SYSERR !=
(dki_index = cmd_find (
state->cmd,
state->cmd[state->i].details.insert_withdraw.label_dki)));
GNUNET_assert (GNUNET_SYSERR !=
(reserve_index = cmd_find (
state->cmd,
state->cmd[state->i].details.insert_withdraw.label_reserve)));
GNUNET_assert (NULL !=
(coin =
PERF_TALER_MINTDB_coin_init (
state->cmd[dki_index].exposed.data.dki,
state->cmd[reserve_index].exposed.data.reserve)));
state->plugin->insert_withdraw_info (state->plugin->cls,
state->session,
&coin->blind);
state->cmd[state->i].exposed.data.coin = coin;
coin_index = state->cmd[state->i].details.insert_withdraw.index_coin;
coin = state->cmd[coin_index].exposed.data.coin;
ret = state->plugin->insert_withdraw_info (state->plugin->cls,
state->session,
&coin->blind);
GNUNET_assert (GNUNET_SYSERR != ret);
}
break;
case PERF_TALER_MINTDB_CMD_GET_WITHDRAW:
{
int source_index;
unsigned int source_index;
int ret;
struct PERF_TALER_MINTDB_Data *data;
GNUNET_assert (GNUNET_SYSERR !=
(source_index = cmd_find (state->cmd,
state->cmd[state->i]
.details.get_denomination.label_denom)));
source_index = state->cmd[state->i].details.get_denomination.index_denom;
data = &state->cmd[source_index].exposed;
state->plugin->get_withdraw_info (state->plugin->cls,
state->session,
&data->data.coin->blind.h_coin_envelope,
&data->data.coin->blind);
ret = state->plugin->get_withdraw_info (state->plugin->cls,
state->session,
&data->data.coin->blind.h_coin_envelope,
&data->data.coin->blind);
GNUNET_assert (GNUNET_SYSERR != ret);
}
break;
case PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION:
{
int coin_index;
unsigned int coin_index;
struct PERF_TALER_MINTDB_Coin *coin;
struct TALER_MINTDB_TransactionList *transactions;
coin_index = cmd_find (state->cmd,
state->cmd[state->i].details.get_coin_transaction.label_coin);
GNUNET_assert (GNUNET_SYSERR != coin_index);
coin_index = state->cmd[state->i].details.get_coin_transaction.index_coin;
coin = state->cmd[coin_index].exposed.data.coin;
transactions = state->plugin->get_coin_transactions (state->plugin->cls,
state->session,
&coin->public_info.coin_pub);
GNUNET_assert (transactions != NULL);
state->plugin->free_coin_transaction_list (state->plugin->cls,
transactions);
}
@ -1144,7 +1303,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state)
state->cmd[state->i].details.insert_refresh_order.label_hash);
GNUNET_assert (GNUNET_SYSERR != hash_index);
denom_index = cmd_find (state->cmd,
state->cmd[state->i].details.insert_refresh_order.label_denom);
state->cmd[state->i].details.insert_refresh_order.label_denom);
GNUNET_assert (GNUNET_SYSERR != denom_index);
session_hash = state->cmd[hash_index].exposed.data.session_hash;
denom = state->cmd[denom_index].exposed.data.dki;
@ -1282,7 +1441,9 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop",
PERF_TALER_MINTDB_NB_DENOMINATION_INIT),
PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION (""),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
"01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
"01 - denomination loop",
@ -1295,7 +1456,9 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
// Reserve initialization
PERF_TALER_MINTDB_INIT_CMD_LOOP ("02 - init reserve loop",
PERF_TALER_MINTDB_NB_RESERVE_INIT),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
"02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
"02 - init reserve loop",
"02 - reserve",
@ -1314,9 +1477,11 @@ PERF_TALER_MINTDB_run_benchmark (const char *benchmark_name,
PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load",
"03 - init withdraw loop",
"02 - save reserve"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - withdraw",
PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW ("03 - withdraw",
"03 - denomination load",
"03 - reserve load"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - insert",
"03 - withdraw"),
PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION (""),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("03 - save coin",
"03 - init withdraw loop",

View File

@ -216,17 +216,31 @@
}
/**
* Inserts informations about a denomination key in the database
* Create a denomination key to use
* Exposes a #PERF_TALER_MINTDB_DENOMINATION_INFO to be used by other commands
* @exposed #PERF_TALER_MINTDB_DENOMINATION_INFO
*
* @param _label the label of this command
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label) \
#define PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION(_label) \
{ \
.command = PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_DENOMINATION_INFO, \
}
/**
* Inserts informations about a denomination key in the database
*
* @param _label the label of this command
* @param _label_denom the label of the denomination to insert
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label, _label_denom) \
{ \
.command = PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_DENOMINATION_INFO, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.insert_denomination.label_denom = _label_denom, \
}
/**
@ -240,24 +254,35 @@
.command = PERF_TALER_MINTDB_CMD_GET_DENOMINATION, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.get_denomination.label_denom = _label_denom, \
.details.get_denomination.label_denom = _label_denom \
}
/**
* Creates a new reserve in the database containing 1000 Euros
* Create a reserve to be used later
* Exposes a #PERF_TALER_MINTDB_RESERVE
*
* @exposed #PERF_TALER_MINTDB_RESERVE
*
* @param _label the name of this command
* @param _label the label of the command
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE(_label) \
#define PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE(_label) \
{ \
.command = PERF_TALER_MINTDB_CMD_INSERT_RESERVE, \
.command = PERF_TALER_MINTDB_CMD_CREATE_RESERVE, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_RESERVE \
}
/**
* Insert a new reserve in the database containing 1000 Euros
*
* @param _label the name of this command
* @param _label_reserve the label of the reserve to insert
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE(_label, _label_reserve) \
{ \
.command = PERF_TALER_MINTDB_CMD_INSERT_RESERVE, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.insert_reserve.label_reserve = _label_reserve \
}
/**
* Polls the database for a secific reserve's details
@ -273,7 +298,6 @@
.details.get_reserve.label_reserve = _label_reserve \
}
/**
* Polls the database for the history of a reserve
*
@ -288,80 +312,38 @@
.details.get_reserve_history.label_reserve = _label_reserve \
}
/**
* Insert a deposit into the database
*
* @exposes #PERF_TALER_MINTDB_DEPOSIT
* Creates a coin to be used later
*
* @param _label the label of this command
* @param _label_coin the coin used to pay
* @param _label_dki denomination key used to sign the coin
* @param _label_reserve reserve used to emmit the coin
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_coin) \
#define PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW(_label, _label_dki, _label_reserve) \
{ \
.command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\
.command = PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_DEPOSIT, \
.details.insert_deposit.label_coin = _label_coin, \
.exposed.type = PERF_TALER_MINTDB_COIN, \
.details.create_withdraw = {\
.label_dki = _label_dki, \
.label_reserve = _label_reserve, \
} \
}
/**
* Check if a deposit is in the database
*
* @param _label the label of this command
* @param _label_deposit the deposit to use
*/
#define PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \
{ \
.command = PERF_TALER_MINTDB_CMD_GET_DEPOSIT, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.get_deposit.label_deposit = _label_deposit \
}
/**
* Access the transactioj history of a coin
*
* @param _label the label of the command
* @param _label_coin the coin which history is checked
*/
#define PERF_TALER_MINTDB_INIT_CMD_GET_COIN_TRANSACTION(_label, _label_coin) \
{ \
.command = PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.get_coin_transaction.label_coin = _label_coin \
}
/**
* the /deposit API call
*/
#define PERF_TALER_MONTDB_INIT_CMD_DEPOSIT(_label, _label_coin)\
PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT (_label ":insert deposit", _label_coin), \
PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT (_label ":get deposit", _label ":insert deposit")
/**
* Inserts informations about a withdrawal in the database
*
* @exposes #PERF_TALER_MINTDB_COIN
*
* @param _label the label of this command
* @param _label_dki denomination key used to sign the coin
* @param _label_reserve reserve used to emmit the coin
* @param _label_coin the coin to insert
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label, _label_dki, _label_reserve) \
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label, _label_coin) \
{ \
.command = PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_COIN, \
.details.insert_withdraw = {\
.label_dki = _label_dki, \
.label_reserve = _label_reserve, \
} \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.insert_withdraw.label_coin = _label_coin\
}
@ -390,12 +372,70 @@
* @param _label_reserve the reserve used to provide currency
*/
#define PERF_TALER_MINTDB_INIT_CMD_WITHDRAW_SIGN(_label, _label_dki, _label_reserve) \
PERF_TALER_MINTDB_INIT_CMD_CREATE_WITHDRAW (_label "withdraw", \
_label_dki, \
_label_reserve), \
PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE_HISTORY(_label "reserve_history", \
_label_reserve), \
PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label "insert withdraw", \
_label_dki, \
_label_reserve)
_label "withdraw")
/**
* Create a deposit for use later
* @exposes #PERF_TALER_MINTDB_DEPOSIT
*
* @param _label the label of this command
* @param _label_coin the coin used to pay
*/
#define PERF_TALER_MINTDB_INIT_CMD_CREATE_DEPOSIT(_label, _label_coin) \
{ \
.command = PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_DEPOSIT, \
.details.create_deposit.label_coin = _label_coin, \
}
/**
* Insert a deposit into the database
*
* @param _label the label of this command
* @param _label_deposit the deposit inseerted
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_deposit) \
{ \
.command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.insert_deposit.label_deposit = _label_deposit, \
}
/**
* Check if a deposit is in the database
*
* @param _label the label of this command
* @param _label_deposit the deposit to use
*/
#define PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \
{ \
.command = PERF_TALER_MINTDB_CMD_GET_DEPOSIT, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.get_deposit.label_deposit = _label_deposit \
}
/**
* Access the transaction history of a coin
*
* @param _label the label of the command
* @param _label_coin the coin which history is checked
*/
#define PERF_TALER_MINTDB_INIT_CMD_GET_COIN_TRANSACTION(_label, _label_coin) \
{ \
.command = PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION, \
.label = _label, \
.exposed.type = PERF_TALER_MINTDB_NONE, \
.details.get_coin_transaction.label_coin = _label_coin \
}
/**
* The /deposit api call
@ -406,8 +446,10 @@
#define PERF_TALER_MINTDB_INIT_CMD_DEPOSIT(_label, _label_coin) \
PERF_TALER_MINTDB_INIT_CMD_GET_COIN_TRANSACTION (_label "coin history", \
_label_coin), \
PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT (_label "deposit", \
_label_coin)
PERF_TALER_MINTDB_INIT_CMD_CREATE_DEPOSIT (_label "deposit", \
_label_coin), \
PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT (_label "insert", \
_label "deposit")
/**
@ -417,10 +459,10 @@ enum PERF_TALER_MINTDB_Type
{
PERF_TALER_MINTDB_NONE,
PERF_TALER_MINTDB_TIME,
PERF_TALER_MINTDB_DEPOSIT,
PERF_TALER_MINTDB_COIN,
PERF_TALER_MINTDB_RESERVE,
PERF_TALER_MINTDB_DENOMINATION_INFO,
PERF_TALER_MINTDB_RESERVE,
PERF_TALER_MINTDB_COIN,
PERF_TALER_MINTDB_DEPOSIT,
PERF_TALER_MINTDB_REFRESH_HASH
};
@ -527,14 +569,24 @@ enum PERF_TALER_MINTDB_CMD_Name
PERF_TALER_MINTDB_CMD_LOAD_RANDOM,
/**
* Insert a deposit into the database
* Create a denomination to be used later
*/
PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,
PERF_TALER_MINTDB_CMD_CREATE_DENOMINATION,
/**
* Check if a deposit is in the database
* Insert informations about a denomination key in the database
*/
PERF_TALER_MINTDB_CMD_GET_DEPOSIT,
PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION,
/**
* Polls the database for informations about a specific denomination key
*/
PERF_TALER_MINTDB_CMD_GET_DENOMINATION,
/**
* Create a reserve to be used later
*/
PERF_TALER_MINTDB_CMD_CREATE_RESERVE,
/**
* Insert currency in a reserve / Create a reserve
@ -551,6 +603,11 @@ enum PERF_TALER_MINTDB_CMD_Name
*/
PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY,
/**
* Create a withdrawal to be used later
*/
PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW,
/**
* Insert informations about a withdrawal in the database
*/
@ -561,21 +618,26 @@ enum PERF_TALER_MINTDB_CMD_Name
*/
PERF_TALER_MINTDB_CMD_GET_WITHDRAW,
/**
* Insert informations about a denomination key in the database
*/
PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION,
/**
* Polls the database for informations about a specific denomination key
*/
PERF_TALER_MINTDB_CMD_GET_DENOMINATION,
/**
* Get the list of all transactions the coin has been in
*/
PERF_TALER_MINTDB_CMD_GET_COIN_TRANSACTION,
/**
* Create a deposit to be used later
*/
PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT,
/**
* Insert a deposit into the database
*/
PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,
/**
* Check if a deposit is in the database
*/
PERF_TALER_MINTDB_CMD_GET_DEPOSIT,
/**
* Create a refresh session
* The number of melted coins is 1,
@ -672,7 +734,6 @@ union PERF_TALER_MINTDB_CMD_Details
unsigned int curr_iteration;
} loop;
/**
* Extra data requiered by the #PERF_TALER_MINTDB_CMD_END_LOOP command
*/
@ -685,7 +746,6 @@ union PERF_TALER_MINTDB_CMD_Details
unsigned int index_loop;
} end_loop;
/**
* Details about the #PERF_TALER_MINTDB_CMD_GAUGER command
*/
@ -725,7 +785,6 @@ union PERF_TALER_MINTDB_CMD_Details
float divide;
} gauger;
/**
* Contains extra data requiered by the #PERF_TALER_MINTDB_CMD_SAVE_ARRAY command
*/
@ -766,7 +825,6 @@ union PERF_TALER_MINTDB_CMD_Details
} save_array;
/**
* Extra data required for the #PERF_TALER_MINTDB_CMD_LOAD_ARRAY command
*/
@ -790,7 +848,6 @@ union PERF_TALER_MINTDB_CMD_Details
unsigned int *permutation;
} load_array;
/**
* Contains data for the #PERF_TALER_MINTDB_CMD_LOAD_RANDOM command
*/
@ -804,56 +861,16 @@ union PERF_TALER_MINTDB_CMD_Details
} load_random;
/**
* Data used by the #PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT command
* Extra data requiered by the #PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION command
*/
struct PERF_TALER_MINTDB_CMD_insertDepositDetails
struct PERF_TALER_MINTDB_CMD_insertDenominationDetails
{
/**
* Label of the source where the reserve used to create the coin is
* The label of the source of the denomination to insert
*/
const char *label_coin;
unsigned int index_coin;
} insert_deposit;
/**
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_DEPOSIT command
*/
struct PERF_TALER_MINTDB_CMD_getDepositDetails
{
/**
* The label of the source of the deposit to check
*/
const char *label_deposit;
unsigned int index_deposit;
} get_deposit;
/**
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_RESERVE command
*/
struct PERF_TALER_MINTDB_CMD_getReserveDetails
{
/**
* The label of the source of the reserve to check
*/
const char *label_reserve;
unsigned int index_reserve;
} get_reserve;
/**
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_RESERVE command
*/
struct PERF_TALER_MINTDB_CMD_getReserveHistoryDetails
{
/**
* The label of the source of the reserve to check
*/
const char *label_reserve;
unsigned int index_reserve;
} get_reserve_history;
const char *label_denom;
unsigned int index_denom;
} insert_denomination;
/**
* Extra data requiered by the #PERF_TALER_MINTDB_CMD_GET_DENOMINATION command
@ -867,11 +884,46 @@ union PERF_TALER_MINTDB_CMD_Details
unsigned int index_denom;
} get_denomination;
/**
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_RESERVE command
*/
struct PERF_TALER_MINTDB_CMD_insertReserveDetails
{
/**
* The label of the source of the reserve to insert
*/
const char *label_reserve;
unsigned int index_reserve;
} insert_reserve;
/**
* Extra data related to the #PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW command
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_RESERVE command
*/
struct PERF_TALER_MINTDB_CMD_insertWithdrawDetails
struct PERF_TALER_MINTDB_CMD_getReserveDetails
{
/**
* The label of the source of the reserve to check
*/
const char *label_reserve;
unsigned int index_reserve;
} get_reserve;
/**
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_RESERVE_HISTORY command
*/
struct PERF_TALER_MINTDB_CMD_getReserveHistoryDetails
{
/**
* The label of the source of the reserve to check
*/
const char *label_reserve;
unsigned int index_reserve;
} get_reserve_history;
/**
* Extra data related to the #PERF_TALER_MINTDB_CMD_CREATE_WITHDRAW command
*/
struct PERF_TALER_MINTDB_CMD_createWithdrawDetails
{
/**
* label of the denomination key used to sign the coin
@ -884,6 +936,18 @@ union PERF_TALER_MINTDB_CMD_Details
*/
const char *label_reserve;
unsigned int index_reserve;
} create_withdraw;
/**
* data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW
*/
struct PERF_TALER_MINTDB_CMD_insertWithdrawDetails
{
/**
* label of the source for the coin information
*/
const char *label_coin;
unsigned int index_coin;
} insert_withdraw;
/**
@ -911,6 +975,42 @@ union PERF_TALER_MINTDB_CMD_Details
} get_coin_transaction;
/**
* Data used by the #PERF_TALER_MINTDB_CMD_CREATE_DEPOSIT command
*/
struct PERF_TALER_MINTDB_CMD_createDepositDetails
{
/**
* Label of the source where the reserve used to create the coin is
*/
const char *label_coin;
unsigned int index_coin;
} create_deposit;
/**
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT command
*/
struct PERF_TALER_MINTDB_CMD_insertDepositDetails
{
/**
* The label of the source of the deposit to check
*/
const char *label_deposit;
unsigned int index_deposit;
} insert_deposit;
/**
* Extra data requiered for the #PERF_TALER_MINTDB_CMD_GET_DEPOSIT command
*/
struct PERF_TALER_MINTDB_CMD_getDepositDetails
{
/**
* The label of the source of the deposit to check
*/
const char *label_deposit;
unsigned int index_deposit;
} get_deposit;
/**
* Data requiered for the #PERF_TALER_MINTDB_CMD_GET_REFRESH_SESSION command
*/
struct PERF_TALER_MINTDB_CMD_getRefreshSessionDetails

View File

@ -88,7 +88,9 @@ main (int argc, char ** argv)
PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop",
NB_DENOMINATION_INIT),
PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("01 - start transaction"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_CREATE_DENOMINATION ("01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - insert",
"01 - denomination"),
PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("01 - commit transaction"),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination",
"01 - denomination loop",
@ -101,7 +103,10 @@ main (int argc, char ** argv)
// Reserve initialization
PERF_TALER_MINTDB_INIT_CMD_LOOP ("02 - init reserve loop",
NB_RESERVE_INIT),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_CREATE_RESERVE ("02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - insert",
"02 - reserve"),
PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve",
"02 - init reserve loop",
"02 - reserve",