From fead09cb1ef4701fe188bd00ebcfe68d9040f3b8 Mon Sep 17 00:00:00 2001 From: alfred <> Date: Fri, 8 Feb 2019 14:07:30 -0800 Subject: [PATCH] l-value assignement error --- tests/difficulty/difficulty.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/difficulty/difficulty.cpp b/tests/difficulty/difficulty.cpp index fc6133e6..5cc53014 100644 --- a/tests/difficulty/difficulty.cpp +++ b/tests/difficulty/difficulty.cpp @@ -35,9 +35,13 @@ int test_big_difficulties(const char* dataFile) end = n - DIFFICULTY_LAG; begin = end - DIFFICULTY_WINDOW; } + auto stamps = vector(timestamps.begin() + begin, timestamps.begin() + end); + auto cumulative_diffs = vector(cumulative_difficulties.begin() + begin, cumulative_difficulties.begin() + end); currency::wide_difficulty_type res = currency::next_difficulty( - vector(timestamps.begin() + begin, timestamps.begin() + end), - vector(cumulative_difficulties.begin() + begin, cumulative_difficulties.begin() + end), DEFAULT_TEST_DIFFICULTY_TARGET); + stamps, + cumulative_diffs, + DEFAULT_TEST_DIFFICULTY_TARGET + ); if (res != difficulty) { cerr << "Wrong wide difficulty for block " << n << endl << "Expected: " << difficulty << endl @@ -90,9 +94,13 @@ int main(int argc, char *argv[]) { << "Found: " << res << endl; return 1; } + auto stamps = vector(timestamps.begin() + begin, timestamps.begin() + end); + auto cumulative_diffs = vector(wide_cumulative_difficulties.begin() + begin, wide_cumulative_difficulties.begin() + end); currency::wide_difficulty_type wide_res = currency::next_difficulty( - vector(timestamps.begin() + begin, timestamps.begin() + end), - vector(wide_cumulative_difficulties.begin() + begin, wide_cumulative_difficulties.begin() + end), DEFAULT_TEST_DIFFICULTY_TARGET); + stamps, + cumulative_diffs, + DEFAULT_TEST_DIFFICULTY_TARGET + ); if (wide_res.convert_to() != res) { cerr << "Wrong wide difficulty for block " << n << endl << "Expected: " << res << endl @@ -110,3 +118,4 @@ int main(int argc, char *argv[]) { return 0; } +