Skip to content

Commit

Permalink
Remove model object in test
Browse files Browse the repository at this point in the history
  • Loading branch information
MizukiSonoko committed Feb 18, 2017
1 parent ee50be7 commit 7030ced
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 27 deletions.
3 changes: 0 additions & 3 deletions test/consensus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ add_executable(sumeragi_test
target_link_libraries(sumeragi_test
leveldb
snappy
objects
base64
signature
sumeragi
Expand All @@ -42,13 +41,11 @@ add_executable(transaction_test
)
target_link_libraries(transaction_test
snappy
objects
base64
signature
sumeragi
connection_with_grpc
config_manager
pthread
consensus_event
objects
)
12 changes: 0 additions & 12 deletions test/consensus/sumeragi_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,12 @@ limitations under the License.

#include <consensus/sumeragi.hpp>
#include <consensus/connection/connection.hpp>
#include <model/commands/transfer.hpp>
#include <model/objects/domain.hpp>

#include <service/peer_service.hpp>
#include <util/logger.hpp>
#include <crypto/hash.hpp>
#include <infra/config/peer_service_with_json.hpp>

template<typename T>
using Transaction = transaction::Transaction<T>;
template<typename T>
using ConsensusEvent = event::ConsensusEvent<T>;
template<typename T>
using Add = command::Add<T>;
template<typename T>
using Transfer = command::Transfer<T>;
template<typename T>
using Update = command::Update<T>;

void setAwkTimer(int const sleepMillisecs, const std::function<void(void)>& action) {
std::thread([action, sleepMillisecs]() {
Expand Down
11 changes: 0 additions & 11 deletions test/consensus/transaction_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,11 @@ limitations under the License.

#include <consensus/sumeragi.hpp>
#include <consensus/connection/connection.hpp>
#include <model/commands/transfer.hpp>
#include <model/commands/add.hpp>

#include <service/peer_service.hpp>
#include <crypto/hash.hpp>
#include <infra/config/peer_service_with_json.hpp>

template<typename T>
using Transaction = transaction::Transaction<T>;
template<typename T>
using ConsensusEvent = event::ConsensusEvent<T>;
template<typename T>
using Add = command::Add<T>;
template<typename T>
using Transfer = command::Transfer<T>;

void setAwkTimer(int const sleepMillisecs, std::function<void(void)> const &action) {
std::thread([action, sleepMillisecs]() {
std::this_thread::sleep_for(std::chrono::milliseconds(sleepMillisecs));
Expand Down
11 changes: 11 additions & 0 deletions test/crypto/signature_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,16 @@ ASSERT_TRUE(signature::verify(
));
}

TEST(Signature, generatedByGO){

std::string public_key_b64 = "Oe8Xd5iDvVrVNc1apzLcdjRRq3ZZsTjkjebpDYdRcRw";
std::string signature_b64 = "FtLGaJLDK4g/tRzufBexe6fTAhjENtl6MWAynRpR9c1CZdEWJbbDS9svpU96hXiyGy3BQcwRxUz6eovBJdf6DQ==";
std::string message = "0f1a39c82593e8b48e69f000c765c8e8072269d3bd4010634fa51d4e685076e30db22a9fb75def7379be0e808392922cb8c43d5dd5d5039828ed7ade7e1c6c81";

ASSERT_TRUE(signature::verify(
signature_b64,
message,
public_key_b64
));
}

1 change: 0 additions & 1 deletion test/infra/protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ target_link_libraries(convertor_test
convertor
signature
datetime
objects

hash
base64
Expand Down

0 comments on commit 7030ced

Please sign in to comment.