forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb47ad2
commit 3c18903
Showing
14 changed files
with
138 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
set(CMAKE_BUILD_TYPE Debug) | ||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) | ||
|
||
ADD_LIBRARY(sumeragi STATIC | ||
sumeragi.cpp | ||
) | ||
target_link_libraries(sumeragi | ||
crypto | ||
txRepo | ||
yaml_loader | ||
) |
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
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
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,44 @@ | ||
#include <yaml-cpp/yaml.h> | ||
#include <string> | ||
|
||
#include "logger.hpp" | ||
#include "terminate.hpp" | ||
#include "yaml_loader.hpp" | ||
#include "../service/peer_service.hpp" | ||
|
||
// Umm..., This is really util? not service? | ||
// ToDo future work | ||
// make yaml_service and separate yaml-cpp library from yaml service. | ||
namespace yaml{ | ||
|
||
|
||
YamlLoader::YamlLoader(std::string afileName) : | ||
fileName(fileName) | ||
{} | ||
|
||
|
||
template<typename T> | ||
T YamlLoader::get(const std::string &root,const std::string &key) { | ||
YAML::Node config = YAML::LoadFile(std::move(fileName)); | ||
try{ | ||
return config[root][key].as<T>(); | ||
}catch(YAML::Exception& e){ | ||
logger::fital("YamlLoader.get()", e.what()); | ||
terminate::finish(); | ||
} | ||
} | ||
/* | ||
template <> | ||
std::string YamlLoader::get< | ||
std::string | ||
>(std::string root, std::string key); | ||
template std::vector<peer::Node> YamlLoader::get< | ||
std::vector<peer::Node> | ||
>(std::string root, std::string key); | ||
template std::vector<std::string> YamlLoader::get< | ||
std::vector<std::string> | ||
>(std::string root, std::string key); | ||
*/ | ||
}; |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#ifndef CORE_VALIDATION_TRANSACTIONVALIDATOR_HPP_ | ||
#define CORE_VALIDATION_TRANSACTIONVALIDATOR_HPP_ | ||
|
||
#include "../model/transactions/abstract_transaction.hpp" | ||
|
||
namespace transaction_validator { | ||
bool isValid(AbstractTransaction const tx); | ||
bool signaturesAreValid(AbstractTransaction const tx); | ||
bool validForType(AbstractTransaction const tx); | ||
bool isValid(abstract_transaction::AbstractTransaction& tx); | ||
bool signaturesAreValid(abstract_transaction::AbstractTransaction& tx); | ||
bool validForType(abstract_transaction::AbstractTransaction& tx); | ||
}; // namespace transaction_validator | ||
|
||
#endif // CORE_VALIDATION_TRANSACTIONVALIDATOR_HPP_ |
Oops, something went wrong.