aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-02-08 18:47:56 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-02-08 18:52:00 +0000
commita333c42cdeab4675c22df25255313752d81a2d4e (patch)
tree97abd7cc6a0a06375979eebfdc72913b7940bef8 /src/cryptonote_core/cryptonote_core.cpp
parent945fe90e080c862f547064bca81e621cb961057e (diff)
downloadmonzero-core-a333c42cdeab4675c22df25255313752d81a2d4e.tar.gz
monzero-core-a333c42cdeab4675c22df25255313752d81a2d4e.tar.xz
monzero-core-a333c42cdeab4675c22df25255313752d81a2d4e.zip
core_tests: add tests for hard fork behaviors (MRL-0004)
We also replace the --fakechain option with an optional structure containing details about configuration for the core/blockchain, for test purposes. This seems more future friendly.
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 2479931be..2c485d791 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -145,13 +145,11 @@ namespace cryptonote
command_line::add_arg(desc, command_line::arg_db_sync_mode);
command_line::add_arg(desc, command_line::arg_show_time_stats);
command_line::add_arg(desc, command_line::arg_db_auto_remove_logs);
- command_line::add_arg(desc, command_line::arg_fakechain);
}
//-----------------------------------------------------------------------------------------------
bool core::handle_command_line(const boost::program_options::variables_map& vm)
{
m_testnet = command_line::get_arg(vm, command_line::arg_testnet_on);
- m_fakechain = command_line::get_arg(vm, command_line::arg_fakechain);
auto data_dir_arg = m_testnet ? command_line::arg_testnet_data_dir : command_line::arg_data_dir;
m_config_folder = command_line::get_arg(vm, data_dir_arg);
@@ -251,8 +249,9 @@ namespace cryptonote
return true;
}
//-----------------------------------------------------------------------------------------------
- bool core::init(const boost::program_options::variables_map& vm)
+ bool core::init(const boost::program_options::variables_map& vm, const cryptonote::test_options *test_options)
{
+ m_fakechain = test_options != NULL;
bool r = handle_command_line(vm);
r = m_mempool.init(m_fakechain ? std::string() : m_config_folder);
@@ -398,7 +397,7 @@ namespace cryptonote
m_blockchain_storage.set_user_options(blocks_threads,
blocks_per_sync, sync_mode, fast_sync);
- r = m_blockchain_storage.init(db, m_testnet, m_fakechain);
+ r = m_blockchain_storage.init(db, m_testnet, test_options);
// now that we have a valid m_blockchain_storage, we can clean out any
// transactions in the pool that do not conform to the current fork