aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core_tests/chaingen.cpp4
-rw-r--r--tests/unit_tests/block_reward.cpp14
2 files changed, 9 insertions, 9 deletions
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;
diff --git a/tests/unit_tests/block_reward.cpp b/tests/unit_tests/block_reward.cpp
index 7eed3a778..308ef2997 100644
--- a/tests/unit_tests/block_reward.cpp
+++ b/tests/unit_tests/block_reward.cpp
@@ -46,9 +46,9 @@ namespace
uint64_t m_block_reward;
};
- #define TEST_ALREADY_GENERATED_COINS(already_generated_coins, expected_reward) \
- m_block_not_too_big = get_block_reward(0, current_block_size, already_generated_coins, m_block_reward); \
- ASSERT_TRUE(m_block_not_too_big); \
+ #define TEST_ALREADY_GENERATED_COINS(already_generated_coins, expected_reward) \
+ m_block_not_too_big = get_block_reward(0, current_block_size, already_generated_coins, m_block_reward,1); \
+ ASSERT_TRUE(m_block_not_too_big); \
ASSERT_EQ(m_block_reward, expected_reward);
TEST_F(block_reward_and_already_generated_coins, handles_first_values)
@@ -79,14 +79,14 @@ namespace
protected:
virtual void SetUp()
{
- m_block_not_too_big = get_block_reward(0, 0, already_generated_coins, m_standard_block_reward);
+ m_block_not_too_big = get_block_reward(0, 0, already_generated_coins, m_standard_block_reward, 1);
ASSERT_TRUE(m_block_not_too_big);
ASSERT_LT(CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE, m_standard_block_reward);
}
void do_test(size_t median_block_size, size_t current_block_size)
{
- m_block_not_too_big = get_block_reward(median_block_size, current_block_size, already_generated_coins, m_block_reward);
+ m_block_not_too_big = get_block_reward(median_block_size, current_block_size, already_generated_coins, m_block_reward, 1);
}
static const uint64_t already_generated_coins = 0;
@@ -168,14 +168,14 @@ namespace
m_last_block_sizes_median = 7 * CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE;
- m_block_not_too_big = get_block_reward(epee::misc_utils::median(m_last_block_sizes), 0, already_generated_coins, m_standard_block_reward);
+ m_block_not_too_big = get_block_reward(epee::misc_utils::median(m_last_block_sizes), 0, already_generated_coins, m_standard_block_reward, 1);
ASSERT_TRUE(m_block_not_too_big);
ASSERT_LT(CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE, m_standard_block_reward);
}
void do_test(size_t current_block_size)
{
- m_block_not_too_big = get_block_reward(epee::misc_utils::median(m_last_block_sizes), current_block_size, already_generated_coins, m_block_reward);
+ m_block_not_too_big = get_block_reward(epee::misc_utils::median(m_last_block_sizes), current_block_size, already_generated_coins, m_block_reward, 1);
}
static const uint64_t already_generated_coins = 0;