Skip to content

Commit

Permalink
Add GCOVR_EXCL_LINE for FC_CAPTURE_AND_RETHROW
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed May 16, 2023
1 parent b26d877 commit 7e92562
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
28 changes: 14 additions & 14 deletions libraries/chain/credit_offer_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void_result credit_offer_create_evaluator::do_evaluate(const credit_offer_create
"The account is unauthorized by the asset" );

return void_result();
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

object_id_type credit_offer_create_evaluator::do_apply(const credit_offer_create_operation& op) const
{ try {
Expand All @@ -88,7 +88,7 @@ object_id_type credit_offer_create_evaluator::do_apply(const credit_offer_create
obj.acceptable_borrowers = op.acceptable_borrowers;
});
return new_credit_offer_object.id;
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void_result credit_offer_delete_evaluator::do_evaluate(const credit_offer_delete_operation& op)
{ try {
Expand All @@ -104,7 +104,7 @@ void_result credit_offer_delete_evaluator::do_evaluate(const credit_offer_delete
// Note: no asset authorization check here, allow funds to be moved to account balance

return void_result();
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

asset credit_offer_delete_evaluator::do_apply(const credit_offer_delete_operation& op) const
{ try {
Expand All @@ -120,7 +120,7 @@ asset credit_offer_delete_evaluator::do_apply(const credit_offer_delete_operatio
d.remove( *_offer );

return released;
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void_result credit_offer_update_evaluator::do_evaluate(const credit_offer_update_operation& op)
{ try {
Expand Down Expand Up @@ -180,7 +180,7 @@ void_result credit_offer_update_evaluator::do_evaluate(const credit_offer_update
}

return void_result();
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void_result credit_offer_update_evaluator::do_apply( const credit_offer_update_operation& op) const
{ try {
Expand Down Expand Up @@ -224,7 +224,7 @@ void_result credit_offer_update_evaluator::do_apply( const credit_offer_update_o
}

return void_result();
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void_result credit_offer_accept_evaluator::do_evaluate(const credit_offer_accept_operation& op)
{ try {
Expand Down Expand Up @@ -304,7 +304,7 @@ void_result credit_offer_accept_evaluator::do_evaluate(const credit_offer_accept
}

return void_result();
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

extendable_operation_result credit_offer_accept_evaluator::do_apply( const credit_offer_accept_operation& op) const
{ try {
Expand Down Expand Up @@ -368,7 +368,7 @@ extendable_operation_result credit_offer_accept_evaluator::do_apply( const credi
result.value.impacted_accounts = flat_set<account_id_type>({ _offer->owner_account });

return result;
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void_result credit_deal_repay_evaluator::do_evaluate(const credit_deal_repay_operation& op)
{ try {
Expand Down Expand Up @@ -400,7 +400,7 @@ void_result credit_deal_repay_evaluator::do_evaluate(const credit_deal_repay_ope
"The owner of the credit offer is unauthorized by the repaying asset" );

return void_result();
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

extendable_operation_result credit_deal_repay_evaluator::do_apply( const credit_deal_repay_operation& op) const
{ try {
Expand Down Expand Up @@ -470,10 +470,10 @@ extendable_operation_result credit_deal_repay_evaluator::do_apply( const credit_
result.value.received = vector<asset>({ collateral_released });

return result;
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void_result credit_deal_update_evaluator::do_evaluate(const credit_deal_update_operation& op)
{
{ try {
const database& d = db();
const auto block_time = d.head_block_time();

Expand All @@ -486,17 +486,17 @@ void_result credit_deal_update_evaluator::do_evaluate(const credit_deal_update_o
FC_ASSERT( _deal->auto_repay != op.auto_repay, "The automatic repayment type does not change" );

return void_result();
}
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void_result credit_deal_update_evaluator::do_apply( const credit_deal_update_operation& op) const
{
{ try {
database& d = db();

d.modify( *_deal, [&op]( credit_deal_object& obj ){
obj.auto_repay = op.auto_repay;
});

return void_result();
}
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

} } // graphene::chain
24 changes: 12 additions & 12 deletions libraries/chain/market_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void_result limit_order_create_evaluator::do_evaluate(const limit_order_create_o
("balance",d.get_balance(*_seller,*_sell_asset))("amount_to_sell",op.amount_to_sell) );

return void_result();
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void limit_order_create_evaluator::convert_fee()
{
Expand Down Expand Up @@ -133,7 +133,7 @@ object_id_type limit_order_create_evaluator::do_apply(const limit_order_create_o
("op",op) );

return order_id;
} FC_CAPTURE_AND_RETHROW( (op) ) }
} FC_CAPTURE_AND_RETHROW( (op) ) } // GCOVR_EXCL_LINE

void limit_order_update_evaluator::convert_fee()
{
Expand All @@ -153,7 +153,7 @@ void limit_order_update_evaluator::pay_fee()
}

void_result limit_order_update_evaluator::do_evaluate(const limit_order_update_operation& o)
{
{ try {
const database& d = db();
FC_ASSERT( HARDFORK_CORE_1604_PASSED( d.head_block_time() ) , "Operation has not activated yet");

Expand Down Expand Up @@ -241,7 +241,7 @@ void_result limit_order_update_evaluator::do_evaluate(const limit_order_update_o
"The account is not allowed to transact the receiving asset" );

return {};
}
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE

void limit_order_update_evaluator::process_deferred_fee()
{
Expand Down Expand Up @@ -328,7 +328,7 @@ void limit_order_update_evaluator::process_deferred_fee()
}

void_result limit_order_update_evaluator::do_apply(const limit_order_update_operation& o)
{
{ try {
database& d = db();

// Adjust account balance
Expand Down Expand Up @@ -363,7 +363,7 @@ void_result limit_order_update_evaluator::do_apply(const limit_order_update_oper
d.apply_order(*_order);

return {};
}
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE

void_result limit_order_cancel_evaluator::do_evaluate(const limit_order_cancel_operation& o)
{ try {
Expand All @@ -382,7 +382,7 @@ void_result limit_order_cancel_evaluator::do_evaluate(const limit_order_cancel_o
("oid", o.order) );

return void_result();
} FC_CAPTURE_AND_RETHROW( (o) ) }
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE

asset limit_order_cancel_evaluator::do_apply(const limit_order_cancel_operation& o) const
{ try {
Expand All @@ -404,7 +404,7 @@ asset limit_order_cancel_evaluator::do_apply(const limit_order_cancel_operation&
}

return refunded;
} FC_CAPTURE_AND_RETHROW( (o) ) }
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE

void_result call_order_update_evaluator::do_evaluate(const call_order_update_operation& o)
{ try {
Expand Down Expand Up @@ -488,7 +488,7 @@ void_result call_order_update_evaluator::do_evaluate(const call_order_update_ope
// which is now removed since the check is implicitly done later by `adjust_balance()` in `do_apply()`.

return void_result();
} FC_CAPTURE_AND_RETHROW( (o) ) }
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE


object_id_type call_order_update_evaluator::do_apply(const call_order_update_operation& o)
Expand Down Expand Up @@ -696,7 +696,7 @@ object_id_type call_order_update_evaluator::do_apply(const call_order_update_ope
}

return call_order_id;
} FC_CAPTURE_AND_RETHROW( (o) ) }
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE

void_result bid_collateral_evaluator::do_evaluate(const bid_collateral_operation& o)
{ try {
Expand Down Expand Up @@ -758,7 +758,7 @@ void_result bid_collateral_evaluator::do_evaluate(const bid_collateral_operation
}

return void_result();
} FC_CAPTURE_AND_RETHROW( (o) ) }
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE


void_result bid_collateral_evaluator::do_apply(const bid_collateral_operation& o) const
Expand All @@ -780,6 +780,6 @@ void_result bid_collateral_evaluator::do_apply(const bid_collateral_operation& o
// Note: CORE asset in collateral_bid_object is not counted in account_stats.total_core_in_orders

return void_result();
} FC_CAPTURE_AND_RETHROW( (o) ) }
} FC_CAPTURE_AND_RETHROW( (o) ) } // GCOVR_EXCL_LINE

} } // graphene::chain
8 changes: 4 additions & 4 deletions libraries/protocol/market.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ void limit_order_create_operation::validate()const
}

void limit_order_update_operation::validate() const
{
{ try {
FC_ASSERT(fee.amount >= 0, "Fee must not be negative");
FC_ASSERT(new_price || delta_amount_to_sell || new_expiration,
"Cannot update limit order if nothing is specified to update");
if (new_price)
new_price->validate();
if (delta_amount_to_sell)
FC_ASSERT(delta_amount_to_sell->amount != 0, "Cannot change limit order amount by zero");
}
} FC_CAPTURE_AND_RETHROW((*this)) } // GCOVR_EXCL_LINE

void limit_order_cancel_operation::validate()const
{
Expand All @@ -59,13 +59,13 @@ void call_order_update_operation::validate()const

// note: no validation is needed for extensions so far: the only attribute inside is target_collateral_ratio

} FC_CAPTURE_AND_RETHROW((*this)) }
} FC_CAPTURE_AND_RETHROW((*this)) } // GCOVR_EXCL_LINE

void bid_collateral_operation::validate()const
{ try {
FC_ASSERT( fee.amount >= 0 );
FC_ASSERT( debt_covered.amount == 0 || (debt_covered.amount > 0 && additional_collateral.amount > 0) );
} FC_CAPTURE_AND_RETHROW((*this)) }
} FC_CAPTURE_AND_RETHROW((*this)) } // GCOVR_EXCL_LINE

} } // graphene::protocol

Expand Down

0 comments on commit 7e92562

Please sign in to comment.