diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index 29ea4b787..f89301b34 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -1,2 +1,40 @@ +/****************************************************************************** + * 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 "eval.h" +#include "utils.h" +#include "CCinclude.h" +#include "../main.h" +#include "../chain.h" +#include "../core_io.h" +#include "../crosschain.h" char *CClib_name() { return((char *)"stub"); } + +bool CClib_Dispatch(const CC *cond,Eval *eval,std::vector paramsNull,const CTransaction &txTo,unsigned int nIn) +{ + uint8_t evalcode = cond->code[0]; + if ( evalcode >= EVAL_FIRSTUSER && evalcode <= EVAL_LASTUSER ) + { + + } + return eval->Invalid("cclib CC must have evalcode between 16 and 127"); +} diff --git a/src/cc/eval.cpp b/src/cc/eval.cpp index b98982ecd..e30ec263c 100644 --- a/src/cc/eval.cpp +++ b/src/cc/eval.cpp @@ -27,6 +27,7 @@ #include "core_io.h" #include "crosschain.h" +bool CClib_Dispatch(const CC *cond,Eval *eval,std::vector paramsNull,const CTransaction &txTo,unsigned int nIn); Eval* EVAL_TEST = 0; struct CCcontract_info CCinfos[0x100]; @@ -70,13 +71,17 @@ bool Eval::Dispatch(const CC *cond, const CTransaction &txTo, unsigned int nIn) fprintf(stderr,"%s evalcode.%d %02x\n",txTo.GetHash().GetHex().c_str(),ecode,ecode); return Invalid("disabled-code, -ac_ccenables didnt include this ecode"); } + std::vector vparams(cond->code+1, cond->code+cond->codeLength); + if ( ecode >= EVAL_FIRSTUSER && ecode <= EVAL_LASTUSER ) + { + return CClib_Dispatch(cond,this,vparams,txTo,nIn); + } cp = &CCinfos[(int32_t)ecode]; if ( cp->didinit == 0 ) { CCinit(cp,ecode); cp->didinit = 1; } - std::vector vparams(cond->code+1, cond->code+cond->codeLength); switch ( ecode ) { case EVAL_IMPORTPAYOUT: