| 773 | |
| 774 | |
| 775 | void GluaChainApi::emit(lua_State *L, const char* contract_id, const char* event_name, const char* event_param) |
| 776 | { |
| 777 | thinkyoung::lua::lib::increment_lvm_instructions_executed_count(L, CHAIN_GLUA_API_EACH_INSTRUCTIONS_COUNT - 1); |
| 778 | try { |
| 779 | thinkyoung::blockchain::TransactionEvaluationState* eval_state_ptr = |
| 780 | (thinkyoung::blockchain::TransactionEvaluationState*) |
| 781 | (thinkyoung::lua::lib::get_lua_state_value(L, "evaluate_state").pointer_value); |
| 782 | |
| 783 | if (eval_state_ptr == NULL) |
| 784 | FC_CAPTURE_AND_THROW(lua_executor_internal_error, ("")); |
| 785 | |
| 786 | EventOperation event_op(Address(contract_id, AddressType::contract_address), std::string(event_name), std::string(event_param)); |
| 787 | eval_state_ptr->p_result_trx.push_event_operation(event_op); |
| 788 | } |
| 789 | catch (const fc::exception&) |
| 790 | { |
| 791 | L->force_stopping = true; |
| 792 | L->exit_code = LUA_API_INTERNAL_ERROR; |
| 793 | return; |
| 794 | } |
| 795 | } |
| 796 | |
| 797 | } |
| 798 | } |
no test coverage detected