Skip to content

Commit

Permalink
Update tests to adapt code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed May 10, 2023
1 parent e8e9d0d commit 136007e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/tests/operation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ BOOST_AUTO_TEST_CASE(limit_order_update_test)

// Try changing price
sell_price.base = asset(501);
// Cannot update base amount in the new price to be more than the amount for sale
GRAPHENE_REQUIRE_THROW( update_limit_order(order_id, sell_price), fc::assert_exception );
sell_price.base = asset(500);
BOOST_REQUIRE_EQUAL(fc::json::to_string(order_id(db).sell_price), fc::json::to_string(sell_price));
sell_price.base = asset(499);
update_limit_order(order_id, sell_price);
BOOST_REQUIRE_EQUAL(fc::json::to_string(order_id(db).sell_price), fc::json::to_string(sell_price));
sell_price.base = asset(500);
Expand Down Expand Up @@ -214,7 +219,7 @@ BOOST_AUTO_TEST_CASE(limit_order_update_match_test)
limit_order_id_type order_id_1 = create_sell_order(nathan, asset(999), munee.amount(100), expiration)->get_id();
limit_order_id_type order_id_2 = create_sell_order(nathan, munee.amount(100),asset(1001), expiration)->get_id();

update_limit_order(order_id_1, price(asset(1001), munee.amount(100)), asset(1));
update_limit_order(order_id_1, price(asset(1000), munee.amount(99)), asset(1));
BOOST_REQUIRE( !db.find(order_id_1) );
BOOST_REQUIRE_EQUAL(db.find(order_id_2)->amount_for_sale().amount.value, 1);

Expand Down

0 comments on commit 136007e

Please sign in to comment.