Skip to content

Commit

Permalink
fix three remaining unit tests
Browse files Browse the repository at this point in the history
Since these tests change price of HIVE, the previous fix that assumed 1/1 HIVE/HBD exchange rate
did not help. They needed a bit more specific corrections.
  • Loading branch information
ABW committed Sep 19, 2023
1 parent 960eef9 commit dc07265
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/unit/tests/operation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3750,7 +3750,7 @@ BOOST_AUTO_TEST_CASE( collateralized_convert_apply )
generate_block(); //actual conversion
alice_balance += ASSET( "500.011 TESTS" ); //excess collateral (1000 - 23.809 * 21/1) - alice used fee corrected market_median_price...
BOOST_REQUIRE( get_balance( "alice" ) == alice_balance );
BOOST_REQUIRE( get_balance( "bob" ) == ASSET( "273.625 TESTS" ) ); //...but bob used artificial current_median_history
BOOST_REQUIRE( get_balance( "bob" ) == ASSET( "273.619 TESTS" ) ); //...but bob used artificial current_median_history
//(for HF25 values of 9%/10%/10% lower/upper/hard cap expected value is 199.102)
//(for 9%/10%/30% expected value is 383.222)
//with different limits value will change, but should be less than 400.000 TESTS
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/tests/operation_time_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ 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.get_hbd_rewards() == ASSET( "6236.000 TBD" ) );
BOOST_CHECK( alice_account.get_hbd_rewards() == ASSET( "6140.000 TBD" ) );
BOOST_CHECK( bob_account.get_hbd_rewards() == ASSET( "0.000 TBD" ) );
BOOST_CHECK( dave_account.get_hbd_rewards() == alice_account.get_hbd_rewards() );
}
Expand Down Expand Up @@ -2690,7 +2690,7 @@ BOOST_AUTO_TEST_CASE( hbd_stability )
{
db.modify( db.get_account( "sam" ), [&]( account_object& a )
{
a.hbd_balance = hbd_balance;
a.hbd_balance = hbd_balance - get_hbd_balance( HIVE_INIT_MINER_NAME ); // initial HBD balance is still on 'initminer'
});
}, database::skip_witness_signature );

Expand Down Expand Up @@ -2735,7 +2735,7 @@ BOOST_AUTO_TEST_CASE( hbd_stability )
{
db.modify( db.get_account( "sam" ), [&]( account_object& a )
{
a.hbd_balance = hbd_balance;
a.hbd_balance = hbd_balance - get_hbd_balance( HIVE_INIT_MINER_NAME ); // initial HBD balance is still on 'initminer'
});
}, database::skip_witness_signature );

Expand Down

0 comments on commit dc07265

Please sign in to comment.