aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2020-01-19 17:15:20 +0100
committerDusan Klinec <dusan.klinec@gmail.com>2020-01-19 17:21:04 +0100
commit6f330865e55694498034970f6b623cb80efc4517 (patch)
tree9f33b836f3b9bb6c0961f6a36ad5d8cb5614ddf1
parentMerge pull request #6145 (diff)
downloadmonero-6f330865e55694498034970f6b623cb80efc4517.tar.xz
fix tests bug added in #6110
- e.g., fixes gen_block_big_major_version test, error: generation failed: what=events not set, cannot compute valid RandomX PoW - ask for events only if difficulty > 1 (when it really matters) - throwing an exception changed to logging, so it is easy to spot a problem if tests start to fail.
-rw-r--r--tests/core_tests/chaingen.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp
index c38ea614c..f935d4f64 100644
--- a/tests/core_tests/chaingen.cpp
+++ b/tests/core_tests/chaingen.cpp
@@ -393,11 +393,17 @@ void test_generator::fill_nonce(cryptonote::block& blk, const difficulty_type& d
const cryptonote::Blockchain *blockchain = nullptr;
std::unique_ptr<cryptonote::Blockchain> bc;
- if (blk.major_version >= RX_BLOCK_VERSION)
+ if (blk.major_version >= RX_BLOCK_VERSION && diffic > 1)
{
- CHECK_AND_ASSERT_THROW_MES(m_events != nullptr, "events not set, cannot compute valid RandomX PoW");
- bc = init_blockchain(*m_events, m_nettype);
- blockchain = bc.get();
+ if (m_events == nullptr)
+ {
+ MDEBUG("events not set, RandomX PoW can fail due to zero seed hash");
+ }
+ else
+ {
+ bc = init_blockchain(*m_events, m_nettype);
+ blockchain = bc.get();
+ }
}
blk.nonce = 0;