aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-31 01:05:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-31 01:25:07 +0000
commitd31024c2e1634d32cfbf750ce5713b52a1e67707 (patch)
treee440ac44d8fb69c6f53d93252814c6b679fc89da /tests
parentMerge pull request #6045 (diff)
downloadmonero-d31024c2e1634d32cfbf750ce5713b52a1e67707.tar.xz
cryptonote: untangle dependency from miner to blockchain
It causes link errors at least on mac
Diffstat (limited to 'tests')
-rw-r--r--tests/core_tests/chaingen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp
index 3f2984288..35e449e10 100644
--- a/tests/core_tests/chaingen.cpp
+++ b/tests/core_tests/chaingen.cpp
@@ -186,7 +186,9 @@ bool test_generator::construct_block(cryptonote::block& blk, uint64_t height, co
// Nonce search...
blk.nonce = 0;
- while (!miner::find_nonce_for_given_block(NULL, blk, get_test_difficulty(hf_ver), height))
+ while (!miner::find_nonce_for_given_block([](const cryptonote::block &b, uint64_t height, unsigned int threads, crypto::hash &hash){
+ return cryptonote::get_block_longhash(NULL, b, hash, height, threads);
+ }, blk, get_test_difficulty(hf_ver), height))
blk.timestamp++;
add_block(blk, txs_weight, block_weights, already_generated_coins, hf_ver ? hf_ver.get() : 1);
@@ -797,7 +799,9 @@ void fill_tx_sources_and_destinations(const std::vector<test_event_entry>& event
void fill_nonce(cryptonote::block& blk, const difficulty_type& diffic, uint64_t height)
{
blk.nonce = 0;
- while (!miner::find_nonce_for_given_block(NULL, blk, diffic, height))
+ while (!miner::find_nonce_for_given_block([](const cryptonote::block &b, uint64_t height, unsigned int threads, crypto::hash &hash){
+ return cryptonote::get_block_longhash(NULL, b, hash, height, threads);
+ }, blk, diffic, height))
blk.timestamp++;
}