Skip to content

Commit

Permalink
steemit#3328: Adjust unit tests to compensate for change in reward fund
Browse files Browse the repository at this point in the history
  • Loading branch information
sgerbino committed Jun 3, 2019
1 parent 7405bc3 commit 004670c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
15 changes: 11 additions & 4 deletions tests/tests/operation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6741,11 +6741,18 @@ BOOST_AUTO_TEST_CASE( comment_beneficiaries_apply )

generate_block();

ilog("alice sbd balance: ${b}", ("b", db->get_account( "alice" ).reward_sbd_balance) );
ilog("alice vesting steem: ${b}", ("b", db->get_account( "alice" ).reward_vesting_steem) );
ilog("bob sbd balance: ${b}", ("b", db->get_account( "bob" ).reward_sbd_balance) );
ilog("bob vesting steem: ${b}", ("b", db->get_account( "bob" ).reward_vesting_steem) );
ilog("sam sbd balance: ${b}", ("b", db->get_account( "sam" ).reward_sbd_balance) );
ilog("sam vesting steem: ${b}", ("b", db->get_account( "sam" ).reward_vesting_steem) );

BOOST_REQUIRE( db->get_account( "bob" ).reward_vesting_steem.amount + db->get_account( "bob" ).reward_sbd_balance.amount + db->get_account( "sam" ).reward_vesting_steem.amount + db->get_account( "sam" ).reward_sbd_balance.amount == db->get_comment( "alice", string( "test" ) ).beneficiary_payout_value.amount );
BOOST_REQUIRE( ( db->get_account( "alice" ).reward_sbd_balance.amount + db->get_account( "alice" ).reward_vesting_steem.amount ) == db->get_account( "bob" ).reward_vesting_steem.amount + db->get_account( "bob" ).reward_sbd_balance.amount + 2 );
BOOST_REQUIRE( ( db->get_account( "alice" ).reward_sbd_balance.amount + db->get_account( "alice" ).reward_vesting_steem.amount ) * 2 == db->get_account( "sam" ).reward_vesting_steem.amount + db->get_account( "sam" ).reward_sbd_balance.amount + 3 );
BOOST_REQUIRE( db->get_account( "bob" ).reward_vesting_steem.amount == db->get_account( "bob" ).reward_sbd_balance.amount );
BOOST_REQUIRE( db->get_account( "sam" ).reward_vesting_steem.amount == db->get_account( "sam" ).reward_sbd_balance.amount + 1 );
BOOST_REQUIRE( ( db->get_account( "alice" ).reward_sbd_balance.amount + db->get_account( "alice" ).reward_vesting_steem.amount ) == db->get_account( "bob" ).reward_vesting_steem.amount + db->get_account( "bob" ).reward_sbd_balance.amount + 1 );
BOOST_REQUIRE( ( db->get_account( "alice" ).reward_sbd_balance.amount + db->get_account( "alice" ).reward_vesting_steem.amount ) == ( db->get_account( "sam" ).reward_vesting_steem.amount + db->get_account( "sam" ).reward_sbd_balance.amount ) / 2 + 1 );
BOOST_REQUIRE( db->get_account( "bob" ).reward_vesting_steem.amount == db->get_account( "bob" ).reward_sbd_balance.amount + 1 );
BOOST_REQUIRE( db->get_account( "sam" ).reward_vesting_steem.amount == db->get_account( "sam" ).reward_sbd_balance.amount );
}
FC_LOG_AND_RETHROW()
}
Expand Down
7 changes: 6 additions & 1 deletion tests/tests/operation_time_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ BOOST_AUTO_TEST_CASE( comment_payout_equalize )
const account_object& bob_account = db->get_account("bob");
const account_object& dave_account = db->get_account("dave");

BOOST_CHECK( alice_account.reward_sbd_balance == ASSET( "10720.000 TBD" ) );
ilog( "alice sbd balance: ${b}", ("b", alice_account.reward_sbd_balance) );
ilog( "bob sbd balance: ${b}", ("b", bob_account.reward_sbd_balance) );
ilog( "dave sbd balance: ${b}", ("b", dave_account.reward_sbd_balance) );


BOOST_CHECK( alice_account.reward_sbd_balance == ASSET( "7147.000 TBD" ) );
BOOST_CHECK( bob_account.reward_sbd_balance == ASSET( "0.000 TBD" ) );
BOOST_CHECK( dave_account.reward_sbd_balance == alice_account.reward_sbd_balance );
}
Expand Down

0 comments on commit 004670c

Please sign in to comment.