Skip to content

Commit

Permalink
Add minor fixes:
Browse files Browse the repository at this point in the history
 - Fix redis cmake

 - Fix kv test

Signed-off-by: grimadas <[email protected]>
  • Loading branch information
grimadas authored and kamilsa committed Dec 27, 2017
1 parent 54fb324 commit f5a9da9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions irohad/ametsuchi/impl/temporary_wsv_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ namespace iroha {

bool TemporaryWsvImpl::apply(
const model::Transaction &transaction,
std::function<bool(const model::Transaction &, WsvQuery &)> function) {
auto execute_command = [this, transaction](auto command) {
std::function<bool(const model::Transaction &, WsvQuery &)>
apply_function) {
const auto &tx_creator = transaction.creator_account_id;
auto execute_command = [this, &tx_creator](auto command) {
auto executor = command_executors_->getCommandExecutor(command);
auto account = wsv_->getAccount(transaction.creator_account_id).value();
return executor->validate(
*command, *wsv_, transaction.creator_account_id)
&& executor->execute(
*command, *wsv_, *executor_, transaction.creator_account_id);
auto account = wsv_->getAccount(tx_creator).value();
return executor->validate(*command, *wsv_, tx_creator)
&& executor->execute(*command, *wsv_, *executor_, tx_creator);
};

transaction_->exec("SAVEPOINT savepoint_;");
auto result = function(transaction, *wsv_)
auto result = apply_function(transaction, *wsv_)
&& std::all_of(transaction.commands.begin(),
transaction.commands.end(),
execute_command);
Expand Down
4 changes: 2 additions & 2 deletions test/module/irohad/ametsuchi/kv_storage_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ TEST_F(KVTest, GetNonexistingDetail) {
auto account = wsv_query->getAccount(account_id1);

auto age =
wsv_query->getAccountDetail(account_id1, "genesis", "nonexisting-field");
wsv_query->getAccountDetail(account_id1, "user1@ru", "nonexisting-field");
ASSERT_FALSE(age);
}

Expand All @@ -128,7 +128,7 @@ TEST_F(KVTest, GetNonexistingDetail) {
*/
TEST_F(KVTest, SetAccountDetail) {
auto account_id2 = account_name2 + "@" + domain_id;
auto age = wsv_query->getAccountDetail(account_id2, "genesis", "age");
auto age = wsv_query->getAccountDetail(account_id2, "user1@ru", "age");

ASSERT_TRUE(age);
ASSERT_EQ(age.value(), "24");
Expand Down

0 comments on commit f5a9da9

Please sign in to comment.