/****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * * * * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * * the top-level directory of this distribution for the individual copyright * * holder information and the developer policies on copyright and licensing. * * * * Unless otherwise agreed in a custom licensing agreement, no part of the * * SuperNET software, including this file may be copied, modified, propagated * * or distributed except according to the terms contained in the LICENSE file * * * * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ #include #include #include "primitives/block.h" #include "primitives/transaction.h" #include "script/cc.h" #include "cc/eval.h" #include "cc/utils.h" #include "cc/CCinclude.h" #include "main.h" #include "chain.h" #include "core_io.h" #include "crosschain.h" struct CClib_rpcinfo { char *method,*help; int32_t numrequiredargs,maxargs; // frontloaded with required uint8_t funcid; } CClib_methods[] = { { "faucet2_get", "", 0, 0, 'G' }, }; #define MYCCLIBNAME ((char *)"stub") char *CClib_name() { return(MYCCLIBNAME); } std::string CClib_rawtxgen(struct CC_info *cp,uint8_t funcid,cJSON *params); UniValue CClib_info(struct CC_info *cp) { UniValue result(UniValue::VOBJ),a(UniValue::VARR); int32_t i; char str[2]; result.push_back(Pair("result","success")); result.push_back(Pair("CClib",CClib_name())); for (i=0; i= 128 ) obj.push_back(Pair("funcid",CClib_methods[i].funcid)); else { str[0] = CClib_methods[i].funcid; str[1] = 0; obj.push_back(Pair("funcid",str)); } obj.push_back(Pair("name",CClib_methods[i].method)); obj.push_back(Pair("help",CClib_methods[i].help)); obj.push_back(Pair("params_required",CClib_methods[i].numrequiredargs)); obj.push_back(Pair("params_max",CClib_methods[i].maxargs)); a.push_back(obj)); } result.push_back(Pair("methods",a)); return(result); } UniValue CClib(struct CC_info *cp,char *method,cJSON *params) { UniValue result(UniValue::VOBJ); int32_t i; std::string rawtx; for (i=0; i