| 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 | /* 获取某个块(可以是未来块,也可能是过去块)上某个哈希数据产生的伪随机数 */ |
nothing calls this directly
no test coverage detected