From 0129fa60c61a9fe212cf62a76bd9999dc9d930ad Mon Sep 17 00:00:00 2001 From: abitmore Date: Sat, 20 Jan 2018 21:37:53 +0000 Subject: [PATCH] Change assert() to FC_ASSERT in db_block.cpp, #511 --- libraries/chain/db_block.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index 116c2ca3..75457cdc 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -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& 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 );