diff --git a/tests/functional_tests/difficulty_analysis.cpp b/tests/functional_tests/difficulty_analysis.cpp new file mode 100644 index 00000000..2a6c2500 --- /dev/null +++ b/tests/functional_tests/difficulty_analysis.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2014-2018 Zano Project +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include +#include + +#include "include_base_utils.h" +using namespace epee; +#include "wallet/wallet2.h" +#include "currency_core/blockchain_storage.h" + + +void run_difficulty_analysis(const std::string& path) +{ + std::istringstream fstr(path); + if (!fstr.good()) + { + LOG_ERROR("unable to open " << path); + return; + } + + LOG_PRINT_L0("Loading array..."); + std::string line; + std::vector> blocks; + blocks.reserve(140000); + while (std::getline(fstr, line)) + { + std::vector array_num; + boost::tokenizer<> tok(line); + std::transform(tok.begin(), tok.end(), std::back_inserter(array_num), + &boost::lexical_cast); + + blocks.push_back(array_num); + } + LOG_PRINT_L0("Loaded " << blocks.size() << " lines"); + + + return; +} + diff --git a/tests/functional_tests/difficulty_analysis.h b/tests/functional_tests/difficulty_analysis.h new file mode 100644 index 00000000..aeac7998 --- /dev/null +++ b/tests/functional_tests/difficulty_analysis.h @@ -0,0 +1,9 @@ +// Copyright (c) 2014-2018 Zano Project +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + + + +void run_difficulty_analysis(const std::string& path); + +