Skip to content

Commit

Permalink
remove setTxCounter and setCreatorAccountId from Transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
x3medima17 committed Aug 5, 2017
1 parent ad75030 commit 5eaabc8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
9 changes: 0 additions & 9 deletions irohad/model/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ namespace iroha {
* Transaction can be divided to {Header, Meta, Body}.
*/
struct Transaction {
Transaction& setTxCounter(uint64_t tx_counter) {
this->tx_counter = tx_counter;
return *this;
}

Transaction& setCreatorAccountId(std::string creator_account_id) {
this->creator_account_id = creator_account_id;
return *this;
}
/**
* List of signatories that sign transaction
* HEADER field
Expand Down
12 changes: 9 additions & 3 deletions test/module/irohad/model/converters/pb_query_responses_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,15 @@ TEST(QueryResponseTest, TransactionsResponseTest) {
model::TransactionsResponse txs_response{};

txs_response.transactions =
rxcpp::observable<>::from(model::Transaction().setTxCounter(0),
model::Transaction().setTxCounter(1),
model::Transaction().setTxCounter(2));
rxcpp::observable<>::iterate([] {
std::vector<model::Transaction> result;
for (size_t i = 0; i < 3; ++i) {
model::Transaction current;
current.tx_counter = i;
result.push_back(current);
}
return result;
}());

auto shrd_tr = std::make_shared<decltype(txs_response)>(txs_response);
auto query_response = *pb_factory.serialize(shrd_tr);
Expand Down
18 changes: 11 additions & 7 deletions test/module/irohad/torii/torii_queries_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,17 @@ TEST_F(ToriiServiceTest, FindTransactionsWhenValid) {
iroha::model::Account account;
account.account_id = "accountA";

auto txs_observable = rxcpp::observable<>::from(
iroha::model::Transaction().setTxCounter(0).setCreatorAccountId(
account.account_id),
iroha::model::Transaction().setTxCounter(1).setCreatorAccountId(
account.account_id),
iroha::model::Transaction().setTxCounter(2).setCreatorAccountId(
account.account_id));
auto txs_observable =
rxcpp::observable<>::iterate([account] {
std::vector<iroha::model::Transaction> result;
for (size_t i = 0; i < 3; ++i) {
iroha::model::Transaction current;
current.creator_account_id = account.account_id;
current.tx_counter = i;
result.push_back(current);
}
return result;
}());

EXPECT_CALL(*wsv_query, getAccount(_)).WillOnce(Return(account));
EXPECT_CALL(*block_query, getAccountTransactions(account.account_id))
Expand Down

0 comments on commit 5eaabc8

Please sign in to comment.