diff --git a/CMakeLists.txt b/CMakeLists.txt index 00fc146a..ff1ebbd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,9 @@ add_executable (core_test rai/core_test/uint256_union.cpp rai/core_test/wallet_test.cpp ) + +add_executable (slow_test + rai/slow_test/client.cpp) add_executable (qt_test rai/qt_test/qt.cpp) @@ -86,7 +89,7 @@ add_executable (qt_system SET (ACTIVE_NETWORK rai_active_network CACHE STRING "Selects which network parameters are used") set_property (CACHE ACTIVE_NETWORK PROPERTY STRINGS rai_test_network rai_beta_network rai_live_network) -set_target_properties (secure core core_test qt_test cli qt qt_client qt_system landing PROPERTIES COMPILE_FLAGS "-std=c++11 -Werror=switch ${PLATFORM_COMPILE_FLAGS} -DQT_NO_KEYWORDS -DACTIVE_NETWORK=${ACTIVE_NETWORK} -DED25519_CUSTOMHASH -DED25519_CUSTOMRNG") +set_target_properties (secure core core_test slow_test qt_test cli qt qt_client qt_system landing PROPERTIES COMPILE_FLAGS "-std=c++11 -Werror=switch ${PLATFORM_COMPILE_FLAGS} -DQT_NO_KEYWORDS -DACTIVE_NETWORK=${ACTIVE_NETWORK} -DED25519_CUSTOMHASH -DED25519_CUSTOMRNG") set_target_properties (qt_client qt_test PROPERTIES LINK_FLAGS "${PLATFORM_GUI_EXE_LINK_FLAGS}") if (WIN32) @@ -97,6 +100,8 @@ endif (WIN32) target_link_libraries (core_test core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY}) +target_link_libraries (slow_test core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY}) + target_link_libraries (cli core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY}) target_link_libraries (landing core secure ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY} ${CRYPTOPP_LIBRARY} ${CPPNETLIB_LIBRARIES} pthread ${PLATFORM_LIBS} ${LevelDB_LIBRARY}) diff --git a/rai/core_test/ledger.cpp b/rai/core_test/ledger.cpp index 0a578179..ace8e292 100644 --- a/rai/core_test/ledger.cpp +++ b/rai/core_test/ledger.cpp @@ -630,35 +630,6 @@ TEST (system, generate_send_new) } } -TEST (system, generate_mass_activity) -{ - rai::system system (24000, 1); - system.clients [0]->wallet.insert (rai::test_genesis_key.prv); - size_t count (20); - system.generate_mass_activity (count, *system.clients [0]); - size_t accounts (0); - for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i) - { - ++accounts; - } - ASSERT_GT (accounts, count / 10); -} - -TEST (system, DISABLED_generate_mass_activity_long) -{ - rai::system system (24000, 1); - system.clients [0]->wallet.insert (rai::test_genesis_key.prv); - size_t count (10000); - system.generate_mass_activity (count, *system.clients [0]); - system.clients [0]->log.dump_cerr (); - size_t accounts (0); - for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i) - { - ++accounts; - } - ASSERT_GT (accounts, count / 10); -} - TEST (ledger, representation) { leveldb::Status init; diff --git a/rai/secure.cpp b/rai/secure.cpp index 4987e7a5..24142b3b 100644 --- a/rai/secure.cpp +++ b/rai/secure.cpp @@ -1573,33 +1573,24 @@ rai::block_store::block_store (leveldb::Status & init_a, boost::filesystem::path if (status4.ok ()) { representation.reset (db); - auto status5 (leveldb::DB::Open (options, (path_a / "forks.ldb").string (), &db)); - if (status5.ok ()) + auto status6 (leveldb::DB::Open (options, (path_a / "bootstrap.ldb").string (), &db)); + if (status6.ok ()) { - forks.reset (db); - auto status6 (leveldb::DB::Open (options, (path_a / "bootstrap.ldb").string (), &db)); - if (status6.ok ()) + bootstrap.reset (db); + auto status7 (leveldb::DB::Open (options, (path_a / "checksum.ldb").string (), &db)); + if (status7.ok ()) { - bootstrap.reset (db); - auto status7 (leveldb::DB::Open (options, (path_a / "checksum.ldb").string (), &db)); - if (status7.ok ()) - { - checksum.reset (db); - checksum_put (0, 0, 0); - } - else - { - init_a = status7; - } + checksum.reset (db); + checksum_put (0, 0, 0); } else { - init_a = status6; + init_a = status7; } } else { - init_a = status5; + init_a = status6; } } else diff --git a/rai/secure.hpp b/rai/secure.hpp index cb93672f..31d92df5 100644 --- a/rai/secure.hpp +++ b/rai/secure.hpp @@ -460,8 +460,6 @@ namespace rai std::unique_ptr pending; // account -> weight // Representation std::unique_ptr representation; - // block_hash -> sequence, block // Previous block hash to most recent sequence and fork proof - std::unique_ptr forks; // block_hash -> block // Unchecked bootstrap blocks std::unique_ptr bootstrap; // block_hash -> block_hash // Tracking successors for bootstrapping diff --git a/rai/slow_test/client.cpp b/rai/slow_test/client.cpp new file mode 100644 index 00000000..a2ae9e1e --- /dev/null +++ b/rai/slow_test/client.cpp @@ -0,0 +1,31 @@ +#include +#include + +TEST (system, generate_mass_activity) +{ + rai::system system (24000, 1); + system.clients [0]->wallet.insert (rai::test_genesis_key.prv); + size_t count (20); + system.generate_mass_activity (count, *system.clients [0]); + size_t accounts (0); + for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i) + { + ++accounts; + } + ASSERT_GT (accounts, count / 10); +} + +TEST (system, generate_mass_activity_long) +{ + rai::system system (24000, 1); + system.clients [0]->wallet.insert (rai::test_genesis_key.prv); + size_t count (10000); + system.generate_mass_activity (count, *system.clients [0]); + system.clients [0]->log.dump_cerr (); + size_t accounts (0); + for (auto i (system.clients [0]->store.latest_begin ()), n (system.clients [0]->store.latest_end ()); i != n; ++i) + { + ++accounts; + } + ASSERT_GT (accounts, count / 10); +} \ No newline at end of file