Skip to content

Commit

Permalink
Fix a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Feb 26, 2023
1 parent b56871d commit c35ef8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/tests/bsrm_indvd_settlement_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2340,20 +2340,20 @@ BOOST_AUTO_TEST_CASE( individual_settlement_to_order_and_matching_as_maker_test

// seller sells some
limit_ptr = create_sell_order( seller_id(db), asset(100000,mpa_id), asset(1000) );
// the limit order is partially filled
BOOST_REQUIRE( limit_ptr );
limit_order_id_type limit_id = limit_ptr->get_id();

auto check_result_1 = [&]
{
// the limit order is partially filled
BOOST_REQUIRE( limit_ptr );

// the settled-debt order is fully filled
BOOST_CHECK( !db.find_settled_debt_order(mpa_id) );

// settled debt receives = 80073
// limit order receives = round_up(80073*19824/1000000) = 1588
// settled debt pays = 1669, collateral fee = 1669 - 1588 = 81

BOOST_CHECK_EQUAL( limit_ptr->for_sale.value, 19927 ); // 100000 - 80073
BOOST_CHECK_EQUAL( limit_id(db).for_sale.value, 19927 ); // 100000 - 80073

BOOST_CHECK_EQUAL( get_balance( seller_id, mpa_id ), 79873 ); // 179873 - 100000
BOOST_CHECK_EQUAL( get_balance( seller_id, asset_id_type() ), 7957 ); // 6369 + 1588
Expand Down

0 comments on commit c35ef8b

Please sign in to comment.