aboutsummaryrefslogtreecommitdiff
path: root/tests/core_tests
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-11-18 10:37:22 +0200
committerRiccardo Spagni <ric@spagni.net>2015-11-18 10:37:27 +0200
commit0d09e15a1c0cc02255bf0c091efd3b28bbeb0a9f (patch)
tree1947d9588336b76724e9f046d97ede321cafe572 /tests/core_tests
parentMerge pull request #488 (diff)
parentMore changes for 2-min blocks (diff)
downloadmonero-0d09e15a1c0cc02255bf0c091efd3b28bbeb0a9f.tar.xz
Merge pull request #490
baf101e More changes for 2-min blocks Use the correct block time for realtime fuzz on locktime Use the correct block time to calculate next_difficulty on alt chains (will not work as-is with voting) Lock unit tests to original block time for now (Javier Smooth) 4fea1a5 Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block version 2 (Javier Smooth)
Diffstat (limited to 'tests/core_tests')
-rw-r--r--tests/core_tests/block_validation.cpp8
-rw-r--r--tests/core_tests/chaingen.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/core_tests/block_validation.cpp b/tests/core_tests/block_validation.cpp
index 97d6634c0..440e46647 100644
--- a/tests/core_tests/block_validation.cpp
+++ b/tests/core_tests/block_validation.cpp
@@ -45,7 +45,7 @@ namespace
for (size_t i = 0; i < new_block_count; ++i)
{
block blk_next;
- difficulty_type diffic = next_difficulty(timestamps, cummulative_difficulties);
+ difficulty_type diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
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,7 +175,7 @@ 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_type diffic = next_difficulty(timestamps, commulative_difficulties,DIFFICULTY_TARGET_V1);
assert(1 < diffic);
const block& blk_last = boost::get<block>(events.back());
uint64_t timestamp = blk_last.timestamp;
@@ -570,7 +570,7 @@ 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);
+ diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
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;
@@ -585,7 +585,7 @@ 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_size = get_object_blobsize(tx_0);
- diffic = next_difficulty(timestamps, cummulative_difficulties);
+ diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
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_size))
diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp
index 9e7576c12..b430a1682 100644
--- a/tests/core_tests/chaingen.cpp
+++ b/tests/core_tests/chaingen.cpp
@@ -98,7 +98,7 @@ void test_generator::add_block(const cryptonote::block& blk, size_t tsx_size, st
{
const size_t block_size = tsx_size + get_object_blobsize(blk.miner_tx);
uint64_t block_reward;
- get_block_reward(misc_utils::median(block_sizes), block_size, already_generated_coins, block_reward);
+ get_block_reward(misc_utils::median(block_sizes), block_size, already_generated_coins, block_reward, 1);
m_blocks_info[get_block_hash(blk)] = block_info(blk.prev_id, already_generated_coins + block_reward, block_size);
}
@@ -526,7 +526,7 @@ bool construct_miner_tx_manually(size_t height, uint64_t already_generated_coins
// This will work, until size of constructed block is less then CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE
uint64_t block_reward;
- if (!get_block_reward(0, 0, already_generated_coins, block_reward))
+ if (!get_block_reward(0, 0, already_generated_coins, block_reward, 1))
{
LOG_PRINT_L0("Block is too big");
return false;