MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / emit_thinkyoung_event

Function emit_thinkyoung_event

src/Chain/libraries/glua/thinkyoung_lua_lib.cpp:639–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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");

Callers

nothing calls this directly

Calls 5

lua_gettopFunction · 0.85
lua_isstringFunction · 0.85
get_contract_id_in_apiFunction · 0.85
throw_exceptionMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected