Skip to content

Commit

Permalink
Fix apply transaction method in MutableState
Browse files Browse the repository at this point in the history
Remove ametsuchi compilation and tests
  • Loading branch information
lebdron committed Jun 22, 2017
1 parent 0b830ad commit a035313
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 40 deletions.
13 changes: 5 additions & 8 deletions irohad/ametsuchi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# here will be the code, which is responsible for connection to ametsuchi
message(STATUS "Ametsuchi")

add_subdirectory(block_store)
add_subdirectory(index)
add_subdirectory(wsv)
#add_subdirectory(block_store)
#add_subdirectory(index)
#add_subdirectory(wsv)

add_library(storage
impl/ametsuchi.cpp
index_mediator.cpp
# impl/ametsuchi_impl.cpp
# index_mediator.cpp
)

target_link_libraries(storage PUBLIC
Expand Down
9 changes: 5 additions & 4 deletions irohad/ametsuchi/mutable_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@ namespace iroha {
/**
* Applies a transaction to current mutable state
* using logic specified in function
* @param transaction Transaction to be applies
* @param transaction Transaction to be applied
* @param function Function that specifies the logic used to apply
* @return True if transaction was successfully applied, false otherwise
*/
virtual void apply(dao::Transaction transaction,
std::function<bool(dao::Transaction,
virtual bool apply(dao::Transaction transaction,
std::function<void(dao::Transaction,
TransactionContext)> function) = 0;
};

}
} // namespace ametsuchi

} // namespace iroha

Expand Down
9 changes: 7 additions & 2 deletions irohad/ametsuchi/query_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef IROHA_QUERY_API_HPP
#define IROHA_QUERY_API_HPP

#include <common.hpp>
#include <dao/dao.hpp>
#include <string>
Expand Down Expand Up @@ -83,6 +85,7 @@ namespace iroha {
*/
virtual rxcpp::observable<iroha::dao::Transaction> get_asset_transactions(
std::string asset_full_name) = 0;

/**
* Get all transactions of a certain wallet
* @param wallet_id - unique wallet
Expand All @@ -91,7 +94,9 @@ namespace iroha {
virtual rxcpp::observable<iroha::dao::Transaction>
get_wallet_transactions(std::string wallet_id) = 0;
};
}
}

} // namespace ametsuchi

} // namespace iroha

#endif // IROHA_QUERY_API_HPP
51 changes: 25 additions & 26 deletions test/module/irohad/ametsuchi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@ set(CMAKE_BUILD_TYPE Debug)

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/test_bin)

#add_subdirectory(ametsuchi)

addtest(bstore_test block_store/block_store_flat_test.cpp)
target_link_libraries(bstore_test
block_store
)

addtest(block_index_test index/block_index_test.cpp)
target_link_libraries(block_index_test
index
)

addtest(tx_index_test index/tx_index_test.cpp)
target_link_libraries(tx_index_test
index
)

addtest(wsv_test wsv/wsv_test.cpp)
target_link_libraries(wsv_test
wsv
)

addtest(ametsuchi_test ametsuchi_test.cpp)
target_link_libraries(ametsuchi_test
storage
)
#
#addtest(bstore_test block_store/block_store_flat_test.cpp)
#target_link_libraries(bstore_test
# block_store
# )
#
#addtest(block_index_test index/block_index_test.cpp)
#target_link_libraries(block_index_test
# index
# )
#
#addtest(tx_index_test index/tx_index_test.cpp)
#target_link_libraries(tx_index_test
# index
# )
#
#addtest(wsv_test wsv/wsv_test.cpp)
#target_link_libraries(wsv_test
# wsv
# )
#
#addtest(ametsuchi_test ametsuchi_test.cpp)
#target_link_libraries(ametsuchi_test
# storage
# )

0 comments on commit a035313

Please sign in to comment.