-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(blockchain+log): add logger and basis blockchain module
- Loading branch information
Showing
11 changed files
with
184 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
add_library(antara_nspv STATIC) | ||
target_sources(antara_nspv PRIVATE antara/gaming/blockchain/nspv.system.cpp) | ||
target_include_directories(antara_nspv PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries(antara_nspv PUBLIC antara::default_settings antara::ecs) | ||
add_library(antara::nspv ALIAS antara_nspv) | ||
|
||
if (ANTARA_BUILD_UNIT_TESTS) | ||
##! antara blockchain tests | ||
add_executable(antara_blockchain_tests) | ||
target_link_libraries(antara_blockchain_tests PRIVATE doctest PUBLIC antara::nspv) | ||
target_sources(antara_blockchain_tests PRIVATE | ||
antara/gaming/blockchain/antara.blockchain.tests.cpp | ||
antara/gaming/blockchain/nspv.system.tests.cpp) | ||
set_target_properties(antara_blockchain_tests | ||
PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/unit_tests" | ||
) | ||
|
||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/assets DESTINATION ${CMAKE_BINARY_DIR}/bin/unit_tests/nspv/) | ||
|
||
|
||
target_enable_coverage(antara_blockchain_tests) | ||
target_enable_tsan(antara_blockchain_tests) | ||
target_enable_asan(antara_blockchain_tests) | ||
target_enable_ubsan(antara_blockchain_tests) | ||
|
||
if (EMSCRIPTEN) | ||
message(STATUS "Emscripten detected") | ||
if (ENABLE_HTML_COMPILATION) | ||
message(STATUS "Html compilation enabled") | ||
set_target_properties(antara_blockchain_tests PROPERTIES LINK_FLAGS "-s FORCE_FILESYSTEM=1 -s EXIT_RUNTIME=1" | ||
SUFFIX ".html") | ||
else () | ||
message(STATUS "Local js compilation") | ||
set_target_properties(antara_blockchain_tests PROPERTIES LINK_FLAGS "-s FORCE_FILESYSTEM=1 -s NODERAWFS=1 -s EXIT_RUNTIME=1") | ||
endif () | ||
endif () | ||
endif () |
18 changes: 18 additions & 0 deletions
18
modules/blockchain/antara/gaming/blockchain/antara.blockchain.tests.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN | ||
#include <doctest/doctest.h> |
21 changes: 21 additions & 0 deletions
21
modules/blockchain/antara/gaming/blockchain/nspv.system.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#include <antara/gaming/blockchain/nspv.system.hpp> | ||
|
||
namespace antara::gaming::blockchain | ||
{ | ||
} |
40 changes: 40 additions & 0 deletions
40
modules/blockchain/antara/gaming/blockchain/nspv.system.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include <filesystem> | ||
#include <entt/entity/registry.hpp> | ||
#include <antara/gaming/core/real.path.hpp> | ||
#include <antara/gaming/ecs/system.hpp> | ||
|
||
namespace antara::gaming::blockchain { | ||
class nspv final : public ecs::logic_update_system<nspv> { | ||
public: | ||
nspv(entt::registry ®istry, | ||
std::filesystem::path tools_path = antara::gaming::core::assets_real_path() / "tools") noexcept | ||
: system(registry), tools_path_(std::move(tools_path)) { | ||
this->disable(); | ||
} | ||
|
||
void update() noexcept final {} | ||
|
||
private: | ||
std::filesystem::path tools_path_; | ||
}; | ||
} | ||
|
||
REFL_AUTO(type(antara::gaming::blockchain::nspv)) |
31 changes: 31 additions & 0 deletions
31
modules/blockchain/antara/gaming/blockchain/nspv.system.tests.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#include <doctest/doctest.h> | ||
#include <antara/gaming/ecs/system.manager.hpp> | ||
#include "nspv.system.hpp" | ||
|
||
namespace antara::gaming::blockchain::tests | ||
{ | ||
TEST_CASE("nspv system creation") | ||
{ | ||
entt::registry entity_registry; | ||
[[ maybe_unused ]] entt::dispatcher& dispatcher{entity_registry.set<entt::dispatcher>()}; | ||
antara::gaming::ecs::system_manager mgr{entity_registry}; | ||
|
||
auto& nspv_system = mgr.create_system<blockchain::nspv>(std::filesystem::current_path() / "nspv/assets/tools"); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters