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

Function wait_for_future_random

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

Source from the content-addressed store, hash-verified

604 }
605
606 static int wait_for_future_random(lua_State *L) {
607 if (lua_gettop(L) < 1 || !lua_isinteger(L, 1)) {
608 thinkyoung::lua::api::global_glua_chain_api->throw_exception(L, THINKYOUNG_API_SIMPLE_ERROR, "wait_for_future_random need a integer param");
609 return 0;
610 }
611
612 auto next = luaL_checkinteger(L, 1);
613
614 if (next <= 0) {
615 thinkyoung::lua::api::global_glua_chain_api->throw_exception(L, THINKYOUNG_API_SIMPLE_ERROR, "wait_for_future_random first param must be positive number");
616 return 0;
617 }
618
619 auto result = thinkyoung::lua::api::global_glua_chain_api->wait_for_future_random(L, (int)next);
620 lua_pushinteger(L, result);
621 return 1;
622 }
623
624 /************************************************************************/
625 /* 获取某个块(可以是未来块,也可能是过去块)上某个哈希数据产生的伪随机数 */

Callers

nothing calls this directly

Calls 5

lua_gettopFunction · 0.85
lua_isintegerFunction · 0.85
lua_pushintegerFunction · 0.85
throw_exceptionMethod · 0.45

Tested by

no test coverage detected