From 910e01d1c154390a7e724703bdd9a14046245d2c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 4 May 2016 05:38:29 +0200 Subject: [PATCH] be more careful with terminology --- src/bank-lib/test_bank_api_with_fakebank.c | 14 ++-- src/bank-lib/test_bank_interpreter.c | 6 +- src/bank-lib/test_bank_interpreter.h | 14 ++-- src/exchange-lib/test_exchange_api.c | 74 +++++++++++----------- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/bank-lib/test_bank_api_with_fakebank.c b/src/bank-lib/test_bank_api_with_fakebank.c index d0f730655..4241f075a 100644 --- a/src/bank-lib/test_bank_api_with_fakebank.c +++ b/src/bank-lib/test_bank_api_with_fakebank.c @@ -53,15 +53,15 @@ run (void *cls) .details.admin_add_incoming.credit_account_no = 3, .details.admin_add_incoming.debit_account_no = 2, .details.admin_add_incoming.amount = "PUDOS:3.21" }, - /* check transactions arrived at fakebank */ - { .oc = TBI_OC_EXPECT_TRANSACTION, + /* check transfers arrived at fakebank */ + { .oc = TBI_OC_EXPECT_TRANSFER, .label = "expect-2", - .details.expect_transaction.cmd_ref = "deposit-2" }, - { .oc = TBI_OC_EXPECT_TRANSACTION, + .details.expect_transfer.cmd_ref = "deposit-2" }, + { .oc = TBI_OC_EXPECT_TRANSFER, .label = "expect-1", - .details.expect_transaction.cmd_ref = "deposit-1" }, - /* check transaction list is now empty */ - { .oc = TBI_OC_EXPECT_TRANSACTIONS_EMPTY, + .details.expect_transfer.cmd_ref = "deposit-1" }, + /* check transfer list is now empty */ + { .oc = TBI_OC_EXPECT_TRANSFERS_EMPTY, .label = "expect-empty" }, { .oc = TBI_OC_END } }; diff --git a/src/bank-lib/test_bank_interpreter.c b/src/bank-lib/test_bank_interpreter.c index 39129a549..840f9942b 100644 --- a/src/bank-lib/test_bank_interpreter.c +++ b/src/bank-lib/test_bank_interpreter.c @@ -235,9 +235,9 @@ interpreter_run (void *cls) return; } return; - case TBI_OC_EXPECT_TRANSACTION: + case TBI_OC_EXPECT_TRANSFER: ref = find_command (is, - cmd->details.expect_transaction.cmd_ref); + cmd->details.expect_transfer.cmd_ref); GNUNET_assert (GNUNET_OK == TALER_string_to_amount (ref->details.admin_add_incoming.amount, &amount)); @@ -264,7 +264,7 @@ interpreter_run (void *cls) is->task = GNUNET_SCHEDULER_add_now (&interpreter_run, is); return; - case TBI_OC_EXPECT_TRANSACTIONS_EMPTY: + case TBI_OC_EXPECT_TRANSFERS_EMPTY: if (GNUNET_OK != FAKEBANK_check_empty (is->fakebank)) { GNUNET_break (0); diff --git a/src/bank-lib/test_bank_interpreter.h b/src/bank-lib/test_bank_interpreter.h index 329b51461..7f56caf4d 100644 --- a/src/bank-lib/test_bank_interpreter.h +++ b/src/bank-lib/test_bank_interpreter.h @@ -45,14 +45,14 @@ enum TBI_OpCode 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; /** - * If @e opcode is #TBI_OC_EXPECT_TRANSACTION, this - * specifies which transaction we expected. + * If @e opcode is #TBI_OC_EXPECT_TRANSFER, this + * specifies which transfer we expected. */ struct { @@ -129,7 +129,7 @@ struct TBI_Command */ const char *cmd_ref; - } expect_transaction; + } expect_transfer; } details; diff --git a/src/exchange-lib/test_exchange_api.c b/src/exchange-lib/test_exchange_api.c index 6a49b4adf..d05c54a80 100644 --- a/src/exchange-lib/test_exchange_api.c +++ b/src/exchange-lib/test_exchange_api.c @@ -139,12 +139,12 @@ enum OpCode /** * 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. */ - OC_CHECK_BANK_DEPOSITS_EMPTY + OC_CHECK_BANK_TRANSFERS_EMPTY }; @@ -545,7 +545,7 @@ struct Command 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; @@ -593,7 +593,7 @@ struct Command */ struct TALER_WireTransferIdentifierRawP wtid; - } check_bank_deposit; + } check_bank_transfer; } details; @@ -1470,7 +1470,7 @@ deposit_wtid_cb (void *cls, cmd->details.deposit_wtid.bank_transfer_ref); GNUNET_assert (NULL != ref); if (0 != memcmp (wtid, - &ref->details.check_bank_deposit.wtid, + &ref->details.check_bank_transfer.wtid, sizeof (struct TALER_WireTransferIdentifierRawP))) { GNUNET_break (0); @@ -1976,8 +1976,8 @@ interpreter_run (void *cls) case OC_DEPOSIT_WTID: cmd->details.wire_deposits.wtid = ref->details.deposit_wtid.wtid; break; - case OC_CHECK_BANK_DEPOSIT: - cmd->details.wire_deposits.wtid = ref->details.check_bank_deposit.wtid; + case OC_CHECK_BANK_TRANSFER: + cmd->details.wire_deposits.wtid = ref->details.check_bank_transfer.wtid; break; default: GNUNET_break (0); @@ -2079,10 +2079,10 @@ interpreter_run (void *cls) &maint_child_death, is); return; } - case OC_CHECK_BANK_DEPOSIT: + case OC_CHECK_BANK_TRANSFER: { if (GNUNET_OK != - TALER_string_to_amount (cmd->details.check_bank_deposit.amount, + TALER_string_to_amount (cmd->details.check_bank_transfer.amount, &amount)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -2095,9 +2095,9 @@ interpreter_run (void *cls) if (GNUNET_OK != FAKEBANK_check (fakebank, &amount, - cmd->details.check_bank_deposit.account_debit, - cmd->details.check_bank_deposit.account_credit, - &cmd->details.check_bank_deposit.wtid)) + cmd->details.check_bank_transfer.account_debit, + cmd->details.check_bank_transfer.account_credit, + &cmd->details.check_bank_transfer.wtid)) { GNUNET_break (0); fail (is); @@ -2106,7 +2106,7 @@ interpreter_run (void *cls) next_command (is); return; } - case OC_CHECK_BANK_DEPOSITS_EMPTY: + case OC_CHECK_BANK_TRANSFERS_EMPTY: { if (GNUNET_OK != FAKEBANK_check_empty (fakebank)) @@ -2328,9 +2328,9 @@ do_shutdown (void *cls) cmd->details.run_aggregator.aggregator_proc = NULL; } break; - case OC_CHECK_BANK_DEPOSIT: + case OC_CHECK_BANK_TRANSFER: break; - case OC_CHECK_BANK_DEPOSITS_EMPTY: + case OC_CHECK_BANK_TRANSFERS_EMPTY: break; default: GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -2646,39 +2646,39 @@ run (void *cls) { .oc = OC_RUN_AGGREGATOR, .label = "run-aggregator" }, - { .oc = OC_CHECK_BANK_DEPOSIT, - .label = "check_bank_deposit-499c", - .details.check_bank_deposit.amount = "EUR:4.99", - .details.check_bank_deposit.account_debit = 2, - .details.check_bank_deposit.account_credit = 42 + { .oc = OC_CHECK_BANK_TRANSFER, + .label = "check_bank_transfer-499c", + .details.check_bank_transfer.amount = "EUR:4.99", + .details.check_bank_transfer.account_debit = 2, + .details.check_bank_transfer.account_credit = 42 }, - { .oc = OC_CHECK_BANK_DEPOSIT, - .label = "check_bank_deposit-99c1", - .details.check_bank_deposit.amount = "EUR:0.99", - .details.check_bank_deposit.account_debit = 2, - .details.check_bank_deposit.account_credit = 42 + { .oc = OC_CHECK_BANK_TRANSFER, + .label = "check_bank_transfer-99c1", + .details.check_bank_transfer.amount = "EUR:0.99", + .details.check_bank_transfer.account_debit = 2, + .details.check_bank_transfer.account_credit = 42 }, - { .oc = OC_CHECK_BANK_DEPOSIT, - .label = "check_bank_deposit-99c2", - .details.check_bank_deposit.amount = "EUR:0.99", - .details.check_bank_deposit.account_debit = 2, - .details.check_bank_deposit.account_credit = 42 + { .oc = OC_CHECK_BANK_TRANSFER, + .label = "check_bank_transfer-99c2", + .details.check_bank_transfer.amount = "EUR:0.99", + .details.check_bank_transfer.account_debit = 2, + .details.check_bank_transfer.account_credit = 42 }, - { .oc = OC_CHECK_BANK_DEPOSIT, - .label = "check_bank_deposit-9c", - .details.check_bank_deposit.amount = "EUR:0.09", - .details.check_bank_deposit.account_debit = 2, - .details.check_bank_deposit.account_credit = 43 + { .oc = OC_CHECK_BANK_TRANSFER, + .label = "check_bank_transfer-9c", + .details.check_bank_transfer.amount = "EUR:0.09", + .details.check_bank_transfer.account_debit = 2, + .details.check_bank_transfer.account_credit = 43 }, - { .oc = OC_CHECK_BANK_DEPOSITS_EMPTY, + { .oc = OC_CHECK_BANK_TRANSFERS_EMPTY, .label = "check_bank_empty" }, { .oc = OC_DEPOSIT_WTID, .label = "deposit-wtid-ok", .expected_response_code = MHD_HTTP_OK, .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