| 194 | } |
| 195 | |
| 196 | bool GluaChainApi::check_contract_exist(lua_State *L, const char *name) |
| 197 | { |
| 198 | thinkyoung::blockchain::TransactionEvaluationState* eval_state_ptr = |
| 199 | (thinkyoung::blockchain::TransactionEvaluationState*) |
| 200 | (thinkyoung::lua::lib::get_lua_state_value(L, "evaluate_state").pointer_value); |
| 201 | |
| 202 | if (!eval_state_ptr) |
| 203 | return NULL; |
| 204 | |
| 205 | thinkyoung::blockchain::ChainInterface* cur_state = eval_state_ptr->_current_state; |
| 206 | |
| 207 | oContractEntry entry = cur_state->get_contract_entry(std::string(name)); |
| 208 | |
| 209 | return entry.valid(); |
| 210 | } |
| 211 | |
| 212 | std::shared_ptr<GluaModuleByteStream> GluaChainApi::get_bytestream_from_code(lua_State *L, const Code& code) |
| 213 | { |
no test coverage detected