Skip to content

Commit

Permalink
Call "assert_reward" callback before the callback "assert_balance"
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan-dolgorukov committed Jan 20, 2025
1 parent c8108d1 commit a933c96
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/core_tests/block_validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,8 @@ bool block_reward_in_alt_chain_basic::generate(std::vector<test_event_entry>& ev
(blk_0) - ... - (blk_0r) */

argument_alt = argument = {this, blk_0r, std::list<uint64_t>(CURRENCY_MINED_MONEY_UNLOCK_WINDOW), argument};
assert_balance(argument);
assert_reward(argument);
assert_balance(argument);

MAKE_TX_FEE(events, tx_0, miner, miner, MK_TEST_COINS(1), TESTS_DEFAULT_FEE, blk_0r);
MAKE_NEXT_BLOCK_TX1(events, blk_1, blk_0r, miner, tx_0);
Expand Down Expand Up @@ -1054,14 +1054,14 @@ bool block_reward_in_alt_chain_basic::generate(std::vector<test_event_entry>& ev

if (m_hardforks.is_hardfork_active_for_height(ZANO_HARDFORK_04_ZARCANUM, get_block_height(blk_1)))
{
assert_balance(argument_alt);
assert_reward(argument_alt);
assert_balance(argument_alt);
}

else
{
assert_balance(argument);
assert_reward(argument);
assert_balance(argument);
}

MAKE_TX_FEE(events, tx_2, miner, miner, MK_TEST_COINS(1), 8 * TESTS_DEFAULT_FEE, blk_1);
Expand All @@ -1081,8 +1081,8 @@ bool block_reward_in_alt_chain_basic::generate(std::vector<test_event_entry>& ev
height(blk_2) > height(blk_1a). */

argument = {this, blk_2, {(8 + 57) * TESTS_DEFAULT_FEE}, argument};
assert_balance(argument);
assert_reward(argument);
assert_balance(argument);

const auto& head_blk_for_txs_on_height_12{m_hardforks.is_hardfork_active_for_height(ZANO_HARDFORK_04_ZARCANUM, get_block_height(blk_2)) ? blk_1a : blk_0r};
MAKE_TX_FEE(events, tx_4, miner, miner, MK_TEST_COINS(2), 15 * TESTS_DEFAULT_FEE, head_blk_for_txs_on_height_12);
Expand All @@ -1109,14 +1109,14 @@ bool block_reward_in_alt_chain_basic::generate(std::vector<test_event_entry>& ev
if (m_hardforks.is_hardfork_active_for_height(ZANO_HARDFORK_04_ZARCANUM, get_block_height(blk_2)))
{
argument_alt = {this, blk_2a, {(15 + 29 + 22) * TESTS_DEFAULT_FEE}, argument_alt};
assert_balance(argument_alt);
assert_reward(argument_alt);
assert_balance(argument_alt);
}

else
{
assert_balance(argument);
assert_reward(argument);
assert_balance(argument);
}

return true;
Expand Down

0 comments on commit a933c96

Please sign in to comment.