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

Method check_contract_exist

src/Chain/libraries/glua/thinkyoung_lua_api.cpp:196–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 4

check_contract_protoFunction · 0.45

Calls 3

get_lua_state_valueFunction · 0.85
stringClass · 0.50
validMethod · 0.45

Tested by

no test coverage detected