ImportPayout cc eval code and alot of general cc polish. tests to write
This commit is contained in:
23
src/cc/eval.cpp
Normal file
23
src/cc/eval.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user