be more careful with terminology
This commit is contained in:
parent
2c832199b2
commit
910e01d1c1
@ -53,15 +53,15 @@ run (void *cls)
|
|||||||
.details.admin_add_incoming.credit_account_no = 3,
|
.details.admin_add_incoming.credit_account_no = 3,
|
||||||
.details.admin_add_incoming.debit_account_no = 2,
|
.details.admin_add_incoming.debit_account_no = 2,
|
||||||
.details.admin_add_incoming.amount = "PUDOS:3.21" },
|
.details.admin_add_incoming.amount = "PUDOS:3.21" },
|
||||||
/* check transactions arrived at fakebank */
|
/* check transfers arrived at fakebank */
|
||||||
{ .oc = TBI_OC_EXPECT_TRANSACTION,
|
{ .oc = TBI_OC_EXPECT_TRANSFER,
|
||||||
.label = "expect-2",
|
.label = "expect-2",
|
||||||
.details.expect_transaction.cmd_ref = "deposit-2" },
|
.details.expect_transfer.cmd_ref = "deposit-2" },
|
||||||
{ .oc = TBI_OC_EXPECT_TRANSACTION,
|
{ .oc = TBI_OC_EXPECT_TRANSFER,
|
||||||
.label = "expect-1",
|
.label = "expect-1",
|
||||||
.details.expect_transaction.cmd_ref = "deposit-1" },
|
.details.expect_transfer.cmd_ref = "deposit-1" },
|
||||||
/* check transaction list is now empty */
|
/* check transfer list is now empty */
|
||||||
{ .oc = TBI_OC_EXPECT_TRANSACTIONS_EMPTY,
|
{ .oc = TBI_OC_EXPECT_TRANSFERS_EMPTY,
|
||||||
.label = "expect-empty" },
|
.label = "expect-empty" },
|
||||||
{ .oc = TBI_OC_END }
|
{ .oc = TBI_OC_END }
|
||||||
};
|
};
|
||||||
|
@ -235,9 +235,9 @@ interpreter_run (void *cls)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case TBI_OC_EXPECT_TRANSACTION:
|
case TBI_OC_EXPECT_TRANSFER:
|
||||||
ref = find_command (is,
|
ref = find_command (is,
|
||||||
cmd->details.expect_transaction.cmd_ref);
|
cmd->details.expect_transfer.cmd_ref);
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_string_to_amount (ref->details.admin_add_incoming.amount,
|
TALER_string_to_amount (ref->details.admin_add_incoming.amount,
|
||||||
&amount));
|
&amount));
|
||||||
@ -264,7 +264,7 @@ interpreter_run (void *cls)
|
|||||||
is->task = GNUNET_SCHEDULER_add_now (&interpreter_run,
|
is->task = GNUNET_SCHEDULER_add_now (&interpreter_run,
|
||||||
is);
|
is);
|
||||||
return;
|
return;
|
||||||
case TBI_OC_EXPECT_TRANSACTIONS_EMPTY:
|
case TBI_OC_EXPECT_TRANSFERS_EMPTY:
|
||||||
if (GNUNET_OK != FAKEBANK_check_empty (is->fakebank))
|
if (GNUNET_OK != FAKEBANK_check_empty (is->fakebank))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
|
@ -45,14 +45,14 @@ enum TBI_OpCode
|
|||||||
TBI_OC_ADMIN_ADD_INCOMING,
|
TBI_OC_ADMIN_ADD_INCOMING,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect that we have received the specified transaction at fakebank.
|
* Expect that we have received the specified transfer at fakebank.
|
||||||
*/
|
*/
|
||||||
TBI_OC_EXPECT_TRANSACTION,
|
TBI_OC_EXPECT_TRANSFER,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect that we have exhaustively gone over all transactions at fakebank.
|
* Expect that we have exhaustively gone over all transfers at fakebank.
|
||||||
*/
|
*/
|
||||||
TBI_OC_EXPECT_TRANSACTIONS_EMPTY
|
TBI_OC_EXPECT_TRANSFERS_EMPTY
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -118,8 +118,8 @@ struct TBI_Command
|
|||||||
} admin_add_incoming;
|
} admin_add_incoming;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If @e opcode is #TBI_OC_EXPECT_TRANSACTION, this
|
* If @e opcode is #TBI_OC_EXPECT_TRANSFER, this
|
||||||
* specifies which transaction we expected.
|
* specifies which transfer we expected.
|
||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ struct TBI_Command
|
|||||||
*/
|
*/
|
||||||
const char *cmd_ref;
|
const char *cmd_ref;
|
||||||
|
|
||||||
} expect_transaction;
|
} expect_transfer;
|
||||||
|
|
||||||
} details;
|
} details;
|
||||||
|
|
||||||
|
@ -139,12 +139,12 @@ enum OpCode
|
|||||||
/**
|
/**
|
||||||
* Check that the fakebank has received a certain transaction.
|
* Check that the fakebank has received a certain transaction.
|
||||||
*/
|
*/
|
||||||
OC_CHECK_BANK_DEPOSIT,
|
OC_CHECK_BANK_TRANSFER,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check that the fakebank has not received any other transactions.
|
* Check that the fakebank has not received any other transactions.
|
||||||
*/
|
*/
|
||||||
OC_CHECK_BANK_DEPOSITS_EMPTY
|
OC_CHECK_BANK_TRANSFERS_EMPTY
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ struct Command
|
|||||||
const char *deposit_ref;
|
const char *deposit_ref;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Which #OC_CHECK_BANK_DEPOSIT wtid should this match? NULL for none.
|
* Which #OC_CHECK_BANK_TRANSFER wtid should this match? NULL for none.
|
||||||
*/
|
*/
|
||||||
const char *bank_transfer_ref;
|
const char *bank_transfer_ref;
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ struct Command
|
|||||||
*/
|
*/
|
||||||
struct TALER_WireTransferIdentifierRawP wtid;
|
struct TALER_WireTransferIdentifierRawP wtid;
|
||||||
|
|
||||||
} check_bank_deposit;
|
} check_bank_transfer;
|
||||||
|
|
||||||
} details;
|
} details;
|
||||||
|
|
||||||
@ -1470,7 +1470,7 @@ deposit_wtid_cb (void *cls,
|
|||||||
cmd->details.deposit_wtid.bank_transfer_ref);
|
cmd->details.deposit_wtid.bank_transfer_ref);
|
||||||
GNUNET_assert (NULL != ref);
|
GNUNET_assert (NULL != ref);
|
||||||
if (0 != memcmp (wtid,
|
if (0 != memcmp (wtid,
|
||||||
&ref->details.check_bank_deposit.wtid,
|
&ref->details.check_bank_transfer.wtid,
|
||||||
sizeof (struct TALER_WireTransferIdentifierRawP)))
|
sizeof (struct TALER_WireTransferIdentifierRawP)))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -1976,8 +1976,8 @@ interpreter_run (void *cls)
|
|||||||
case OC_DEPOSIT_WTID:
|
case OC_DEPOSIT_WTID:
|
||||||
cmd->details.wire_deposits.wtid = ref->details.deposit_wtid.wtid;
|
cmd->details.wire_deposits.wtid = ref->details.deposit_wtid.wtid;
|
||||||
break;
|
break;
|
||||||
case OC_CHECK_BANK_DEPOSIT:
|
case OC_CHECK_BANK_TRANSFER:
|
||||||
cmd->details.wire_deposits.wtid = ref->details.check_bank_deposit.wtid;
|
cmd->details.wire_deposits.wtid = ref->details.check_bank_transfer.wtid;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -2079,10 +2079,10 @@ interpreter_run (void *cls)
|
|||||||
&maint_child_death, is);
|
&maint_child_death, is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case OC_CHECK_BANK_DEPOSIT:
|
case OC_CHECK_BANK_TRANSFER:
|
||||||
{
|
{
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
TALER_string_to_amount (cmd->details.check_bank_deposit.amount,
|
TALER_string_to_amount (cmd->details.check_bank_transfer.amount,
|
||||||
&amount))
|
&amount))
|
||||||
{
|
{
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
@ -2095,9 +2095,9 @@ interpreter_run (void *cls)
|
|||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
FAKEBANK_check (fakebank,
|
FAKEBANK_check (fakebank,
|
||||||
&amount,
|
&amount,
|
||||||
cmd->details.check_bank_deposit.account_debit,
|
cmd->details.check_bank_transfer.account_debit,
|
||||||
cmd->details.check_bank_deposit.account_credit,
|
cmd->details.check_bank_transfer.account_credit,
|
||||||
&cmd->details.check_bank_deposit.wtid))
|
&cmd->details.check_bank_transfer.wtid))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
fail (is);
|
fail (is);
|
||||||
@ -2106,7 +2106,7 @@ interpreter_run (void *cls)
|
|||||||
next_command (is);
|
next_command (is);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case OC_CHECK_BANK_DEPOSITS_EMPTY:
|
case OC_CHECK_BANK_TRANSFERS_EMPTY:
|
||||||
{
|
{
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
FAKEBANK_check_empty (fakebank))
|
FAKEBANK_check_empty (fakebank))
|
||||||
@ -2328,9 +2328,9 @@ do_shutdown (void *cls)
|
|||||||
cmd->details.run_aggregator.aggregator_proc = NULL;
|
cmd->details.run_aggregator.aggregator_proc = NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OC_CHECK_BANK_DEPOSIT:
|
case OC_CHECK_BANK_TRANSFER:
|
||||||
break;
|
break;
|
||||||
case OC_CHECK_BANK_DEPOSITS_EMPTY:
|
case OC_CHECK_BANK_TRANSFERS_EMPTY:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
@ -2646,39 +2646,39 @@ run (void *cls)
|
|||||||
{ .oc = OC_RUN_AGGREGATOR,
|
{ .oc = OC_RUN_AGGREGATOR,
|
||||||
.label = "run-aggregator" },
|
.label = "run-aggregator" },
|
||||||
|
|
||||||
{ .oc = OC_CHECK_BANK_DEPOSIT,
|
{ .oc = OC_CHECK_BANK_TRANSFER,
|
||||||
.label = "check_bank_deposit-499c",
|
.label = "check_bank_transfer-499c",
|
||||||
.details.check_bank_deposit.amount = "EUR:4.99",
|
.details.check_bank_transfer.amount = "EUR:4.99",
|
||||||
.details.check_bank_deposit.account_debit = 2,
|
.details.check_bank_transfer.account_debit = 2,
|
||||||
.details.check_bank_deposit.account_credit = 42
|
.details.check_bank_transfer.account_credit = 42
|
||||||
},
|
},
|
||||||
{ .oc = OC_CHECK_BANK_DEPOSIT,
|
{ .oc = OC_CHECK_BANK_TRANSFER,
|
||||||
.label = "check_bank_deposit-99c1",
|
.label = "check_bank_transfer-99c1",
|
||||||
.details.check_bank_deposit.amount = "EUR:0.99",
|
.details.check_bank_transfer.amount = "EUR:0.99",
|
||||||
.details.check_bank_deposit.account_debit = 2,
|
.details.check_bank_transfer.account_debit = 2,
|
||||||
.details.check_bank_deposit.account_credit = 42
|
.details.check_bank_transfer.account_credit = 42
|
||||||
},
|
},
|
||||||
{ .oc = OC_CHECK_BANK_DEPOSIT,
|
{ .oc = OC_CHECK_BANK_TRANSFER,
|
||||||
.label = "check_bank_deposit-99c2",
|
.label = "check_bank_transfer-99c2",
|
||||||
.details.check_bank_deposit.amount = "EUR:0.99",
|
.details.check_bank_transfer.amount = "EUR:0.99",
|
||||||
.details.check_bank_deposit.account_debit = 2,
|
.details.check_bank_transfer.account_debit = 2,
|
||||||
.details.check_bank_deposit.account_credit = 42
|
.details.check_bank_transfer.account_credit = 42
|
||||||
},
|
},
|
||||||
{ .oc = OC_CHECK_BANK_DEPOSIT,
|
{ .oc = OC_CHECK_BANK_TRANSFER,
|
||||||
.label = "check_bank_deposit-9c",
|
.label = "check_bank_transfer-9c",
|
||||||
.details.check_bank_deposit.amount = "EUR:0.09",
|
.details.check_bank_transfer.amount = "EUR:0.09",
|
||||||
.details.check_bank_deposit.account_debit = 2,
|
.details.check_bank_transfer.account_debit = 2,
|
||||||
.details.check_bank_deposit.account_credit = 43
|
.details.check_bank_transfer.account_credit = 43
|
||||||
},
|
},
|
||||||
|
|
||||||
{ .oc = OC_CHECK_BANK_DEPOSITS_EMPTY,
|
{ .oc = OC_CHECK_BANK_TRANSFERS_EMPTY,
|
||||||
.label = "check_bank_empty" },
|
.label = "check_bank_empty" },
|
||||||
|
|
||||||
{ .oc = OC_DEPOSIT_WTID,
|
{ .oc = OC_DEPOSIT_WTID,
|
||||||
.label = "deposit-wtid-ok",
|
.label = "deposit-wtid-ok",
|
||||||
.expected_response_code = MHD_HTTP_OK,
|
.expected_response_code = MHD_HTTP_OK,
|
||||||
.details.deposit_wtid.deposit_ref = "deposit-simple",
|
.details.deposit_wtid.deposit_ref = "deposit-simple",
|
||||||
.details.deposit_wtid.bank_transfer_ref = "check_bank_deposit-499c" },
|
.details.deposit_wtid.bank_transfer_ref = "check_bank_transfer-499c" },
|
||||||
|
|
||||||
|
|
||||||
/* TODO: trigger aggregation logic and then check the
|
/* TODO: trigger aggregation logic and then check the
|
||||||
|
Loading…
Reference in New Issue
Block a user