Skip to content

Commit

Permalink
Change assert() to FC_ASSERT in db_block.cpp, #511
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore authored and yoyowd committed Jan 26, 2018
1 parent e1bb5bf commit 0129fa6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libraries/chain/db_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,10 @@ operation_result database::apply_operation(transaction_evaluation_state& eval_st
{ try {
int i_which = op.which();
uint64_t u_which = uint64_t( i_which );
if( i_which < 0 )
assert( "Negative operation tag" && false );
if( u_which >= _operation_evaluators.size() )
assert( "No registered evaluator for this operation" && false );
FC_ASSERT( i_which >= 0, "Negative operation tag in operation ${op}", ("op",op) );
FC_ASSERT( u_which < _operation_evaluators.size(), "No registered evaluator for operation ${op}", ("op",op) );
unique_ptr<op_evaluator>& eval = _operation_evaluators[ u_which ];
if( !eval )
assert( "No registered evaluator for this operation" && false );
FC_ASSERT( eval, "No registered evaluator for operation ${op}", ("op",op) );
auto op_id = push_applied_operation( op );
auto result = eval->evaluate( eval_state, op, true );
set_applied_operation_result( op_id, result );
Expand Down

0 comments on commit 0129fa6

Please sign in to comment.