mirror of
https://codeberg.org/wowario/wownero
synced 2026-11-16 09:33:55 +01:00
fix unit tests
This commit is contained in:
@@ -45,7 +45,8 @@ namespace
|
||||
for (size_t i = 0; i < new_block_count; ++i)
|
||||
{
|
||||
block blk_next;
|
||||
difficulty_type diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
|
||||
const uint64_t height = get_block_height(blk_prev) + 1;
|
||||
difficulty_type diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1, height, cryptonote::network_type::MAINNET);
|
||||
if (!generator.construct_block_manually(blk_next, blk_prev, miner_account,
|
||||
test_generator::bf_timestamp | test_generator::bf_diffic, 0, 0, blk_prev.timestamp, crypto::hash(), diffic))
|
||||
return false;
|
||||
@@ -175,9 +176,10 @@ bool gen_block_invalid_nonce::generate(std::vector<test_event_entry>& events) co
|
||||
return false;
|
||||
|
||||
// Create invalid nonce
|
||||
difficulty_type diffic = next_difficulty(timestamps, commulative_difficulties,DIFFICULTY_TARGET_V1);
|
||||
assert(1 < diffic);
|
||||
const block& blk_last = boost::get<block>(events.back());
|
||||
const uint64_t height = get_block_height(blk_last) + 1;
|
||||
difficulty_type diffic = next_difficulty(timestamps, commulative_difficulties,DIFFICULTY_TARGET_V1, height, cryptonote::network_type::MAINNET);
|
||||
assert(1 < diffic);
|
||||
uint64_t timestamp = blk_last.timestamp;
|
||||
block blk_3;
|
||||
do
|
||||
@@ -572,7 +574,8 @@ bool gen_block_invalid_binary_format::generate(std::vector<test_event_entry>& ev
|
||||
do
|
||||
{
|
||||
blk_last = boost::get<block>(events.back());
|
||||
diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
|
||||
const uint64_t height = get_block_height(blk_last) + 1;
|
||||
diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1, height, cryptonote::network_type::MAINNET);
|
||||
if (!lift_up_difficulty(events, timestamps, cummulative_difficulties, generator, 1, blk_last, miner_account))
|
||||
return false;
|
||||
std::cout << "Block #" << events.size() << ", difficulty: " << diffic << std::endl;
|
||||
@@ -587,7 +590,8 @@ bool gen_block_invalid_binary_format::generate(std::vector<test_event_entry>& ev
|
||||
std::vector<crypto::hash> tx_hashes;
|
||||
tx_hashes.push_back(get_transaction_hash(tx_0));
|
||||
size_t txs_weight = get_transaction_weight(tx_0);
|
||||
diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
|
||||
const uint64_t height = get_block_height(blk_last) + 1;
|
||||
diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1, height, cryptonote::network_type::MAINNET);
|
||||
if (!generator.construct_block_manually(blk_test, blk_last, miner_account,
|
||||
test_generator::bf_diffic | test_generator::bf_timestamp | test_generator::bf_tx_hashes, 0, 0, blk_last.timestamp,
|
||||
crypto::hash(), diffic, transaction(), tx_hashes, txs_weight))
|
||||
|
||||
Reference in New Issue
Block a user