ImportPayout cc eval code and alot of general cc polish. tests to write

This commit is contained in:
Scott Sadler
2018-03-30 15:46:41 -03:00
parent 991c422a9d
commit 2c8d8268dd
25 changed files with 389 additions and 116 deletions

23
src/cc/eval.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "primitives/transaction.h"
#include "komodo_cc.h"
#include "cc/eval.h"
#include <cryptoconditions.h>
/*
* Test the validity of an Eval node
*/
bool EvalConditionValidity(const CC *cond, const CTransaction *txTo, int nIn)
{
if (strcmp(cond->method, "testEval") == 0) {
return cond->paramsBinLength == 8 &&
memcmp(cond->paramsBin, "testEval", 8) == 0;
}
if (strcmp(cond->method, "ImportPayout") == 0) {
return CheckImportPayout(cond, txTo, nIn);
}
fprintf(stderr, "no defined behaviour for method: %s\n", cond->method);
return 0;
}