MCPcopy Create free account
hub / github.com/ElementsProject/elements / evalTCOProgram

Function evalTCOProgram

src/simplicity/eval.h:95–97  ·  view source on GitHub ↗

Run the Bit Machine on the well-typed Simplicity program 'dag[len]'. * * If malloc fails, returns 'SIMPLICITY_ERR_MALLOC'. * When a budget is given, if static analysis results determines the bound on cpu requirements exceed the allowed budget, returns 'SIMPLICITY_ERR_EXEC_BUDGET'. * If static analysis results determines the bound on cpu requirements is less than or equal to the minCost, return

Source from the content-addressed store, hash-verified

93 * if 'dag[len]' represents a Simplicity expression with primitives then 'NULL != env';
94 */
95static inline simplicity_err evalTCOProgram(const dag_node* dag, type* type_dag, size_t len, ubounded minCost, const ubounded* budget, const txEnv* env) {
96 return simplicity_evalTCOExpression(CHECK_ALL, NULL, NULL, dag, type_dag, len, minCost, budget, env);
97}
98#endif

Callers 3

test_programFunction · 0.85
exactBudget_testFunction · 0.85

Calls 1

Tested by 2

test_programFunction · 0.68
exactBudget_testFunction · 0.68