| 637 | } |
| 638 | |
| 639 | static int emit_thinkyoung_event(lua_State *L) { |
| 640 | if (lua_gettop(L) < 2 && (!lua_isstring(L, 1) || !lua_isstring(L, 2))) { |
| 641 | thinkyoung::lua::api::global_glua_chain_api->throw_exception(L, THINKYOUNG_API_SIMPLE_ERROR, "emit need 2 string params"); |
| 642 | return 0; |
| 643 | } |
| 644 | |
| 645 | const char *contract_id = get_contract_id_in_api(L); |
| 646 | const char *event_name = luaL_checkstring(L, 1); |
| 647 | const char *event_param = luaL_checkstring(L, 2); |
| 648 | |
| 649 | if (!contract_id || strlen(contract_id) < 1) |
| 650 | return 0; |
| 651 | |
| 652 | thinkyoung::lua::api::global_glua_chain_api->emit(L, contract_id, event_name, event_param); |
| 653 | return 0; |
| 654 | } |
| 655 | |
| 656 | static int glua_core_lib_Stream_size(lua_State *L) { |
| 657 | auto stream = (GluaByteStream*) luaL_checkudata(L, 1, "GluaByteStream_metatable"); |
nothing calls this directly
no test coverage detected