Skip to content

Commit

Permalink
Add tests for virtual operation fees
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed May 16, 2023
1 parent 6636959 commit b26d877
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/tests/fee_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3928,6 +3928,14 @@ BOOST_AUTO_TEST_CASE( defaults_test )
asset fee = schedule.calculate_fee( limit_order_create_operation() );
BOOST_CHECK_EQUAL( (int64_t)default_order_fee.fee, fee.amount.value );

// fill_order fee is zero
fee = schedule.calculate_fee( fill_order_operation() );
BOOST_CHECK_EQUAL( (int64_t)0, fee.amount.value );

// execute_bid fee is zero
fee = schedule.calculate_fee( execute_bid_operation() );
BOOST_CHECK_EQUAL( (int64_t)0, fee.amount.value );

limit_order_create_operation::fee_params_t new_order_fee; new_order_fee.fee = 123;
// set fee + check
schedule.parameters.insert( new_order_fee );
Expand All @@ -3951,6 +3959,15 @@ BOOST_AUTO_TEST_CASE( defaults_test )
schedule.parameters.insert( new_bid_fee );
fee = schedule.calculate_fee( bid_collateral_operation() );
BOOST_CHECK_EQUAL( (int64_t)new_bid_fee.fee, fee.amount.value );

// fill_order fee is still zero
fee = schedule.calculate_fee( fill_order_operation() );
BOOST_CHECK_EQUAL( (int64_t)0, fee.amount.value );

// execute_bid fee is still zero
fee = schedule.calculate_fee( execute_bid_operation() );
BOOST_CHECK_EQUAL( (int64_t)0, fee.amount.value );

}
catch( const fc::exception& e )
{
Expand Down

0 comments on commit b26d877

Please sign in to comment.